Skip to content

Commit 7150b2e

Browse files
SWDEV-425490 - Move ptrdiff_t & clock_t to hiprtc.cmake.
Change-Id: I7c8ce3c1b8cb11e0253b0f51ae10fca7f0a32017
1 parent c089ef4 commit 7150b2e

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

hipamd/include/hip/amd_detail/amd_hip_runtime.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,11 @@ typedef unsigned int uint32_t;
9393
typedef unsigned long long uint64_t;
9494
typedef signed int int32_t;
9595
typedef signed long long int64_t;
96-
#if defined(__GLIBCXX__)
97-
typedef long int ptrdiff_t;
98-
#else
99-
typedef long long ptrdiff_t;
100-
#endif
101-
typedef long clock_t;
10296
namespace std {
10397
using ::uint32_t;
10498
using ::uint64_t;
10599
using ::int32_t;
106100
using ::int64_t;
107-
using ::ptrdiff_t;
108-
using ::clock_t;
109101
}
110102
#endif // __HIP_NO_STD_DEFS__
111103
#endif // !defined(__HIPCC_RTC__)

hipamd/src/hiprtc/cmake/HIPRTC.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ function(get_hiprtc_macros HIPRTC_DEFINES)
5959
#define _HIP_BFLOAT16_H_\n\
6060
#define HIP_INCLUDE_HIP_MATH_FUNCTIONS_H\n\
6161
#define HIP_INCLUDE_HIP_HIP_VECTOR_TYPES_H\n\
62+
#if !__HIP_NO_STD_DEFS__\n\
63+
#if defined(__HIPRTC_PTRDIFF_T_IS_LONG_LONG__) && __HIPRTC_PTRDIFF_T_IS_LONG_LONG__==1\n\
64+
typedef long long ptrdiff_t;\n\
65+
#else\n\
66+
typedef __PTRDIFF_TYPE__ ptrdiff_t;\n\
67+
#endif\n\
68+
typedef long clock_t;\n\
69+
namespace std {\n\
70+
using ::ptrdiff_t;\n\
71+
using ::clock_t;\n\
72+
}\n\
73+
#endif // __HIP_NO_STD_DEFS__\n\
6274
#pragma clang diagnostic pop"
6375
PARENT_SCOPE)
6476
endfunction(get_hiprtc_macros)

0 commit comments

Comments
 (0)