3fad4508230608599458964b5b377392ee579b07
7 #include "LimitsTools.h"
12 /*----------------------------------------------------------------------*\
14 \*---------------------------------------------------------------------*/
16 /*--------------------------------------*\
18 \*-------------------------------------*/
20 extern int mainCore();
21 extern int mainTest();
23 /*--------------------------------------*\
25 \*-------------------------------------*/
29 /*--------------------------------------*\
31 \*-------------------------------------*/
33 static void initCuda(int deviceId
);
34 static int start(void);
36 /*----------------------------------------------------------------------*\
38 \*---------------------------------------------------------------------*/
40 /*--------------------------------------*\
42 \*-------------------------------------*/
46 cout
<< "main" << endl
;
48 // LimitsTools::rappelTypeSize();
53 Device::printAllSimple();
55 // Server Cuda1: in [0,5]
56 // Server Cuda2: in [0,2]
61 //cudaDeviceReset causes the driver to clean up all state.
62 // While not mandatory in normal operation, it is good practice.
63 HANDLE_ERROR(cudaDeviceReset());
73 void initCuda(int deviceId
)
75 // Check deviceId area
76 int nbDevice
= Device::getDeviceCount();
77 assert(deviceId
>= 0 && deviceId
< nbDevice
);
79 //HANDLE_ERROR(cudaDeviceReset());
81 // Choose current device (state of host-thread)
82 HANDLE_ERROR(cudaSetDevice(deviceId
));
84 // It can be usefull to preload driver, by example to practice benchmarking! (sometimes slow under linux)
85 Device::loadCudaDriver(deviceId
);
86 // Device::loadCudaDriverAll();// Force driver to be load for all GPU
91 Device::printCurrent();
105 /*----------------------------------------------------------------------*\
107 \*---------------------------------------------------------------------*/