Skip to content

Commit

Permalink
Change ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
aelovikov-intel committed Jul 29, 2024
1 parent 60dc765 commit c2d18bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sycl/include/sycl/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,9 @@ class __SYCL_EBO Swizzle
Swizzle() = delete;
Swizzle(const Swizzle &) = delete;

Swizzle(VecT &Vec) : Vec(Vec) {}
// Accept by pointer to avoid any possible implicit conversion from vec to
// swizzle.
Swizzle(VecT *Vec) : Vec(*Vec) {}

#ifdef __SYCL_DEVICE_ONLY__
operator vector_t() const {
Expand Down Expand Up @@ -1179,12 +1181,12 @@ class __SYCL_EBO vec
template <typename asT> asT as() const { return sycl::bit_cast<asT>(*this); }

template <int... SwizzleIndexes> Swizzle<SwizzleIndexes...> swizzle() {
return *this;
return this;
}

template <int... SwizzleIndexes>
ConstSwizzle<SwizzleIndexes...> swizzle() const {
return *this;
return this;
}

const DataT &operator[](int i) const { return m_Data[i]; }
Expand Down

0 comments on commit c2d18bf

Please sign in to comment.