MCPcopy Create free account
hub / github.com/RenderKit/oidn / cudaGetErrorString

Function cudaGetErrorString

devices/cuda/curtn.cpp:561–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559 }
560
561 const char* CUDARTAPI cudaGetErrorString(cudaError_t error)
562 {
563 static const char* unrecognizedStr = "unrecognized error code";
564
565 // Convert cudaError_t to CUresult if there is an equivalent
566 CUresult result;
567
568 switch (error)
569 {
570 #define CURTN_DEFINE_ERROR(res, err) case err: result = res; break;
571 CURTN_DEFINE_ERRORS
572 #undef CURTN_DEFINE_ERROR
573
574 case cudaErrorInvalidMemcpyDirection: return "invalid copy direction for memcpy";
575 default: return unrecognizedStr;
576 }
577
578 // Get the error string for the CUresult
579 const char* str;
580 if (cuGetErrorString(result, &str) == CUDA_SUCCESS)
581 return str;
582 else
583 return unrecognizedStr; // shouldn't happen
584 }
585
586 cudaError_t CUDARTAPI cudaGetDeviceCount(int* count)
587 {

Callers 1

checkErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected