From 5b08779b25fbc5be34df10655eded741807b4fe1 Mon Sep 17 00:00:00 2001 From: cjatin Date: Tue, 19 Oct 2021 20:23:08 +0530 Subject: [PATCH] SWDEV-307407 - Add hiprtc's type traits function to match implementation of libcxx Change-Id: I0a10eca329f817bbe31bdc47869b2de104d12d38 --- .../hip/amd_detail/amd_hip_vector_types.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hipamd/include/hip/amd_detail/amd_hip_vector_types.h b/hipamd/include/hip/amd_detail/amd_hip_vector_types.h index fd7c554ee2..fae00b9968 100644 --- a/hipamd/include/hip/amd_detail/amd_hip_vector_types.h +++ b/hipamd/include/hip/amd_detail/amd_hip_vector_types.h @@ -52,11 +52,25 @@ THE SOFTWARE. namespace std { using ::size_t; +template struct integral_constant { + static constexpr const _Tp value = __v; + typedef _Tp value_type; + typedef integral_constant type; + constexpr operator value_type() const { return value; } + constexpr value_type operator()() const { return value; } +}; +template constexpr const _Tp integral_constant<_Tp, __v>::value; + +typedef integral_constant true_type; +typedef integral_constant false_type; + +template using bool_constant = integral_constant; +typedef bool_constant true_type; +typedef bool_constant false_type; + template struct enable_if {}; template struct enable_if { typedef __T type; }; -struct true_type { static const __constant__ bool value = true; }; -struct false_type { static const __constant__ bool value = false; }; template struct true_or_false_type : public false_type {}; template<> struct true_or_false_type : public true_type {};