alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth > Struct Template Reference

pointer to a SIMD pack with the width T_SimdWidth More...

#include <SimdPtr.hpp>

Inheritance diagram for alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >:

Public Types

using IdxType = typename T_IdxType::UniVec
using value_type = typename T_MdSpan::value_type

Public Member Functions

constexpr SimdPtr (T_MdSpan const &mdSpan, T_IdxType const &idx, T_MemAlignment, T_SimdWidth)
constexpr IdxType getIdx () const
 offset in elements relative to the MdSpan given at construction
constexpr decltype(auto) load ()
constexpr decltype(auto) load () const
constexpr alpaka::concepts::SimdPtr auto operator[] (auto const &idx) const
 Shift the element the pointer is pointing to by idx.
constexpr alpaka::concepts::SimdPtr auto operator[] (auto const &idx)
 Shift the element the pointer is pointing to by idx.
template<typename T_Storage>
constexpr void storeTo (Simd< value_type, SimdPtr::width(), T_Storage > const &rhs) const
 store the simd pack to the memory the pointer is pointing to
template<typename T_Storage>
constexpr void storeTo (Simd< value_type, SimdPtr::width(), T_Storage > const &rhs)
 store the simd pack to the memory the pointer is pointing to
template<typename T_Storage>
constexpr SimdPtr const & operator= (Simd< value_type, SimdPtr::width(), T_Storage > const &rhs) const
 store the simd pack to the memory the pointer is pointing to
template<typename T_Storage>
constexpr SimdPtroperator= (Simd< value_type, SimdPtr::width(), T_Storage > const &rhs)
 store the simd pack to the memory the pointer is pointing to

Static Public Member Functions

static constexpr auto getAlignment ()
 get the alignment of the memory the pointer is pointing to
static consteval uint32_t width ()

Private Attributes

IdxType m_idx

Detailed Description

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
struct alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >

pointer to a SIMD pack with the width T_SimdWidth

The pointer is used to load/store data from/to memory

Template Parameters
T_MdSpantype of the memory the pointer is pointing to
T_IdxTypetype of the index
T_MemAlignmentalignment of the memory the pointer is pointing to
T_SimdWidthwidth of the SIMD pack

Definition at line 61 of file SimdPtr.hpp.

Member Typedef Documentation

◆ IdxType

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
using alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::IdxType = typename T_IdxType::UniVec

Definition at line 64 of file SimdPtr.hpp.

◆ value_type

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
using alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::value_type = typename T_MdSpan::value_type

Definition at line 63 of file SimdPtr.hpp.

Constructor & Destructor Documentation

◆ SimdPtr()

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::SimdPtr ( T_MdSpan const & mdSpan,
T_IdxType const & idx,
T_MemAlignment ,
T_SimdWidth  )
inlineconstexpr

Definition at line 71 of file SimdPtr.hpp.

Member Function Documentation

◆ getAlignment()

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
constexpr auto alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::getAlignment ( )
inlinestaticconstexpr

get the alignment of the memory the pointer is pointing to

Attention
If the pointer is shifted by operator[] the alignment is equal to the data alignment of an single element
Returns
the alignment of the memory (in byte) the pointer is pointing to

Definition at line 139 of file SimdPtr.hpp.

◆ getIdx()

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
IdxType alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::getIdx ( ) const
inlineconstexpr

offset in elements relative to the MdSpan given at construction

The index points to the first element followed by T_SimdWidth elements.

Returns
the index of the first element relative to the MdSpan given at construction

Definition at line 193 of file SimdPtr.hpp.

◆ load() [1/2]

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
decltype(auto) alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::load ( )
inlineconstexpr

Definition at line 127 of file SimdPtr.hpp.

◆ load() [2/2]

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
decltype(auto) alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::load ( ) const
inlineconstexpr

Definition at line 122 of file SimdPtr.hpp.

◆ operator=() [1/2]

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
template<typename T_Storage>
SimdPtr & alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::operator= ( Simd< value_type, SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::width(), T_Storage > const & rhs)
inlineconstexpr

store the simd pack to the memory the pointer is pointing to

Parameters
rhssimd pack to store

Definition at line 179 of file SimdPtr.hpp.

◆ operator=() [2/2]

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
template<typename T_Storage>
SimdPtr const & alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::operator= ( Simd< value_type, SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::width(), T_Storage > const & rhs) const
inlineconstexpr

store the simd pack to the memory the pointer is pointing to

Parameters
rhssimd pack to store

Definition at line 172 of file SimdPtr.hpp.

◆ operator[]() [1/2]

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
alpaka::concepts::SimdPtr auto alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::operator[] ( auto const & idx)
inlineconstexpr

Shift the element the pointer is pointing to by idx.

Parameters
idxnumber of elements to shift the pointer by
Returns
a new simd pointer pointing to the shifted element

Definition at line 102 of file SimdPtr.hpp.

◆ operator[]() [2/2]

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
alpaka::concepts::SimdPtr auto alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::operator[] ( auto const & idx) const
inlineconstexpr

Shift the element the pointer is pointing to by idx.

Parameters
idxnumber of elements to shift the pointer by
Returns
a new simd pointer pointing to the shifted element

Definition at line 84 of file SimdPtr.hpp.

◆ storeTo() [1/2]

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
template<typename T_Storage>
void alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::storeTo ( Simd< value_type, SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::width(), T_Storage > const & rhs)
inlineconstexpr

store the simd pack to the memory the pointer is pointing to

Parameters
rhssimd pack to store

Definition at line 165 of file SimdPtr.hpp.

◆ storeTo() [2/2]

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
template<typename T_Storage>
void alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::storeTo ( Simd< value_type, SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::width(), T_Storage > const & rhs) const
inlineconstexpr

store the simd pack to the memory the pointer is pointing to

Parameters
rhssimd pack to store

Definition at line 157 of file SimdPtr.hpp.

◆ width()

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
consteval uint32_t alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::width ( )
inlinestaticconsteval

Definition at line 66 of file SimdPtr.hpp.

Member Data Documentation

◆ m_idx

template<typename T_MdSpan, alpaka::concepts::Vector T_IdxType, alpaka::concepts::Alignment T_MemAlignment, alpaka::concepts::CVector T_SimdWidth>
IdxType alpaka::SimdPtr< T_MdSpan, T_IdxType, T_MemAlignment, T_SimdWidth >::m_idx
private

Definition at line 199 of file SimdPtr.hpp.


The documentation for this struct was generated from the following file: