Created
July 24, 2012 09:50
-
-
Save ugovaretto/3169151 to your computer and use it in GitHub Desktop.
Check cuda error
This file contains 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
#define CHECK_ERROR( err ) \ | |
if( err != cudaSuccess ) { \ | |
std::cerr << "ERROR: " << cudaGetErrorString( err ) << std::endl; \ | |
exit( -1 ); \ | |
} | |
#define CHECK_LAST_ERROR \ | |
{ cudaError_t err = cudaGetLastError(); \ | |
if( err != cudaSuccess ) { \ | |
std::cerr << cudaGetErrorString( err ) << std::endl; \ | |
exit( -1 ); \ | |
} \ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment