Beispiel #1
0
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);
   }
}
Beispiel #2
0
 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;
 }