![]() |
alpaka
Abstraction Library for Parallel Kernel Acceleration
|
#include <Simd.hpp>
Public Types | |
| using | index_type = uint32_t |
| using | rank_type = uint32_t |
| using | reference = typename T_Storage::reference |
| type is an implementation detail, can be a proxy type. | |
| using | size_type = uint32_t |
| using | Storage = T_Storage |
| using | type = typename T_Storage::value_type |
| using | UniSimd = Simd<T_Type, T_width> |
Public Member Functions | |
| constexpr | Simd ()=default |
| template<typename F, std::enable_if_t< std::is_invocable_v< F, std::integral_constant< uint32_t, 0u > >, uint32_t > = 0u> | |
| ALPAKA_FN_HOST_ACC | Simd (F &&generator) |
| Initialize via a generator expression. | |
| constexpr | Simd (Simd const &other)=default |
| template<typename T_OtherStorage> | |
| constexpr | Simd (Simd< T_Type, T_width, T_OtherStorage > const &other) |
| constructor allows changing the storage policy | |
| template<typename... T_Args> | |
| ALPAKA_FN_HOST_ACC | Simd (T_Args const &... args) |
| Constructor for SIMD pack. | |
| constexpr | Simd (T_Storage const &other) |
| constexpr void | copyFrom (T_Type const *data, concepts::Alignment auto alignment) |
| constexpr void | copyTo (auto *data, concepts::Alignment auto alignment) const |
| constexpr Simd< T_Type, T_width - 1u > | eraseBack () const |
| Shrink the SIMD pack. | |
| template<typename T_OtherStorage> | |
| constexpr auto | min (Simd< T_Type, T_width, T_OtherStorage > const &rhs) const |
| constexpr | operator type () |
| Allow static_cast / explicit cast to member type. | |
| constexpr Simd | operator- () const |
| constexpr Simd & | operator= (Simd &&)=default |
| constexpr Simd & | operator= (Simd const &)=default |
| constexpr reference | operator[] (std::integral auto const idx) |
| access a lane by index | |
| constexpr type | operator[] (std::integral auto const idx) const |
| access a lane by index | |
| constexpr type | product () const |
| Returns product of all components. | |
| constexpr auto | reduce (auto &&reduceFunc) const -> decltype(reduceFunc(std::declval< type >(), std::declval< type >())) |
| reduce all elements to a single value | |
| template<std::integral auto laneIdxToRemove> requires (T_width >= 2u) | |
| constexpr Simd< type, T_width - 1u > | remove () const |
| Removes a component. | |
| constexpr Simd | revert () const |
| template<uint32_t T_numElements> | |
| constexpr Simd< T_Type, T_numElements > | rshrink () const |
| Shrink the number of elements of a vector. | |
| template<uint32_t T_numElements> | |
| constexpr Simd< type, T_numElements > | rshrink (std::integral auto const startIdx) const |
| Shrink the number of elements of a vector. | |
| constexpr type | sum () const |
| Returns sum of all components. | |
| constexpr Simd | 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 Simd & | operator+= (Simd< T_Type, T_width, T_OtherStorage > const &rhs) |
| constexpr Simd & | operator+= (concepts::LosslesslyConvertible< T_Type > auto const value) |
| template<typename T_OtherStorage> | |
| constexpr Simd & | operator-= (Simd< T_Type, T_width, T_OtherStorage > const &rhs) |
| constexpr Simd & | operator-= (concepts::LosslesslyConvertible< T_Type > auto const value) |
| template<typename T_OtherStorage> | |
| constexpr Simd & | operator/= (Simd< T_Type, T_width, T_OtherStorage > const &rhs) |
| constexpr Simd & | operator/= (concepts::LosslesslyConvertible< T_Type > auto const value) |
| template<typename T_OtherStorage> | |
| constexpr Simd & | operator*= (Simd< T_Type, T_width, T_OtherStorage > const &rhs) |
| constexpr Simd & | operator*= (concepts::LosslesslyConvertible< T_Type > auto const value) |
| template<typename T_OtherStorage> | |
| constexpr Simd & | operator= (Simd< T_Type, T_width, T_OtherStorage > const &rhs) |
| constexpr Simd & | operator= (concepts::LosslesslyConvertible< T_Type > auto const value) |
| constexpr reference | x () |
| named lane access | |
| constexpr type | x () const |
| named lane access | |
| constexpr reference | y () |
| named lane access | |
| constexpr type | y () const |
| named lane access | |
| constexpr reference | z () |
| named lane access | |
| constexpr type | z () const |
| named lane access | |
| constexpr reference | w () |
| named lane access | |
| constexpr type | w () const |
| named lane access | |
| constexpr reference | r () |
| named lane access | |
| constexpr type | r () const |
| named lane access | |
| constexpr reference | g () |
| named lane access | |
| constexpr type | g () const |
| named lane access | |
| constexpr reference | b () |
| named lane access | |
| constexpr type | b () const |
| named lane access | |
| constexpr reference | a () |
| named lane access | |
| constexpr type | a () const |
| named lane access | |
| constexpr reference | s0 () |
| named lane access | |
| constexpr type | s0 () const |
| named lane access | |
| constexpr reference | s1 () |
| named lane access | |
| constexpr type | s1 () const |
| named lane access | |
| constexpr reference | s2 () |
| named lane access | |
| constexpr type | s2 () const |
| named lane access | |
| constexpr reference | s3 () |
| named lane access | |
| constexpr type | s3 () const |
| named lane access | |
| constexpr reference | s4 () |
| named lane access | |
| constexpr type | s4 () const |
| named lane access | |
| constexpr reference | s5 () |
| named lane access | |
| constexpr type | s5 () const |
| named lane access | |
| constexpr reference | s6 () |
| named lane access | |
| constexpr type | s6 () const |
| named lane access | |
| constexpr reference | s7 () |
| named lane access | |
| constexpr type | s7 () const |
| named lane access | |
| constexpr reference | s8 () |
| named lane access | |
| constexpr type | s8 () const |
| named lane access | |
| constexpr reference | s9 () |
| named lane access | |
| constexpr type | s9 () const |
| named lane access | |
| constexpr reference | sA () |
| named lane access | |
| constexpr type | sA () const |
| named lane access | |
| constexpr reference | sB () |
| named lane access | |
| constexpr type | sB () const |
| named lane access | |
| constexpr reference | sC () |
| named lane access | |
| constexpr type | sC () const |
| named lane access | |
| constexpr reference | sD () |
| named lane access | |
| constexpr type | sD () const |
| named lane access | |
| constexpr reference | sE () |
| named lane access | |
| constexpr type | sE () const |
| named lane access | |
| constexpr reference | sF () |
| named lane access | |
| constexpr type | sF () const |
| named lane access | |
Static Public Member Functions | |
| static constexpr auto | fill (concepts::Convertible< T_Type > auto value) |
| Creates a Simd where all lanes are set to the same value. | |
| static consteval uint32_t | width () |
| Number of components/lanes in the SIMD pack. | |
Private Member Functions | |
| template<typename F, uint32_t... Is> | |
| constexpr | Simd (F &&generator, std::integer_sequence< uint32_t, Is... >) |
| template<uint32_t T_start = 0u, uint32_t T_end = width()> | |
| constexpr auto | reduce_range (auto &&reduceFunc) const -> decltype(reduceFunc(std::declval< type >(), std::declval< type >())) |
| reduce over a range of elements | |
Friends | |
| template<concepts::SimdMask Mask, concepts::Simd T_Simd> | |
| struct | SimdWhereExpr |
Simd vector.
This class is designed to be used via SimdPtr via reinterpretation of contiguous scalar data.
| T_Type | data value type |
| T_width | number of lanes in the SIMD vector |
| T_Storage | wrapped native representation of the SIMD vector |
| using alpaka::Simd< T_Type, T_width, T_Storage >::index_type = uint32_t |
| using alpaka::Simd< T_Type, T_width, T_Storage >::rank_type = uint32_t |
| using alpaka::Simd< T_Type, T_width, T_Storage >::reference = typename T_Storage::reference |
| using alpaka::Simd< T_Type, T_width, T_Storage >::size_type = uint32_t |
| using alpaka::Simd< T_Type, T_width, T_Storage >::Storage = T_Storage |
| using alpaka::Simd< T_Type, T_width, T_Storage >::type = typename T_Storage::value_type |
| using alpaka::Simd< T_Type, T_width, T_Storage >::UniSimd = Simd<T_Type, T_width> |
|
constexprdefault |
|
inlineexplicit |
Initialize via a generator expression.
The generator must return the value for the corresponding index of the component which is passed to the generator.
This constructor is not constexpr because std::simd is using a reinterpret_cast during the initialization with a generator and complains that this is not allowed in constexpr functions.
|
inline |
Constructor for SIMD pack.
This constructor is not constexpr because std::simd is using a reinterpret_cast during the initialization with a generator and complains that this is not allowed in constexpr functions.
| args | value of each lane index, x,y,z,... |
|
constexprdefault |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineexplicitconstexprprivate |
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinestaticconstexpr |
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
|
inlineexplicitconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
constexprdefault |
|
constexprdefault |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinenodiscardconstexpr |
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlinenodiscardconstexpr |
reduce all elements to a single value
For better numerical stability a tree reduce algorithm is used.
| BinaryOp | binary functor executed to reduce the range The binary operation must be associative. |
|
inlinenodiscardconstexprprivate |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Shrink the number of elements of a vector.
| T_numElements | New width of the SIMD pack. |
| startIdx | Index within the origin vector which will be the last element in the result. |
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlinenodiscardconstexpr |
|
inlineconstexpr |
|
inline |
create string out of the SIMD pack
| 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]
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlinestaticconsteval |
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
inlineconstexpr |
named lane access
Vec. The availability of the naming methods depends on the SIMD width.You can have access to the same lane index via different nonspecific naming.
|
friend |