Realigns a pointer under a given power-of-2 alignment constraint.
Realigns a pointer over a given power-of-2 alignment constraint.
Realigns integral value under a given power-of-2 alignment constraint.
EVE provides various elements to simplify the management of SIMD-compatible memory like functions and allocators for requesting SIMD-compatible block of memory, pointer wrappers to discriminate aligned memory from regular one, and alignment computation functions.
Convenience header:
#include <eve/memory.hpp>
- Parameters
-
| v | Integral value to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
- Returns
- An integer value greater or equal to v which is a multiple of alignment
- See also
- align(T v, under alignment)
-
align(T* v, over alignment)
-
align(T* v, under alignment)
- Parameters
-
| v | Integral value to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
- Returns
- An integer value lesser or equal to v which is a multiple of alignment
- See also
- align(T v, over alignment)
-
align(T* v, over alignment)
-
align(T* v, under alignment)
- Parameters
-
| ptr | Pointer to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
- Returns
- A pointer to T which address is greater or equal to ptr and which value is a multiple of alignment.
- See also
- align(T v, over alignment)
-
align(T v, under alignment)
-
align(T* v, under alignment)
- Parameters
-
| ptr | Pointer to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
- Returns
- A pointer to T which address is lesser or equal to ptr and which value is a multiple of alignment.
- See also
- align(T v, over alignment)
-
align(T v, under alignment)
-
align(T* v, over alignment)
|
| template<std::size_t A, typename T, typename Other> |
| constexpr bool | eve::is_aligned (aligned_ptr< T, Other > const &ptr) noexcept |
| | Checks if an aligned_ptr is aligned on a given alignment.
|
| template<std::size_t Alignment, std::integral T> |
| constexpr bool | eve::is_aligned (T v) noexcept |
| | Checks if a pointer satisfies an alignment constraint.
|
| template<std::size_t Alignment, typename T> |
| constexpr bool | eve::is_aligned (T *ptr) noexcept |
| | Checks if a pointer satisfies an alignment constraint.
|
| template<typename T, typename Lanes> |
| constexpr bool | eve::is_aligned (T *ptr, Lanes lanes) noexcept |
| | Checks if a pointer satisfies an alignment constraint.
|
|
| constexpr auto | eve::read = functor<read_t> |
| | Callable object reading single value from memory.
|
| constexpr auto | eve::store = functor<store_t> |
| | Store the elements of a SIMD value into the given memory location.
|
| constexpr auto | eve::unalign = functor<unalign_t> |
| | Callable object for computing an unaligned version of a relaxed iterator.
|
| constexpr auto | eve::write = functor<write_t> |
| | Callable object writing a scalar value to memory.
|
| constexpr callable_store_equivalent_ | eve::store_equivalent = {} |
| | Callable object, customisation point. If an iterator's store operation can be done as a store to some other iterator/pointer - this is a transformation to customize.
|