![]() |
alpaka
Abstraction Library for Parallel Kernel Acceleration
|
Strongly typed and constexpr representation of a byte-alignment of memory. More...
#include <Alignment.hpp>
Static Public Member Functions | |
| template<typename T_Type> | |
| static consteval uint32_t | get () |
| Get the byte-alignment of a given type when using this alignment. | |
Static Private Member Functions | |
| static consteval uint32_t | get () |
Static Private Attributes | |
| static constexpr uint32_t | value = T_byte |
Strongly typed and constexpr representation of a byte-alignment of memory.
The number of bytes is stored at compile-time using a value template parameter. Therefore, alignments should always be declared constexpr. If no explicit alignment is given, a default will be set.
To use the alignment, the Alignment::get() function can be called for a given type parameter, returning either the object's set alignment, or the given type's alignment, if the default was used.
| T_byte | The number of bytes in uint32_t. |
Definition at line 25 of file Alignment.hpp.
|
inlinestaticconstevalprivate |
Definition at line 52 of file Alignment.hpp.
|
inlinestaticconsteval |
Get the byte-alignment of a given type when using this alignment.
Trying to use an alignment with a smaller value than the alignment of the given T_Type results in a failed static_assert.
| T_Type | The type for which to get the alignment. |
Definition at line 37 of file Alignment.hpp.
|
staticconstexprprivate |
Definition at line 57 of file Alignment.hpp.