X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Ftest%2FmainCU.cu;fp=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Ftest%2FmainCU.cu;h=8e71c621e7fbe0601a293ed1057577354fed0f51;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_Cuda/src/test/mainCU.cu b/WCudaMSE/BilatTools_Cuda/src/test/mainCU.cu new file mode 100755 index 0000000..8e71c62 --- /dev/null +++ b/WCudaMSE/BilatTools_Cuda/src/test/mainCU.cu @@ -0,0 +1,66 @@ +#include +#include + +using std::cout; +using std::endl; + +/*----------------------------------------------------------------------*\ + |* Importation *| + \*---------------------------------------------------------------------*/ + +#include "cu.h" +#include "cu_cpp.h" + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Imported *| + \*-------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +bool mainCU(void); + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +static void lauchKernel(void); +static __global__ void kernelTest(void); + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +bool mainCU(void) + { + cout << "[BilatTools_Cuda] : just inlcude to force compilation in .cu" << endl; + + lauchKernel(); + + return true; + } + +void lauchKernel(void) + { + dim3 dg = dim3(1, 1, 1); + dim3 db = dim3(1, 1, 1); + + kernelTest<<>>(); + Device::synchronize(); + } + +__global__ void kernelTest(void) + { + printf("\nHello from kernel\n"); // TODO use classe + } + + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +