From 90e078b5f48bdea2e61f8db9ac7effa838075bfe Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Tue, 10 Oct 2023 15:06:53 +0000 Subject: [PATCH] SWDEV-425490 - Move ptrdiff_t & clock_t to hiprtc.cmake. Change-Id: I7c8ce3c1b8cb11e0253b0f51ae10fca7f0a32017 [ROCm/clr commit: 7150b2eaad4f9b15c6d29d392c7d060c4f661190] --- .../hipamd/include/hip/amd_detail/amd_hip_runtime.h | 8 -------- projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake | 12 ++++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime.h b/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime.h index fd9dfddd48..f4a143798f 100644 --- a/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime.h +++ b/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime.h @@ -93,19 +93,11 @@ typedef unsigned int uint32_t; typedef unsigned long long uint64_t; typedef signed int int32_t; typedef signed long long int64_t; -#if defined(__GLIBCXX__) -typedef long int ptrdiff_t; -#else -typedef long long ptrdiff_t; -#endif -typedef long clock_t; namespace std { using ::uint32_t; using ::uint64_t; using ::int32_t; using ::int64_t; -using ::ptrdiff_t; -using ::clock_t; } #endif // __HIP_NO_STD_DEFS__ #endif // !defined(__HIPCC_RTC__) diff --git a/projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake b/projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake index 187e961648..bfd09e8fe7 100644 --- a/projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake +++ b/projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake @@ -59,6 +59,18 @@ function(get_hiprtc_macros HIPRTC_DEFINES) #define _HIP_BFLOAT16_H_\n\ #define HIP_INCLUDE_HIP_MATH_FUNCTIONS_H\n\ #define HIP_INCLUDE_HIP_HIP_VECTOR_TYPES_H\n\ +#if !__HIP_NO_STD_DEFS__\n\ +#if defined(__HIPRTC_PTRDIFF_T_IS_LONG_LONG__) && __HIPRTC_PTRDIFF_T_IS_LONG_LONG__==1\n\ +typedef long long ptrdiff_t;\n\ +#else\n\ +typedef __PTRDIFF_TYPE__ ptrdiff_t;\n\ +#endif\n\ +typedef long clock_t;\n\ +namespace std {\n\ +using ::ptrdiff_t;\n\ +using ::clock_t;\n\ +}\n\ +#endif // __HIP_NO_STD_DEFS__\n\ #pragma clang diagnostic pop" PARENT_SCOPE) endfunction(get_hiprtc_macros)