Index: openmp/libomptarget/plugins/cuda/src/rtl.cpp =================================================================== --- openmp/libomptarget/plugins/cuda/src/rtl.cpp +++ openmp/libomptarget/plugins/cuda/src/rtl.cpp @@ -31,8 +31,11 @@ do { \ if (getDebugLevel() > 0) { \ const char *errStr; \ - cuGetErrorString(err, &errStr); \ - DP("CUDA error is: %s\n", errStr); \ + CUresult errStr_status = cuGetErrorString(err, &errStr); \ + if (errStr_status != CUDA_SUCCESS) \ + DP("unrecognized CUDA error code: %d\n", err); \ + else \ + DP("CUDA error is: %s\n", errStr); \ } \ } while (false) #else // OMPTARGET_DEBUG