Skip to content

Instantly share code, notes, and snippets.

@moznion
Created September 10, 2014 10:05
Show Gist options
  • Save moznion/de698af116d08aa2e7a0 to your computer and use it in GitHub Desktop.
Save moznion/de698af116d08aa2e7a0 to your computer and use it in GitHub Desktop.
#define CUDA_SAFE_CALL(func) \
do { \
cudaError_t err = (func); \
if (err != cudaSuccess) { \
fprintf(stderr, "[Error] %s (error code: %d) at %s line %d\n", cudaGetErrorString(err), err, __FILE__, __LINE__); \
exit(err); \
} \
} while(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment