Created
April 21, 2017 12:24
-
-
Save ptheywood/057c26f3c5bfe22e55881fb37c006a8c to your computer and use it in GitHub Desktop.
FLAME GPU Device output. Place in an init function for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment