Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void outputDeviceInfo(){
- cudaError_t err;
- int deviceId;
- err = cudaGetDevice(&deviceId);
- if (err == cudaSuccess){
- struct cudaDeviceProp prop;
- err = cudaGetDeviceProperties(&prop, deviceId);
- if (err == cudaSuccess){
- printf("Device %i: %s, sm %i.%i\n", deviceId, prop.name, prop.major, prop.minor);
- }
- else
- {
- printf("Err: Device properties could not be loaded (%s)\n", cudaGetErrorString(err));
- }
- }
- else
- {
- printf("Err: Cuda Device ID could not be loaded (%s)\n", cudaGetErrorString(err));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement