Skip to content

Commit e0334df

Browse files
committed
address feedback
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 6628336 commit e0334df

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

sycl/include/std/experimental/simd.hpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,12 +1682,14 @@ class simd_mask {
16821682

16831683
// implicit type conversion constructor
16841684
#ifdef ENABLE_SYCL_EXT_ONEAPI_INVOKE_SIMD
1685-
// TODO inefficient, use this's and __v's storage directly
1685+
template <class _Up>
1686+
simd_mask(const simd_mask<_Up, simd_abi::fixed_size<size()>>& __v) noexcept {
1687+
copyElements(__v);
1688+
}
1689+
16861690
template <class _Up>
16871691
simd_mask(const simd_mask<_Up, abi_type>& __v) noexcept {
1688-
for (size_t __i = 0; __i < size(); __i++) {
1689-
(*this)[__i] = static_cast<element_type>(__v[__i]);
1690-
}
1692+
copyElements(__v);
16911693
}
16921694
#else
16931695
template <class _Up>
@@ -1735,6 +1737,14 @@ class simd_mask {
17351737
#ifdef ENABLE_SYCL_EXT_ONEAPI_INVOKE_SIMD
17361738
private:
17371739
__simd_storage<element_type, _Abi> __s_;
1740+
1741+
// TODO inefficient, use this's and __v's storage directly
1742+
template <class _Up, class _UAbi>
1743+
inline void copyElements(const simd_mask<_Up, _UAbi> & __v) noexcept {
1744+
for (size_t __i = 0; __i < size(); __i++) {
1745+
(*this)[__i] = static_cast<element_type>(__v[__i]);
1746+
}
1747+
}
17381748
#endif // ENABLE_SYCL_EXT_ONEAPI_INVOKE_SIMD
17391749
};
17401750

0 commit comments

Comments
 (0)