Skip to content
Snippets Groups Projects
Commit 5a76f4ad authored by Moises Fernandez's avatar Moises Fernandez
Browse files

A function to synchronize and check errors after run each kernel

parent e0545689
No related branches found
No related tags found
No related merge requests found
#include <fstream>
#define safecall(call) do{\
cudaError_t err=call;\
if (cudaSuccess != err){\
printf("cuda error at %s:%d. %s\n",__FILE__,__LINE__,cudaGetErrorString(err));\
}\
}while(0)
#define sync_check(message) do{;\
safecall(cudaDeviceSynchronize());\
cudaError_t error = cudaGetLastError();\
if (cudaSuccess != error){\
printf("ERROR: %s: %s\n",message,cudaGetErrorString(error));\
exit(-1);\
}\
}while(0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment