diff --git a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_MI2xx.json b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_MI2xx.json index 74b6c2bf4a..20da9c8d66 100644 --- a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_MI2xx.json +++ b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_MI2xx.json @@ -19,15 +19,17 @@ "Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters", "Unit_Grid_Group_Sync_Positive_Basic", "=== Below hiprtc tests are disabled temporarily, will be renabled once patches for SWDEV-395996 are merged ===", - "Unit_hiprtc_saxpy.Unit_hiprtc_saxpy", - "Unit_hiprtc_warpsize.Unit_hiprtc_warpsize", - "Unit_hiprtc_functional.Unit_hiprtc_functional", - "Unit_hipStreamCaptureRtc.Unit_hipStreamCaptureRtc", - "Unit_hiprtc_cpp17.Unit_hiprtc_cpp17", - "Unit_hiprtc_namehandling.Unit_hiprtc_namehandling", - "Unit_hiprtc_getloweredname.Unit_hiprtc_getloweredname", - "Unit_hiprtc_test_hip_bfloat16.Unit_hiprtc_test_hip_bfloat16", - "Unit_RTC_LinkerAPI.Unit_RTC_LinkerAPI" + "Unit_hiprtc_saxpy", + "Unit_hiprtc_warpsize", + "Unit_hiprtc_functional", + "Unit_hipStreamCaptureRtc", + "Unit_hiprtc_cpp17", + "Unit_hiprtc_namehandling", + "Unit_hiprtc_getloweredname", + "Unit_hiprtc_test_hip_bfloat16", + "Unit_RTC_LinkerAPI", + "Unit_hiprtc_half_shuffle", + "Unit_hiprtc_includepath" ] } diff --git a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_common.json b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_common.json index e7861dd7a5..7068f83d1e 100644 --- a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_common.json +++ b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_common.json @@ -120,14 +120,16 @@ "Unit_hipStreamCreateWithPriority_ValidateWithEvents", "Unit_hipEventIpc", "=== Below hiprtc tests are disabled temporarily, will be renabled once patches for SWDEV-395996 are merged ===", - "Unit_hiprtc_saxpy.Unit_hiprtc_saxpy", - "Unit_hiprtc_warpsize.Unit_hiprtc_warpsize", - "Unit_hiprtc_functional.Unit_hiprtc_functional", - "Unit_hipStreamCaptureRtc.Unit_hipStreamCaptureRtc", - "Unit_hiprtc_cpp17.Unit_hiprtc_cpp17", - "Unit_hiprtc_namehandling.Unit_hiprtc_namehandling", - "Unit_hiprtc_getloweredname.Unit_hiprtc_getloweredname", - "Unit_hiprtc_test_hip_bfloat16.Unit_hiprtc_test_hip_bfloat16", - "Unit_RTC_LinkerAPI.Unit_RTC_LinkerAPI" + "Unit_hiprtc_saxpy", + "Unit_hiprtc_warpsize", + "Unit_hiprtc_functional", + "Unit_hipStreamCaptureRtc", + "Unit_hiprtc_cpp17", + "Unit_hiprtc_namehandling", + "Unit_hiprtc_getloweredname", + "Unit_hiprtc_test_hip_bfloat16", + "Unit_RTC_LinkerAPI", + "Unit_hiprtc_half_shuffle", + "Unit_hiprtc_includepath" ] } diff --git a/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_MI2xx.json b/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_MI2xx.json index 27ab1dd12b..8bb1400846 100644 --- a/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_MI2xx.json +++ b/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_MI2xx.json @@ -107,14 +107,16 @@ "Unit_hipStreamCreateWithPriority_MulthreadNonblockingflag", "Unit_hipDeviceGetUuid_Positive", "=== Below hiprtc tests are disabled temporarily, will be renabled once patches for SWDEV-395996 are merged ===", - "Unit_hiprtc_saxpy.Unit_hiprtc_saxpy", - "Unit_hiprtc_warpsize.Unit_hiprtc_warpsize", - "Unit_hiprtc_functional.Unit_hiprtc_functional", - "Unit_hipStreamCaptureRtc.Unit_hipStreamCaptureRtc", - "Unit_hiprtc_cpp17.Unit_hiprtc_cpp17", - "Unit_hiprtc_namehandling.Unit_hiprtc_namehandling", - "Unit_hiprtc_getloweredname.Unit_hiprtc_getloweredname", - "Unit_hiprtc_test_hip_bfloat16.Unit_hiprtc_test_hip_bfloat16", - "Unit_RTC_LinkerAPI.Unit_RTC_LinkerAPI" + "Unit_hiprtc_saxpy", + "Unit_hiprtc_warpsize", + "Unit_hiprtc_functional", + "Unit_hipStreamCaptureRtc", + "Unit_hiprtc_cpp17", + "Unit_hiprtc_namehandling", + "Unit_hiprtc_getloweredname", + "Unit_hiprtc_test_hip_bfloat16", + "Unit_RTC_LinkerAPI", + "Unit_hiprtc_half_shuffle", + "Unit_hiprtc_includepath" ] } diff --git a/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_common.json b/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_common.json index 398630a2fa..be73937091 100644 --- a/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_common.json +++ b/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_common.json @@ -226,14 +226,16 @@ "Unit_hipTextureMipmapRef2D_Positive_Check", "Unit_hipTextureMipmapRef2D_Negative_Parameters", "=== Below hiprtc tests are disabled temporarily, will be renabled once patches for SWDEV-395996 are merged ===", - "Unit_hiprtc_saxpy.Unit_hiprtc_saxpy", - "Unit_hiprtc_warpsize.Unit_hiprtc_warpsize", - "Unit_hiprtc_functional.Unit_hiprtc_functional", - "Unit_hipStreamCaptureRtc.Unit_hipStreamCaptureRtc", - "Unit_hiprtc_cpp17.Unit_hiprtc_cpp17", - "Unit_hiprtc_namehandling.Unit_hiprtc_namehandling", - "Unit_hiprtc_getloweredname.Unit_hiprtc_getloweredname", - "Unit_hiprtc_test_hip_bfloat16.Unit_hiprtc_test_hip_bfloat16", - "Unit_RTC_LinkerAPI.Unit_RTC_LinkerAPI" + "Unit_hiprtc_saxpy", + "Unit_hiprtc_warpsize", + "Unit_hiprtc_functional", + "Unit_hipStreamCaptureRtc", + "Unit_hiprtc_cpp17", + "Unit_hiprtc_namehandling", + "Unit_hiprtc_getloweredname", + "Unit_hiprtc_test_hip_bfloat16", + "Unit_RTC_LinkerAPI", + "Unit_hiprtc_half_shuffle", + "Unit_hiprtc_includepath" ] } diff --git a/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceDouble.cc b/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceDouble.cc index 865d54e9bd..40af03df98 100644 --- a/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceDouble.cc +++ b/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceDouble.cc @@ -181,7 +181,6 @@ bool run_llrint() { int passed = 0; for (int i = 0; i < 512; i++) { int x = round(A[i]); - int64_t y = x; if (B[i] == x) { passed = 1; } diff --git a/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceLimit.cc b/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceLimit.cc index d085efde34..92bf7a72e4 100644 --- a/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceLimit.cc +++ b/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceLimit.cc @@ -20,5 +20,5 @@ THE SOFTWARE. TEST_CASE("Unit_hipTestDeviceLimit_Basic") { size_t heap; HIP_CHECK(hipDeviceGetLimit(&heap, hipLimitMallocHeapSize)); - REQUIRE(heap != NULL); + REQUIRE(heap != 0); } diff --git a/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceSymbol.cc b/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceSymbol.cc index 3a2a103906..795309045c 100644 --- a/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceSymbol.cc +++ b/projects/hip-tests/catch/unit/deviceLib/hipTestDeviceSymbol.cc @@ -180,7 +180,6 @@ TEST_CASE("Unit_hipGetSymbolAddressAndSize_Validation") { bool* checkOkD{nullptr}; bool checkOk = false; size_t symbolSize{}; - int* symbolArrAddress{}; float* symbolVarAddress{}; SECTION("Validate symbol size/address of static const variable") { diff --git a/projects/hip-tests/catch/unit/deviceLib/hipTestDotFunctions.cc b/projects/hip-tests/catch/unit/deviceLib/hipTestDotFunctions.cc index 43f0492da5..4161a342b7 100644 --- a/projects/hip-tests/catch/unit/deviceLib/hipTestDotFunctions.cc +++ b/projects/hip-tests/catch/unit/deviceLib/hipTestDotFunctions.cc @@ -45,10 +45,10 @@ __global__ static void DotFunctions(bool* result) { TEST_CASE("Unit_hipTestDotFunctions") { bool* result{nullptr}; - hipHostMalloc(&result, 1); + HIP_CHECK(hipHostMalloc(&result, 1)); result[0] = true; hipLaunchKernelGGL(DotFunctions, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, result); - hipDeviceSynchronize(); + HIP_CHECK(hipDeviceSynchronize()); REQUIRE(result[0] == true); - hipHostFree(result); + HIP_CHECK(hipHostFree(result)); } diff --git a/projects/hip-tests/catch/unit/deviceLib/hipTestHalf.cc b/projects/hip-tests/catch/unit/deviceLib/hipTestHalf.cc index 936625ef56..e3bb216714 100644 --- a/projects/hip-tests/catch/unit/deviceLib/hipTestHalf.cc +++ b/projects/hip-tests/catch/unit/deviceLib/hipTestHalf.cc @@ -19,6 +19,9 @@ THE SOFTWARE. #include #include +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wunused-parameter" + __device__ void test_convert() { __half x; float y = static_cast(x); diff --git a/projects/hip-tests/catch/unit/deviceLib/hipTestHost.cc b/projects/hip-tests/catch/unit/deviceLib/hipTestHost.cc index e1e77ff9e3..24c2025f2c 100644 --- a/projects/hip-tests/catch/unit/deviceLib/hipTestHost.cc +++ b/projects/hip-tests/catch/unit/deviceLib/hipTestHost.cc @@ -147,9 +147,6 @@ __device__ bool check_modf() { __device__ bool check_nextafterf() { uint32_t len = 4; float Val[] = {0, -0.5, 0.9, -0.2}; - float iPtr[] = {0, 0, 0, 0}; - float frac[] = {0, -0.5, 0.9, -0.2}; - float Out[] = {1, 1, 1, 1}; for (int i = 0; i < len; i++) { if (nextafterf(Val[i], 1) - Val[i] > 0.0001) { return false; @@ -161,9 +158,6 @@ __device__ bool check_nextafterf() { __device__ bool check_nextafter() { uint32_t len = 4; double Val[] = {0, -0.5, 0.9, -0.2}; - double iPtr[] = {0, 0, 0, 0}; - double frac[] = {0, -0.5, 0.9, -0.2}; - double Out[] = {1, 1, 1, 1}; for (int i = 0; i < len; i++) { if (nextafter(Val[i], 1) - Val[i] > 0.0001) { return false; diff --git a/projects/hip-tests/catch/unit/deviceLib/hipTestNativeHalf.cc b/projects/hip-tests/catch/unit/deviceLib/hipTestNativeHalf.cc index 521b09bca0..44b6d729b6 100644 --- a/projects/hip-tests/catch/unit/deviceLib/hipTestNativeHalf.cc +++ b/projects/hip-tests/catch/unit/deviceLib/hipTestNativeHalf.cc @@ -144,8 +144,6 @@ void __half2Test(bool* result, __half2 a) { // Dot Functions result[0] &= amd_mixed_dot(a, a, 1, 1) && result[0]; - half X = a.x; - half Y = a.y; } TEST_CASE("Unit_hipTestNativeHalf") { diff --git a/projects/hip-tests/catch/unit/graph/hipGraphAddNodeBeginCapture.cc b/projects/hip-tests/catch/unit/graph/hipGraphAddNodeBeginCapture.cc index 80bf52371a..59138742f8 100644 --- a/projects/hip-tests/catch/unit/graph/hipGraphAddNodeBeginCapture.cc +++ b/projects/hip-tests/catch/unit/graph/hipGraphAddNodeBeginCapture.cc @@ -21,6 +21,7 @@ THE SOFTWARE. #include #include +#pragma clang diagnostic ignored "-Wunused-parameter" #define SIZE (1024 * 1024) static size_t Nbytes = SIZE * sizeof(int); diff --git a/projects/hip-tests/catch/unit/kernel/hipDynamicShared.cc b/projects/hip-tests/catch/unit/kernel/hipDynamicShared.cc index 168d979d14..c8593b0939 100644 --- a/projects/hip-tests/catch/unit/kernel/hipDynamicShared.cc +++ b/projects/hip-tests/catch/unit/kernel/hipDynamicShared.cc @@ -21,6 +21,9 @@ THE SOFTWARE. #include #include #include + +#pragma clang diagnostic ignored "-Wunused-parameter" + unsigned threadsPerBlock = 256; template diff --git a/projects/hip-tests/catch/unit/kernel/hipEmptyKernel.cc b/projects/hip-tests/catch/unit/kernel/hipEmptyKernel.cc index 484a77e0a6..9262397416 100644 --- a/projects/hip-tests/catch/unit/kernel/hipEmptyKernel.cc +++ b/projects/hip-tests/catch/unit/kernel/hipEmptyKernel.cc @@ -22,6 +22,8 @@ THE SOFTWARE. #include #include +#pragma clang diagnostic ignored "-Wunused-parameter" + __global__ void Empty(int param) {} /** diff --git a/projects/hip-tests/catch/unit/kernel/hipLanguageExtensions.cc b/projects/hip-tests/catch/unit/kernel/hipLanguageExtensions.cc index 5e601d35cf..446c91a213 100644 --- a/projects/hip-tests/catch/unit/kernel/hipLanguageExtensions.cc +++ b/projects/hip-tests/catch/unit/kernel/hipLanguageExtensions.cc @@ -23,6 +23,9 @@ THE SOFTWARE. #include #include +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wuninitialized" + // Simple tests for variable type qualifiers: __device__ int deviceVar; @@ -62,7 +65,6 @@ __global__ void vectorADD(T __restrict__* A_d, T* B_d, T* C_d, size_t N) { int a = __shfl_up(x, 1); #endif float x = 1.0; - float z = sin(x); #ifdef NOT_YET float fastZ = __sin(x); #endif diff --git a/projects/hip-tests/catch/unit/kernel/hipLaunchParm.cc b/projects/hip-tests/catch/unit/kernel/hipLaunchParm.cc index f033829f6e..9ae028cac7 100644 --- a/projects/hip-tests/catch/unit/kernel/hipLaunchParm.cc +++ b/projects/hip-tests/catch/unit/kernel/hipLaunchParm.cc @@ -23,6 +23,11 @@ THE SOFTWARE. #include #include +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-result" +#pragma clang diagnostic ignored "-Wuninitialized" + // Memory alignment is broken // Update: with latest changes the aligment is working fine, hence enabled #define ENABLE_ALIGNMENT_TEST_SMALL_BAR 1 diff --git a/projects/hip-tests/catch/unit/rtc/CMakeLists.txt b/projects/hip-tests/catch/unit/rtc/CMakeLists.txt index 9937df6c56..2653d15237 100644 --- a/projects/hip-tests/catch/unit/rtc/CMakeLists.txt +++ b/projects/hip-tests/catch/unit/rtc/CMakeLists.txt @@ -26,8 +26,7 @@ add_custom_target(copyRtcHeaders ALL if(UNIX) set(AMD_TEST_SRC ${TEST_SRC} RtcFunctions.cpp - RtcUtility.cpp - hiprtcComplrOptnTesting.cc) + RtcUtility.cpp) endif() if(HIP_PLATFORM MATCHES "nvidia") diff --git a/projects/hip-tests/catch/unit/rtc/RtcFunctions.cpp b/projects/hip-tests/catch/unit/rtc/RtcFunctions.cpp index e73e195c07..1d37356540 100644 --- a/projects/hip-tests/catch/unit/rtc/RtcFunctions.cpp +++ b/projects/hip-tests/catch/unit/rtc/RtcFunctions.cpp @@ -36,6 +36,9 @@ validation. For PASS senario the function returns 1 or 0 otherwise. #include #include "headers/printf_common.h" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-variable" + bool check_architecture(const char** Combination_CO, int Combination_CO_size, int max_thread_pos, int fast_math_present) { @@ -305,7 +308,6 @@ bool check_denormals_enabled(const char** Combination_CO, for (auto& indx : double_vec_expected) { Expected_Results_int.push_back(static_cast(indx)); } - int pass_count = 0; int test_case, res_inc; for (test_case = 0, res_inc = 0; test_case < Input_Vals_int.size() && res_inc < Expected_Results_int.size(); test_case+=2, res_inc++) { @@ -378,8 +380,8 @@ bool check_denormals_enabled(const char** Combination_CO, hipFunction_t function; HIP_CHECK(hipModuleLoadData(&module, codec.data())); HIP_CHECK(hipModuleGetFunction(&function, module, kername)); - hipError_t status = hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, - nullptr, kernel_parameter); + HIP_CHECK(hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, + nullptr, kernel_parameter)); HIP_CHECK(hipMemcpy(result_h, result_d, sizeof(double), hipMemcpyDeviceToHost)); HIP_CHECK(hipDeviceSynchronize()); @@ -427,7 +429,6 @@ bool check_denormals_disabled(const char** Combination_CO, "Expected_Results_for_no", block_name); const char* kername = kernel_name.c_str(); const char* compiler_option = retrieved_CO.c_str(); - int CO_size = 1; std::vector double_vec_input; for (auto& indx : Input_Vals) { double_vec_input.push_back(indx.get()); @@ -444,7 +445,6 @@ bool check_denormals_disabled(const char** Combination_CO, for (auto& indx : double_vec_expected_for_no) { Expected_Results_for_no_int.push_back(static_cast(indx)); } - int pass_count = 0; int test_case, res_inc; for (test_case = 0, res_inc = 0; test_case < Input_Vals_int.size() && res_inc < Expected_Results_for_no_int.size(); test_case+=2, res_inc++) { @@ -517,8 +517,8 @@ bool check_denormals_disabled(const char** Combination_CO, hipFunction_t function; HIP_CHECK(hipModuleLoadData(&module, codec.data())); HIP_CHECK(hipModuleGetFunction(&function, module, kername)); - hipError_t status = hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, - nullptr, kernel_parameter); + HIP_CHECK(hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, + nullptr, kernel_parameter)); HIP_CHECK(hipMemcpy(result_h, result_d, sizeof(double), hipMemcpyDeviceToHost)); HIP_CHECK(hipDeviceSynchronize()); @@ -566,7 +566,7 @@ bool check_ffp_contract_off(const char** Combination_CO, for (auto& indx : retrieved_CO) { CO_vec.push_back(indx.get()); } - int CO_IRadded_size = 3, a = 0; + int CO_IRadded_size = 3; const char** CO_IRadded = new const char*[3]; std::string hold = CO_vec[0]; CO_IRadded[0] = hold.c_str(); @@ -626,7 +626,7 @@ bool check_ffp_contract_on(const char** Combination_CO, for (auto& indx : retrieved_CO) { CO_vec.push_back(indx.get()); } - int CO_IRadded_size = 3, a = 0; + int CO_IRadded_size = 3; const char** CO_IRadded = new const char*[3]; std::string hold = CO_vec[1]; CO_IRadded[0] = hold.c_str(); @@ -700,7 +700,7 @@ bool check_ffp_contract_fast(const char** Combination_CO, for (auto& indx : retrieved_CO) { CO_vec.push_back(indx.get()); } - int CO_IRadded_size = 3, a = 0; + int CO_IRadded_size = 3; const char** CO_IRadded = new const char*[3]; std::string hold = CO_vec[2]; CO_IRadded[0] = hold.c_str(); @@ -769,7 +769,7 @@ bool check_fast_math_enabled(const char** Combination_CO, } return 0; } - int CO_IRadded_size = 3, a = 0; + int CO_IRadded_size = 3; const char** CO_IRadded = new const char*[3]; CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; @@ -821,7 +821,7 @@ bool check_fast_math_disabled(const char** Combination_CO, } return 0; } - int CO_IRadded_size = 3, a = 0; + int CO_IRadded_size = 3; const char** CO_IRadded = new const char*[3]; CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; @@ -873,13 +873,13 @@ bool check_slp_vectorize_enabled(const char** Combination_CO, } std::string kernel_name = get_string_parameters("kernel_name", block_name); const char* kername = kernel_name.c_str(); - int CO_IRadded_size = 3, a = 0; + int CO_IRadded_size = 3; const char** CO_IRadded = new const char*[3]; CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; __half2 *a_d, *x_d, *y_d; - __half2 a_h, x_h, *y_h; + __half2 a_h, x_h; a_h.data.x = 1.5; x_h.data.y = 3.0; CaptureStream capture(stderr); @@ -1035,13 +1035,13 @@ bool check_slp_vectorize_disabled(const char** Combination_CO, } std::string kernel_name = get_string_parameters("kernel_name", block_name); const char* kername = kernel_name.c_str(); - int CO_IRadded_size = 3, a = 0; + int CO_IRadded_size = 3; const char** CO_IRadded = new const char*[3]; CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; __half2 *a_d, *x_d, *y_d; - __half2 a_h, x_h, *y_h; + __half2 a_h, x_h; a_h.data.x = 1.5; x_h.data.y = 3.0; CaptureStream capture(stderr); @@ -1451,7 +1451,6 @@ bool check_header_dir(const char** Combination_CO, var_hdr_lst[i] = Headers_list[i]; hder_lst[i] = var_hdr_lst[i].c_str(); } - int pass_count = 0; for (int senario = 0; senario< Input_Thrd_Vals_int.size(); senario++) { hiprtcProgram prog; HIPRTC_CHECK(hiprtcCreateProgram(&prog, header_dir_string, diff --git a/projects/hip-tests/catch/unit/rtc/RtcUtility.cpp b/projects/hip-tests/catch/unit/rtc/RtcUtility.cpp index 2463a73fd1..e0093ffcaf 100644 --- a/projects/hip-tests/catch/unit/rtc/RtcUtility.cpp +++ b/projects/hip-tests/catch/unit/rtc/RtcUtility.cpp @@ -61,6 +61,8 @@ parameters of the respective block name. #include #include "headers/printf_common.h" +#pragma clang diagnostic ignored "-Wunused-but-set-variable" + std::vector get_combi_string_vec() { picojson::array combi_string = get_array_parameters("Combi_CO", "all_compier_options"); @@ -91,7 +93,6 @@ int split_comb_string(std::string option) { int calling_combination_function(std::vector combi_vec_list) { int combi_size = combi_vec_list.size(); int fast_math_present = -1, undef_present = 0; - int a = 0; int max_thread_position; std::string hold_CO[combi_size]; const char** Combination_CO = new const char*[combi_size]; diff --git a/projects/hip-tests/catch/unit/rtc/headers/printf_common.h b/projects/hip-tests/catch/unit/rtc/headers/printf_common.h index bd17d24f33..b42110bab8 100644 --- a/projects/hip-tests/catch/unit/rtc/headers/printf_common.h +++ b/projects/hip-tests/catch/unit/rtc/headers/printf_common.h @@ -34,6 +34,8 @@ THE SOFTWARE. #include #endif +#pragma clang diagnostic ignored "-Wunused-but-set-variable" + #if defined(_WIN32) class CaptureStream { private: @@ -153,7 +155,8 @@ struct CaptureStream { // Truncate the file up to size if we don't want too long log void Truncate(size_t size) { - struct stat sb = { 0 }; + struct stat sb; + memset(&sb, 0, sizeof(sb)); if (::stat(tempname, &sb) == -1) { std::cout << "failed lstat " << tempname; std::cout << "with error: " << ::strerror(errno) << std::endl; diff --git a/projects/hip-tests/catch/unit/rtc/includepath.cc b/projects/hip-tests/catch/unit/rtc/includepath.cc index e70c0eebb7..a72a8824f0 100644 --- a/projects/hip-tests/catch/unit/rtc/includepath.cc +++ b/projects/hip-tests/catch/unit/rtc/includepath.cc @@ -110,13 +110,13 @@ TEST_CASE("Unit_hiprtc_includepath") { void* config[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args, HIP_LAUNCH_PARAM_BUFFER_SIZE, &size, HIP_LAUNCH_PARAM_END}; - hipModuleLaunchKernel(kernel, NUM_BLOCKS, 1, 1, NUM_THREADS, 1, 1, 0, nullptr, nullptr, config); + HIP_CHECK(hipModuleLaunchKernel(kernel, NUM_BLOCKS, 1, 1, NUM_THREADS, 1, 1, 0, nullptr, nullptr, config)); HIP_CHECK(hipMemcpy(hOut.get(), dOut, bufferSize, hipMemcpyDeviceToHost)); - hipFree(dX); - hipFree(dY); - hipFree(dOut); + HIP_CHECK(hipFree(dX)); + HIP_CHECK(hipFree(dY)); + HIP_CHECK(hipFree(dOut)); HIP_CHECK(hipModuleUnload(module)); diff --git a/projects/hip-tests/catch/unit/texture/hipTextureObjectTests.cc b/projects/hip-tests/catch/unit/texture/hipTextureObjectTests.cc index aa19fe2520..1fefec4d14 100644 --- a/projects/hip-tests/catch/unit/texture/hipTextureObjectTests.cc +++ b/projects/hip-tests/catch/unit/texture/hipTextureObjectTests.cc @@ -48,7 +48,7 @@ class TextureObjectTestWrapper { } channel_desc = hipCreateChannelDesc(32, 0, 0, 0, hipChannelFormatKindFloat); - hipMallocArray(&array_member, &channel_desc, width); + HIP_CHECK(hipMallocArray(&array_member, &channel_desc, width)); HIP_CHECK( hipMemcpy2DToArray(array_member, 0, 0, host_data_, size, size, 1, hipMemcpyHostToDevice));