From 615f95aa2961bd9da7833a144fb8862c60d0c25b Mon Sep 17 00:00:00 2001 From: Rahul Manocha Date: Mon, 6 May 2024 16:19:16 -0700 Subject: [PATCH] [SWDEV-445928] - Fix for hipDrvGetError tests Change-Id: I19ba2084fddad7b073edc0b4e9c1b16cf7a97319 --- catch/hipTestMain/config/config_amd_linux | 2 -- catch/hipTestMain/config/config_amd_windows | 2 -- .../config/config_nvidia_linux.json | 1 - .../errorHandling/error_handling_common.cc | 18 +++++++++--------- .../errorHandling/error_handling_common.hh | 1 + 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/catch/hipTestMain/config/config_amd_linux b/catch/hipTestMain/config/config_amd_linux index 542afedcd5..161689408e 100644 --- a/catch/hipTestMain/config/config_amd_linux +++ b/catch/hipTestMain/config/config_amd_linux @@ -240,8 +240,6 @@ "Unit_hipDrvGraphAddMemsetNode_hipMalloc3D_1D", "Unit_hipDrvGraphAddMemsetNode_hipMalloc_1D", "Unit_hipDrvGraphAddMemsetNode_hipMallocManaged", - "Unit_hipDrvGetErrorName_Positive_Basic", - "Unit_hipDrvGetErrorString_Positive_Basic", "Unit_hipModuleLaunchKernel_Negative_Parameters", "Unit_hipModuleGetTexRef_Positive_Basic", "Unit_hipModuleLaunchCooperativeKernel_Negative_Parameters", diff --git a/catch/hipTestMain/config/config_amd_windows b/catch/hipTestMain/config/config_amd_windows index 0220ce3a5d..09d786983f 100644 --- a/catch/hipTestMain/config/config_amd_windows +++ b/catch/hipTestMain/config/config_amd_windows @@ -619,8 +619,6 @@ "Unit_tex2DLayeredLod_Positive_ReadModeNormalizedFloat - unsigned char", "Unit_tex2DLayeredLod_Positive_ReadModeNormalizedFloat - short", "Unit_tex2DLayeredLod_Positive_ReadModeNormalizedFloat - unsigned short", - "Unit_hipDrvGetErrorName_Positive_Basic", - "Unit_hipDrvGetErrorString_Positive_Basic", "Unit_hipModuleLaunchKernel_Negative_Parameters", "Unit_hipModuleGetTexRef_Positive_Basic", "Unit_hipExtModuleLaunchKernel_Negative_Parameters", diff --git a/catch/hipTestMain/config/config_nvidia_linux.json b/catch/hipTestMain/config/config_nvidia_linux.json index c1f1ba1863..5ecc1ddef5 100644 --- a/catch/hipTestMain/config/config_nvidia_linux.json +++ b/catch/hipTestMain/config/config_nvidia_linux.json @@ -227,7 +227,6 @@ "Unit_tex2DLayeredLod_Positive_ReadModeNormalizedFloat - unsigned char", "Unit_tex2DLayeredLod_Positive_ReadModeNormalizedFloat - short", "Unit_tex2DLayeredLod_Positive_ReadModeNormalizedFloat - unsigned short", - "Unit_hipDrvGetErrorString_Positive_Basic", "Unit_hipLaunchKernel_Negative_Parameters", "Unit_Assert_Positive_Basic_KernelFail", "=== Below tests fail in external CI for PR https://github.com/ROCm-Developer-Tools/hip-tests/pull/210 ===", diff --git a/catch/unit/errorHandling/error_handling_common.cc b/catch/unit/errorHandling/error_handling_common.cc index 20267e793d..a2e4cdd9e4 100644 --- a/catch/unit/errorHandling/error_handling_common.cc +++ b/catch/unit/errorHandling/error_handling_common.cc @@ -352,56 +352,56 @@ const char* ErrorString(hipError_t enumerator) { return "profiler already started"; case hipErrorProfilerAlreadyStopped: return "profiler already stopped"; -#if HT_AMD case hipErrorInvalidConfiguration: +#if HT_AMD return "invalid configuration argument"; #elif HT_NVIDIA return "unknown error"; #endif -#if HT_AMD case hipErrorInvalidPitchValue: +#if HT_AMD return "invalid pitch argument"; #elif HT_NVIDIA return "unknown error"; #endif -#if HT_AMD case hipErrorInvalidSymbol: +#if HT_AMD return "invalid device symbol"; #elif HT_NVIDIA return "unknown error"; #endif -#if HT_AMD case hipErrorInvalidDevicePointer: +#if HT_AMD return "invalid device pointer"; #elif HT_NVIDIA return "unknown error"; #endif -#if HT_AMD case hipErrorInvalidMemcpyDirection: +#if HT_AMD return "invalid copy direction for memcpy"; #elif HT_NVIDIA return "unknown error"; #endif -#if HT_AMD case hipErrorInsufficientDriver: +#if HT_AMD return "driver version is insufficient for runtime version"; #elif HT_NVIDIA return "unknown error"; #endif -#if HT_AMD case hipErrorMissingConfiguration: +#if HT_AMD return "__global__ function call is not configured"; #elif HT_NVIDIA return "unknown error"; #endif -#if HT_AMD case hipErrorPriorLaunchFailure: +#if HT_AMD return "unspecified launch failure in prior launch"; #elif HT_NVIDIA return "unknown error"; #endif -#if HT_AMD case hipErrorInvalidDeviceFunction: +#if HT_AMD return "invalid device function"; #elif HT_NVIDIA return "unknown error"; diff --git a/catch/unit/errorHandling/error_handling_common.hh b/catch/unit/errorHandling/error_handling_common.hh index 902735a1ed..b58c1620bc 100644 --- a/catch/unit/errorHandling/error_handling_common.hh +++ b/catch/unit/errorHandling/error_handling_common.hh @@ -23,6 +23,7 @@ THE SOFTWARE. #pragma once #include +#include constexpr hipError_t kErrorEnumerators[] = {hipSuccess, hipErrorInvalidValue,