Skip to content

Commit

Permalink
SWDEV-425449 - Move ptrdiff_t & clock_t to hiprtc.cmake.
Browse files Browse the repository at this point in the history
Change-Id: I7c8ce3c1b8cb11e0253b0f51ae10fca7f0a32017
(cherry picked from commit 7150b2e)
  • Loading branch information
jaydeeppatel1111 authored and mangupta committed Nov 30, 2023
1 parent b1765c4 commit c2bf552
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 0 additions & 8 deletions hipamd/include/hip/amd_detail/amd_hip_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
12 changes: 12 additions & 0 deletions hipamd/src/hiprtc/cmake/HIPRTC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c2bf552

Please sign in to comment.