1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#ifndef RTS_CUDA_DEVICES #define RTS_CUDA_DEVICES #include <cuda.h> namespace rts{ int maxThreadsPerBlock() { int device; cudaGetDevice(&device); //get the id of the current device cudaDeviceProp props; //device property structure cudaGetDeviceProperties(&props, device); return props.maxThreadsPerBlock; } } //end namespace rts #endif