devices.h
599 Bytes
#ifndef RTS_CUDA_DEVICES
#define RTS_CUDA_DEVICES
#include <cuda.h>
namespace stim{
extern "C"
int maxThreadsPerBlock()
{
int device;
cudaGetDevice(&device); //get the id of the current device
cudaDeviceProp props; //device property structure
cudaGetDeviceProperties(&props, device);
return props.maxThreadsPerBlock;
}
extern "C"
int sharedMemPerBlock()
{
int device;
cudaGetDevice(&device); //get the id of the current device
cudaDeviceProp props; //device property structure
cudaGetDeviceProperties(&props, device);
return props.sharedMemPerBlock;
}
} //end namespace rts
#endif