From fae85cf6d27f7578668b4d60cc436727bbf9f71a Mon Sep 17 00:00:00 2001 From: kpyzhov Date: Tue, 14 Jan 2020 14:30:21 -0500 Subject: [PATCH] Add missing constructors for Scalar_accessor class. (#1792) --- include/hip/hcc_detail/hip_vector_types.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/hip/hcc_detail/hip_vector_types.h b/include/hip/hcc_detail/hip_vector_types.h index 2079bb7e44..453e92ebfc 100644 --- a/include/hip/hcc_detail/hip_vector_types.h +++ b/include/hip/hcc_detail/hip_vector_types.h @@ -105,6 +105,14 @@ THE SOFTWARE. // Idea from https://t0rakka.silvrback.com/simd-scalar-accessor Vector data; + __host__ __device__ + Scalar_accessor() = default; + + __host__ __device__ + Scalar_accessor(T x) { + data[idx] = x; + } + __host__ __device__ operator T() const noexcept { return data[idx]; } __host__ __device__