From bb291a85fd088ec9745ebace2e3a2ca9ce33cb26 Mon Sep 17 00:00:00 2001 From: pghafari Date: Sun, 11 Dec 2022 22:28:36 -0500 Subject: [PATCH] SWDEV-369042 - updating to GetError to match cuda Change-Id: I0ec2330443b26cb1c8cedba942f31fb1267cd09d [ROCm/hipother commit: c1fe38aff6216b63ca2db646f527f8560f506c6c] --- .../hip/nvidia_detail/nvidia_hip_runtime_api.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/projects/hipother/hipnv/include/hip/nvidia_detail/nvidia_hip_runtime_api.h b/projects/hipother/hipnv/include/hip/nvidia_detail/nvidia_hip_runtime_api.h index dd7e52a19d..712d793c51 100644 --- a/projects/hipother/hipnv/include/hip/nvidia_detail/nvidia_hip_runtime_api.h +++ b/projects/hipother/hipnv/include/hip/nvidia_detail/nvidia_hip_runtime_api.h @@ -1833,11 +1833,21 @@ inline static const char* hipGetErrorName(hipError_t error) { } inline static hipError_t hipDrvGetErrorString(hipError_t error, const char** errorString) { - return hipCUResultTohipError(cuGetErrorString(hipErrorToCUResult(error), errorString)); + CUresult err = hipErrorToCUResult(error); + if( err == CUDA_ERROR_UNKNOWN ) { + return hipCUResultTohipError(cuGetErrorString((CUresult)error, errorString)); + } else { + return hipCUResultTohipError(cuGetErrorString(err, errorString)); + } } inline static hipError_t hipDrvGetErrorName(hipError_t error, const char** errorString) { - return hipCUResultTohipError(cuGetErrorName(hipErrorToCUResult(error), errorString)); + CUresult err = hipErrorToCUResult(error); + if( err == CUDA_ERROR_UNKNOWN ) { + return hipCUResultTohipError(cuGetErrorName((CUresult)error, errorString)); + } else { + return hipCUResultTohipError(cuGetErrorName(err, errorString)); + } } inline static hipError_t hipGetDeviceCount(int* count) {