Merge pull request #1159 from mhbliao/hliao/master/explicit

[hip] Make vector type's scalar conversion explicit.
This commit is contained in:
Maneesh Gupta
2019-06-05 12:13:56 +05:30
committed by GitHub
+5 -5
View File
@@ -114,7 +114,7 @@ THE SOFTWARE.
typename U,
typename std::enable_if<
std::is_convertible<U, T>{}>::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; \
}