From e5d347a679501adffd85aa254d9ef32defe03e12 Mon Sep 17 00:00:00 2001 From: Michael LIAO Date: Tue, 4 Jun 2019 15:15:26 -0400 Subject: [PATCH] [hip] Make vector type's scalar conversion explicit. [ROCm/hip commit: 9bb4ecfcfe95c9cddf2bb1700b53a2c9832c805a] --- projects/hip/include/hip/hcc_detail/hip_vector_types.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/hip/include/hip/hcc_detail/hip_vector_types.h b/projects/hip/include/hip/hcc_detail/hip_vector_types.h index d19a0e0e3f..8f693427d9 100644 --- a/projects/hip/include/hip/hcc_detail/hip_vector_types.h +++ b/projects/hip/include/hip/hcc_detail/hip_vector_types.h @@ -114,7 +114,7 @@ THE SOFTWARE. typename U, typename std::enable_if< std::is_convertible{}>::type* = nullptr> - inline __host__ __device__ + explicit inline __host__ __device__ HIP_vector_type(U x) noexcept { for (auto i = 0u; i != rank; ++i) data[i] = x; @@ -668,20 +668,20 @@ __MAKE_VECTOR_TYPE__(double, double); #define DECLOP_MAKE_ONE_COMPONENT(comp, type) \ static inline __device__ __host__ \ - type make_##type(comp x) { type r = {x}; return r; } + type make_##type(comp x) { type r{x}; return r; } #define DECLOP_MAKE_TWO_COMPONENT(comp, type) \ static inline __device__ __host__ \ - type make_##type(comp x, comp y) { type r = {x, y}; return r; } + type make_##type(comp x, comp y) { type r{x, y}; return r; } #define DECLOP_MAKE_THREE_COMPONENT(comp, type) \ static inline __device__ __host__ \ - type make_##type(comp x, comp y, comp z) { type r = {x, y, z}; return r; } + type make_##type(comp x, comp y, comp z) { type r{x, y, z}; return r; } #define DECLOP_MAKE_FOUR_COMPONENT(comp, type) \ static inline __device__ __host__ \ type make_##type(comp x, comp y, comp z, comp w) { \ - type r = {x, y, z, w}; \ + type r{x, y, z, w}; \ return r; \ }