Created
April 15, 2013 20:18
-
-
Save jefflarkin/5390993 to your computer and use it in GitHub Desktop.
A simple macro for checking errors after CUDA library calls.
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
//Macro for checking cuda errors following a cuda launch or api call | |
#define cudaCheckError() { \ | |
cudaError_t e=cudaGetLastError(); \ | |
if(e!=cudaSuccess) { \ | |
printf("Cuda failure %s:%d: '%s'\n",__FILE__,__LINE__,cudaGetErrorString(e)); \ | |
exit(0); \ | |
} \ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment