1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 21:50:45 +01:00

Move GPU cuda call earlier

This commit is contained in:
Peter Boyle 2019-07-01 07:28:41 +01:00
parent 1cd4ee0706
commit 6a13731818

View File

@ -248,6 +248,7 @@ void GridGpuInit(void)
for (int i = 0; i < nDevices; i++) { for (int i = 0; i < nDevices; i++) {
cudaDeviceProp prop; cudaDeviceProp prop;
cudaGetDeviceProperties(&prop, i); cudaGetDeviceProperties(&prop, i);
/*
printf("Device Number: %d\n", i); printf("Device Number: %d\n", i);
printf(" Device name: %s\n", prop.name); printf(" Device name: %s\n", prop.name);
printf(" Memory Clock Rate (KHz): %d\n", printf(" Memory Clock Rate (KHz): %d\n",
@ -273,6 +274,7 @@ void GridGpuInit(void)
GPU_PROP(singleToDoublePrecisionPerfRatio); GPU_PROP(singleToDoublePrecisionPerfRatio);
GPU_PROP(unifiedAddressing); GPU_PROP(unifiedAddressing);
GPU_PROP(warpSize); GPU_PROP(warpSize);
*/
} }
} }
#endif #endif
@ -305,6 +307,9 @@ void Grid_init(int *argc,char ***argv)
Grid_debug_handler_init(); Grid_debug_handler_init();
} }
#ifdef GRID_NVCC
GridGpuInit();
#endif
CartesianCommunicator::Init(argc,argv); CartesianCommunicator::Init(argc,argv);
if( !GridCmdOptionExists(*argv,*argv+*argc,"--debug-stdout") ){ if( !GridCmdOptionExists(*argv,*argv+*argc,"--debug-stdout") ){
@ -365,9 +370,6 @@ void Grid_init(int *argc,char ***argv)
std::cout << std::endl; std::cout << std::endl;
} }
#ifdef GRID_NVCC
GridGpuInit();
#endif
//////////////////////////////////// ////////////////////////////////////
// Logging // Logging