From 99a3b66110e7e87de5cbbf226be0070bc498edca Mon Sep 17 00:00:00 2001 From: mhbliao <47895780+mhbliao@users.noreply.github.com> Date: Thu, 19 Dec 2019 13:08:37 -0500 Subject: [PATCH] [hip] Add macro guarding the enum conversion for scalar accessor. (#1748) - That's a high overhead part, which needs enabling ONLY if necessary. --- include/hip/hcc_detail/hip_vector_types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hip/hcc_detail/hip_vector_types.h b/include/hip/hcc_detail/hip_vector_types.h index 0e8dad595a..1d6d43d957 100644 --- a/include/hip/hcc_detail/hip_vector_types.h +++ b/include/hip/hcc_detail/hip_vector_types.h @@ -109,7 +109,8 @@ THE SOFTWARE. operator T() const noexcept { return data[idx]; } __host__ __device__ operator T() const volatile noexcept { return data[idx]; } - + +#ifdef __HIP_ENABLE_VECTOR_SCALAR_ACCESSORY_ENUM_CONVERSION__ // The conversions to enum are fairly ghastly, but unfortunately used in // some pre-existing, difficult to modify, code. template< @@ -130,6 +131,7 @@ THE SOFTWARE. T, typename std::enable_if::value, std::underlying_type>::type::type>{}>::type* = nullptr> __host__ __device__ operator U() const volatile noexcept { return static_cast(data[idx]); } +#endif __host__ __device__ operator T&() noexcept {