diff --git a/projects/hip/include/hip/hcc_detail/hip_complex.h b/projects/hip/include/hip/hcc_detail/hip_complex.h index 48a2852a5a..d19abd7247 100644 --- a/projects/hip/include/hip/hcc_detail/hip_complex.h +++ b/projects/hip/include/hip/hcc_detail/hip_complex.h @@ -121,7 +121,7 @@ THE SOFTWARE. return ret; \ } #define MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ComplexT, T) \ - __device__ __host__ ComplexT(T val) : x(val), y(val) {} \ + explicit __device__ __host__ ComplexT(T val) : x(val), y(val) {} \ __device__ __host__ ComplexT(T val1, T val2) : x(val1), y(val2) {} #endif @@ -131,7 +131,7 @@ struct hipFloatComplex { public: typedef float value_type; __device__ __host__ hipFloatComplex() : x(0.0f), y(0.0f) {} - __device__ __host__ hipFloatComplex(float x) : x(x), y(0.0f) {} + explicit __device__ __host__ hipFloatComplex(float x) : x(x), y(0.0f) {} __device__ __host__ hipFloatComplex(float x, float y) : x(x), y(y) {} MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipFloatComplex, unsigned short) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipFloatComplex, signed short) @@ -151,7 +151,7 @@ struct hipDoubleComplex { public: typedef double value_type; __device__ __host__ hipDoubleComplex() : x(0.0f), y(0.0f) {} - __device__ __host__ hipDoubleComplex(double x) : x(x), y(0.0f) {} + explicit __device__ __host__ hipDoubleComplex(double x) : x(x), y(0.0f) {} __device__ __host__ hipDoubleComplex(double x, double y) : x(x), y(y) {} MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, unsigned short) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, signed short)