From 9c50118389826c8bc04f4d190ec733929864b10a Mon Sep 17 00:00:00 2001 From: raramakr <91213141+raramakr@users.noreply.github.com> Date: Tue, 9 Jan 2024 08:21:47 -0800 Subject: [PATCH] SWDEV-439954 - Use hard coded filename rather than using the macro __FILE__ for debug prints. (#1123) * SWDEV-439954 - Use hard coded filename rather than using the macro __FILE__ for debug prints. Hiptensor library is using the header files from CK. Hard coded ROCm path was getting embedded into the hiptensor library, since the header file was having the macro __FILE__. Replace the macro with filename. * fix syntax --------- Co-authored-by: illsilin [ROCm/composable_kernel commit: e699dbd8a3c0e75a980e1b9fcb9a359241e34309] --- include/ck/host_utility/hip_check_error.hpp | 28 ++++++++++--------- .../device/impl/device_contraction_utils.hpp | 10 ++++--- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/include/ck/host_utility/hip_check_error.hpp b/include/ck/host_utility/hip_check_error.hpp index 3e44faecb6..c0894f1d70 100644 --- a/include/ck/host_utility/hip_check_error.hpp +++ b/include/ck/host_utility/hip_check_error.hpp @@ -12,21 +12,23 @@ inline void hip_check_error(hipError_t x) if(x != hipSuccess) { std::ostringstream ss; - ss << "HIP runtime error: " << hipGetErrorString(x) << ". " << __FILE__ << ": " << __LINE__ - << "in function: " << __func__; + ss << "HIP runtime error: " << hipGetErrorString(x) << ". " + << "hip_check_error.hpp" + << ": " << __LINE__ << "in function: " << __func__; throw std::runtime_error(ss.str()); } } -#define HIP_CHECK_ERROR(retval_or_funcall) \ - do \ - { \ - hipError_t _tmpVal = retval_or_funcall; \ - if(_tmpVal != hipSuccess) \ - { \ - std::ostringstream ostr; \ - ostr << "HIP Function Failed (" << __FILE__ << "," << __LINE__ << ") " \ - << hipGetErrorString(_tmpVal); \ - throw std::runtime_error(ostr.str()); \ - } \ +#define HIP_CHECK_ERROR(retval_or_funcall) \ + do \ + { \ + hipError_t _tmpVal = retval_or_funcall; \ + if(_tmpVal != hipSuccess) \ + { \ + std::ostringstream ostr; \ + ostr << "HIP Function Failed (" \ + << "hip_check_error.hpp" \ + << "," << __LINE__ << ") " << hipGetErrorString(_tmpVal); \ + throw std::runtime_error(ostr.str()); \ + } \ } while(0) diff --git a/include/ck/tensor_operation/gpu/device/impl/device_contraction_utils.hpp b/include/ck/tensor_operation/gpu/device/impl/device_contraction_utils.hpp index 0e14b40942..838305f187 100644 --- a/include/ck/tensor_operation/gpu/device/impl/device_contraction_utils.hpp +++ b/include/ck/tensor_operation/gpu/device/impl/device_contraction_utils.hpp @@ -35,15 +35,17 @@ auto CalculateMaxRead(const std::vector& lengths, const std::vector