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