devices.h 578 Bytes
#ifndef RTS_CUDA_DEVICES
#define RTS_CUDA_DEVICES

#include <cuda.h>

namespace stim{

int maxThreadsPerBlock()
{
	int device;
	cudaGetDevice(&device);		//get the id of the current device
	cudaDeviceProp props;		//device property structure
	cudaGetDeviceProperties(&props, device);
	return props.maxThreadsPerBlock;
}

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