31 template<
typename T_Type, u
int32_t T_w
idth>
32 struct alignas(alpaka::internal::optimalAlignment<
34 ALPAKA_TYPEOF(internal::valueMaskCast<T_Type>(true)),
38 Alignment<sizeof(ALPAKA_TYPEOF(internal::valueMaskCast<T_Type>(true))) * T_width>>())
39 EmuSimdMask :
protected std::array<ALPAKA_TYPEOF(internal::valueMaskCast<T_Type>(true)), T_width>
43 using BaseType = std::array<ValueMaskType, T_width>;
48 using BaseType::operator[];
60 for(uint32_t i = 0u; i < T_width; ++i)
61 BaseType::operator[](i) = other[i];
72 for(uint32_t i = 0u; i < T_width; i++)
80 template<
typename... T_Args>
81 requires(
sizeof...(T_Args) == T_width && (std::same_as<T_Args, T_Type> && ...))
86 template<
typename... T_Args>
87 requires(
sizeof...(T_Args) == T_width && (std::same_as<T_Args, bool> && ...))
113 static constexpr auto fill(
bool value)
117 for(uint32_t i = 0u; i < T_width; ++i)
126 *(
this) = *
reinterpret_cast<ALPAKA_TYPEOF(*this) const*
>(data);
129 for(uint32_t i = 0u; i < T_width; ++i)
137 *
reinterpret_cast<ALPAKA_TYPEOF(*this) const*
>(data) = (*this);
140 for(uint32_t i = 0u; i < T_width; ++i)
147#define ALPAKA_VECTOR_ASSIGN_OP(op) \
148 template<typename T_OtherStorage> \
149 constexpr EmuSimdMask& operator op(EmuSimdMask const& rhs) \
151 for(uint32_t i = 0u; i < T_width; i++) \
153 asNativeType()[i] op rhs[i]; \
157 constexpr EmuSimdMask& operator op(T_Type const value) \
159 for(uint32_t i = 0u; i < T_width; i++) \
161 asNativeType()[i] op value; \
169#undef ALPAKA_VECTOR_ASSIGN_OP
172#define ALPAKA_VECTOR_BINARY_CMP_OP(returnSimdType, argSimdType, typenameOrConcept, op) \
173 template<typenameOrConcept T_Type, uint32_t T_width> \
174 constexpr auto operator op(const argSimdType<T_Type, T_width>& lhs, const argSimdType<T_Type, T_width>& rhs) \
176 returnSimdType<T_Type, T_width> ret{}; \
177 for(uint32_t i = 0u; i < T_width; i++) \
178 ret[i] = valueMaskCast<T_Type>(lhs[i] op rhs[i]); \
181 template<typenameOrConcept T_Type, uint32_t T_width> \
182 constexpr auto operator op(const argSimdType<T_Type, T_width>& lhs, T_Type rhs) \
184 returnSimdType<T_Type, T_width> ret{}; \
185 for(uint32_t i = 0u; i < T_width; i++) \
186 ret[i] = valueMaskCast<T_Type>(lhs[i] op rhs); \
189 template<typenameOrConcept T_Type, uint32_t T_width> \
190 constexpr auto operator op(T_Type lhs, const argSimdType<T_Type, T_width>& rhs) \
192 returnSimdType<T_Type, T_width> ret{}; \
193 for(uint32_t i = 0u; i < T_width; i++) \
194 ret[i] = valueMaskCast<T_Type>(lhs op rhs[i]); \
210#undef ALPAKA_VECTOR_BINARY_CMP_OP
215 template<concepts::Api T_Api,
typename T_Type, u
int32_t T_w
idth>
}; } }
#define ALPAKA_VECTOR_BINARY_CMP_OP(typenameOrConcept, op)
binary operators
#define ALPAKA_VECTOR_ASSIGN_OP(op)
assign operator
#define ALPAKA_TYPEOF(...)
Get the type of instance.
Concept to check for an alignment object.
alpaka internal implementations.
constexpr auto valueMaskCast(bool condition)
Convert a bool value into a mask type for SIMD.
constexpr decltype(auto) get(concepts::SpecializationOf< Dict > auto &t) noexcept
constexpr EmuSimdMask()=default
ALPAKA_TYPEOF(internal::valueMaskCast< T_Type >(true)) ValueMaskType
constexpr reference operator[](std::integral auto const idx)
constexpr auto & asNativeType()
static cast the instance to the parent class
constexpr void copyTo(auto *data, alpaka::concepts::Alignment auto alignment) const
constexpr void copyFrom(T_Type const *data, alpaka::concepts::Alignment auto alignment)
std::array< ValueMaskType, T_width > BaseType
static constexpr auto fill(bool value)
constexpr EmuSimdMask & operator=(EmuSimdMask &&rhs)=default
SmartMaskValueRef< bool, ValueMaskType > reference
Simd array storge for vector data.
Get the storage type for a SIMD mask pack.
internal::EmuSimdMask< T_Type, T_width > type