|
| | SimdMask ()=default |
| template<typename F> |
| ALPAKA_FN_HOST_ACC | SimdMask (F &&generator) |
| | Initialize via a generator expression.
|
| | SimdMask (SimdMask const &other)=default |
| template<typename T_OtherStorage> |
| ALPAKA_FN_HOST_ACC | SimdMask (SimdMask< T_Type, T_width, T_OtherStorage > const &other) |
| | constructor allows changing the storage policy
|
| template<typename... T_Args> |
| ALPAKA_FN_HOST_ACC | SimdMask (T_Args const &... args) |
| template<typename... T_Args> |
| ALPAKA_FN_HOST_ACC | SimdMask (T_Args const &... args) |
| | Constructor for SIMD pack.
|
| ALPAKA_FN_HOST_ACC | SimdMask (T_Storage const &other) |
| ALPAKA_FN_HOST_ACC | SimdMask (typename T_Storage::BaseType const &base) |
| constexpr void | copyFrom (T_Type const *data, concepts::Alignment auto alignment) |
| constexpr void | copyTo (auto *data, concepts::Alignment auto alignment) const |
| constexpr | operator bool () |
| | Allow static_cast / explicit cast to member type for 1D vector.
|
| constexpr SimdMask & | operator= (SimdMask &&)=default |
| constexpr SimdMask & | operator= (SimdMask const &)=default |
| constexpr reference | operator[] (std::integral auto const idx) |
| constexpr type | operator[] (std::integral auto const idx) const |
| constexpr type | reduce (auto &&reduceFunc) const |
| | reduce all elements to a single value
|
| constexpr SimdMask | toRT () const |
| std::string | toString (std::string const separator=",", std::string const enclosings="{}") const |
| | create string out of the SIMD pack
|
| constexpr auto & | asStorage () |
| | static cast the instance to the storage type
|
| constexpr auto const & | asStorage () const |
| | static cast the instance to the storage type
|
| template<typename T_OtherStorage> |
| constexpr SimdMask & | operator&= (SimdMask< T_Type, T_width, T_OtherStorage > const &rhs) |
| constexpr SimdMask & | operator&= (concepts::LosslesslyConvertible< T_Type > auto const value) |
| template<typename T_OtherStorage> |
| constexpr SimdMask & | operator|= (SimdMask< T_Type, T_width, T_OtherStorage > const &rhs) |
| constexpr SimdMask & | operator|= (concepts::LosslesslyConvertible< T_Type > auto const value) |
| template<typename T_OtherStorage> |
| constexpr SimdMask & | operator^= (SimdMask< T_Type, T_width, T_OtherStorage > const &rhs) |
| constexpr SimdMask & | operator^= (concepts::LosslesslyConvertible< T_Type > auto const value) |
| template<typename T_OtherStorage> |
| constexpr SimdMask & | operator= (SimdMask< T_Type, T_width, T_OtherStorage > const &rhs) |
| constexpr SimdMask & | operator= (concepts::LosslesslyConvertible< T_Type > auto const value) |
| constexpr reference | x () |
| constexpr type | x () const |
| constexpr reference | y () |
| constexpr type | y () const |
| constexpr reference | z () |
| constexpr type | z () const |
| constexpr reference | w () |
| constexpr type | w () const |
| constexpr reference | r () |
| constexpr type | r () const |
| constexpr reference | g () |
| constexpr type | g () const |
| constexpr reference | b () |
| constexpr type | b () const |
| constexpr reference | a () |
| constexpr type | a () const |
| constexpr reference | s0 () |
| constexpr type | s0 () const |
| constexpr reference | s1 () |
| constexpr type | s1 () const |
| constexpr reference | s2 () |
| constexpr type | s2 () const |
| constexpr reference | s3 () |
| constexpr type | s3 () const |
| constexpr reference | s4 () |
| constexpr type | s4 () const |
| constexpr reference | s5 () |
| constexpr type | s5 () const |
| constexpr reference | s6 () |
| constexpr type | s6 () const |
| constexpr reference | s7 () |
| constexpr type | s7 () const |
| constexpr reference | s8 () |
| constexpr type | s8 () const |
| constexpr reference | s9 () |
| constexpr type | s9 () const |
| constexpr reference | sA () |
| constexpr type | sA () const |
| constexpr reference | sB () |
| constexpr type | sB () const |
| constexpr reference | sC () |
| constexpr type | sC () const |
| constexpr reference | sD () |
| constexpr type | sD () const |
| constexpr reference | sE () |
| constexpr type | sE () const |
| constexpr reference | sF () |
| constexpr type | sF () const |
template<typename T_Type, uint32_t T_width, typename T_Storage>
struct alpaka::SimdMask< T_Type, T_width, T_Storage >
Simd mask vector.
- Attention
- You should not use this type to create a buffer of SIMD masks. The implementation is not ABI compatible between different API's. Using Simd masks created on the host and used in the compute kernel will be undefined behaviour.
This class is designed to be used within a kernel together with the where() operation.
- Template Parameters
-
| T_Type | data value type the mask should be applied to |
| T_width | number of lanes in the SIMD mask vector |
| T_Storage | wrapped native representation of the SIMD mask |
Definition at line 76 of file SimdMask.hpp.
template<typename T_Type, uint32_t T_width, typename T_Storage>
template<typename F>
Initialize via a generator expression.
The generator must return the value for the corresponding index of the component which is passed to the generator.
- Note
- The generator needs to have the function interface bool generator(uint32_t id).
Definition at line 104 of file SimdMask.hpp.
template<typename T_Type, uint32_t T_width, typename T_Storage>
template<typename... T_Args>
Constructor for SIMD pack.
- Attention
- This constructor allows implicit casts.
- Parameters
-
| args | value of each lane index, x,y,z,... |
A constexpr vector should be initialized with {} instead of () because at least CUDA 11.6 has problems in cases where a compile time evaluation is required.
constexpr auto vec1 =
Simd{ 1 };
constexpr auto vec2 =
Simd{ 1, 2 };
ALPAKA_FN_HOST_ACC Simd(T_1, T_Args...) -> Simd< T_1, uint32_t(sizeof...(T_Args)+1u)>
Definition at line 129 of file SimdMask.hpp.
template<typename T_Type, uint32_t T_width, typename T_Storage>
reduce all elements to a single value
For better numerical stability a tree reduce algorithm is used.
- Template Parameters
-
| BinaryOp | binary functor executed to reduce the range The binary operation must be associative. |
- Returns
- the type of the result depends on the binary functor
Definition at line 319 of file SimdMask.hpp.
template<typename T_Type, uint32_t T_width, typename T_Storage>
| std::string alpaka::SimdMask< T_Type, T_width, T_Storage >::toString |
( |
std::string const | separator = ",", |
|
|
std::string const | enclosings = "{}" ) const |
|
inline |
create string out of the SIMD pack
- Parameters
-
| separator | string to separate components of the SIMD pack |
| enclosings | string with width 2 to enclose SIMD pack width == 0 ? no enclose symbols width == 1 ? means enclose symbol begin and end are equal width >= 2 ? letter[0] = begin enclose symbol letter[1] = end enclose symbol |
example: .toString(";","|") -> |x;...;z| .toString(",","[]") -> [x,...,z]
Definition at line 337 of file SimdMask.hpp.