SWDEV-369042 - updating to GetError to match cuda

Change-Id: I0ec2330443b26cb1c8cedba942f31fb1267cd09d
Tento commit je obsažen v:
pghafari
2022-12-11 22:28:36 -05:00
odevzdal Payam Ghafari
rodič 537df06c4f
revize 335a24d1a0
2 změnil soubory, kde provedl 14 přidání a 4 odebrání
+12 -2
Zobrazit soubor
@@ -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) {
+2 -2
Zobrazit soubor
@@ -357,7 +357,7 @@ hipError_t hipDrvGetErrorName(hipError_t hip_error, const char** errStr)
return hipErrorInvalidValue;
}
*errStr = ihipGetErrorName(hip_error);
if (strcmp( *errStr, "hipErrorUnknown") != 0) {
if (hip_error == hipErrorUnknown || strcmp( *errStr, "hipErrorUnknown") != 0) {
return hipSuccess;
} else {
return hipErrorInvalidValue;
@@ -370,7 +370,7 @@ hipError_t hipDrvGetErrorString(hipError_t hip_error, const char** errStr)
return hipErrorInvalidValue;
}
*errStr = ihipGetErrorString(hip_error);
if (strcmp( *errStr, "unknown error") != 0) {
if (hip_error == hipErrorUnknown || strcmp( *errStr, "unknown error") != 0) {
return hipSuccess;
} else {
return hipErrorInvalidValue;