8e71c621e7fbe0601a293ed1057577354fed0f51
[GPU.git] / WCudaMSE / BilatTools_Cuda / src / test / mainCU.cu
1 #include <stdio.h>\r
2 #include <iostream>\r
3 \r
4 using std::cout;\r
5 using std::endl;\r
6 \r
7 /*----------------------------------------------------------------------*\\r
8  |*                     Importation                                     *|\r
9  \*---------------------------------------------------------------------*/\r
10 \r
11 #include "cu.h"\r
12 #include "cu_cpp.h"\r
13 \r
14 /*----------------------------------------------------------------------*\\r
15  |*                     Implementation                                  *|\r
16  \*---------------------------------------------------------------------*/\r
17 \r
18 /*--------------------------------------*\\r
19   |*            Imported                *|\r
20  \*-------------------------------------*/\r
21 \r
22 /*--------------------------------------*\\r
23  |*             Public                  *|\r
24  \*-------------------------------------*/\r
25 \r
26 bool mainCU(void);\r
27 \r
28 /*--------------------------------------*\\r
29  |*             Private                 *|\r
30  \*-------------------------------------*/\r
31 \r
32 static void lauchKernel(void);\r
33 static __global__ void kernelTest(void);\r
34 \r
35 /*--------------------------------------*\\r
36  |*             Private                 *|\r
37  \*-------------------------------------*/\r
38 \r
39 bool mainCU(void)\r
40     {\r
41     cout << "[BilatTools_Cuda] : just inlcude to force compilation in .cu" << endl;\r
42 \r
43     lauchKernel();\r
44 \r
45     return true;\r
46     }\r
47 \r
48 void lauchKernel(void)\r
49     {\r
50     dim3 dg = dim3(1, 1, 1);\r
51     dim3 db = dim3(1, 1, 1);\r
52 \r
53     kernelTest<<<dg,db>>>();\r
54     Device::synchronize();\r
55     }\r
56 \r
57 __global__ void kernelTest(void)\r
58     {\r
59     printf("\nHello from kernel\n"); // TODO use classe\r
60     }\r
61 \r
62 \r
63 /*----------------------------------------------------------------------*\\r
64  |*                     End                                             *|\r
65  \*---------------------------------------------------------------------*/\r
66 \r