void _cudaAssert(int code, const char* file, int line) { if (cudaError_t(code) != cudaError::cudaSuccess) { std::cerr << "GPUassert:" << cudaGetErrorString(cudaError_t(code)) << " file=" << file << " line=" << line << std::endl; exit(code); } }
string CudaException::getDescription() const { const char *s = cudaGetErrorString(cudaError_t(_cudaError)); if (s == 0) { ostringstream serr; serr << "Unknown CUDA error " << _cudaError; return serr.str(); } return s; }