18 inline namespace _V1 {
19 namespace ext::intel::esimd::detail {
56 template <
typename T,
int N>
59 T, N, simd_mask_impl<T, N>,
60 std::enable_if_t<std::is_same_v<simd_mask_elem_type, T>>> {
72 static_assert(std::is_same_v<
raw_vector_type, simd_mask_storage_t<N>> &&
73 "mask impl type mismatch");
83 template <
class T1,
class = std::enable_if_t<std::is_
integral_v<T1>>>
91 template <
int N1,
class = std::enable_if_t<N1 == N>>
93 base_type::template init_from_array<false>(std::move(Arr));
100 template <
typename T1>
102 : base_type(convert_vector<T, T1, N>(Val.
data())) {}
106 static constexpr
bool mask_size_ok_for_mem_io() {
108 return (Sz >= OperandSize::OWORD) && (Sz % OperandSize::OWORD == 0) &&
110 (Sz <= 8 * OperandSize::OWORD);
122 template <
typename T1,
123 typename = std::enable_if_t<mask_size_ok_for_mem_io() &&
124 std::is_same_v<T1, element_type>>>
126 base_type::copy_from(ptr);
143 class = std::enable_if_t<T1::length == 1>>
144 operator bool()
const {
145 return base_type::data()[0] != 0;
149 #undef __ESIMD_MASK_DEPRECATION_MSG
This class is a simd_obj_impl specialization representing a simd mask, which is basically a simd_obj_...
T element_type
Element type, same as raw.
T raw_element_type
Raw element type actually used for storage.
simd_mask_impl(const simd< T, N > &Val)
Implicit conversion from simd.
typename base_type::raw_vector_type raw_vector_type
Underlying storage type for the entire vector.
simd_mask_impl & operator=(const simd_mask_impl &other) noexcept
Copy assignment operator.
simd_mask_impl(const raw_vector_type &Val)
Implicit conversion constructor from a raw vector object.
simd_mask_impl(const raw_element_type(&&Arr)[N1])
Construct from an array. To allow e.g. simd_mask<N> m({1,0,0,1,...}).
simd_mask_impl(const T1 *ptr)
Load constructor.
simd_mask_impl & operator=(element_type val) noexcept
Broadcast assignment operator to support simd_mask_impl<N> n = a > b;.
simd_mask_impl()=default
Compiler-generated default constructor.
simd_mask_impl(const simd_mask_impl &other)
Copy constructor.
simd_mask_impl(T1 Val)
Broadcast constructor with conversion.
simd_mask_impl(const ext::oneapi::experimental::simd_mask< T1, N > &Val)
Implicit conversion from std::experimental::simd_mask.
This is a base class for all ESIMD simd classes with real storage (simd, simd_mask_impl).
raw_vector_type data() const
The main simd vector class.
constexpr ESIMD_INLINE bool isPowerOf2(unsigned int n)
Check if a given 32 bit positive integer is a power of 2 at compile time.
annotated_arg & operator=(annotated_arg &)=default
std::experimental::simd_mask< T, simd_abi::native_fixed_size< T, N > > simd_mask
_Abi const simd< _Tp, _Abi > & noexcept