C   122
check CUDA Error
Guest on 14th March 2023 12:10:41 AM


  1. void checkCUDAError(const char *msg)
  2. {
  3.         cudaError_t err = cudaGetLastError();
  4.         if (cudaSuccess != err) {
  5.                 fprintf(stderr, "Cuda error: %s: %s.\n", msg,
  6.                         cudaGetErrorString(err));
  7.                 exit(-1);
  8.         }

Raw Paste

Login or Register to edit or fork this paste. It's free.