Realigns integral value over a given power-of-2 alignment constraint.
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:
| v | Integral value to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
| v | Integral value to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
| ptr | Pointer to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
| ptr | Pointer to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
Classes | |
| struct | eve::aligned_allocator< T, Lanes > |
| Standard-compliant allocator handling the allocation and deallocation of segment of aligned memory. More... | |
| struct | eve::aligned_ptr< Type, Lanes > |
| Wrapper for non-owning aligned pointers. More... | |
| struct | eve::stack_buffer< T > |
| A stack buffer for a simd-value. More... | |
| struct | eve::soa_ptr< Ptrs > |
| a low level abstraction that is like a tuple of pointers to parallel arrays. We think that in code one should use views::zip_iterator instead, it can do everything soa_ptr can and more. We are still trying to figure out how/where these abstractions should live. More... | |
| class | eve::algo::soa_vector< Type, Allocator > |
| SIMD-aware container for product types. More... | |
Concepts | |
| concept | eve::has_store_equivalent |
| tests if store_equivalent has a non-default definition for a value and a pointer. | |
Typedefs | |
| template<typename T> | |
| using | eve::unaligned_t = decltype(unalign(std::declval<T>())) |
| Compute the unaligned pointer type associated to a given type. | |
Enumerations | |
| enum class | eve::over : std::size_t |
| Strong integral type that represents the notion of over-alignment constraints. More... | |
| enum class | eve::under : std::size_t |
| Strong integral type that represents the notion of under-alignment constraints. More... | |
Functions | |
| 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. | |
Variables | |
| 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. | |
| using eve::unaligned_t = decltype(unalign(std::declval<T>())) |
Compute the unaligned pointer type associated to a given type.
| T | Type to process |
Required header: #include <eve/module/core.hpp>
|
strong |
Strong integral type that represents the notion of over-alignment constraints.
Required header:
Strong integral type that represents the notion of over-alignment constraints.
Equivalent to: return std::size_t(n);
|
strong |
Strong integral type that represents the notion of under-alignment constraints.
Required header:
Strong integral type that represents the notion of under-alignment constraints.
Equivalent to: return std::size_t(n);
|
constexprnoexcept |
Checks if an aligned_ptr is aligned on a given alignment.
| ptr | aligned_ptr to checks |
| A | Alignment constraint to verify |
|
constexprnoexcept |
Checks if a pointer satisfies an alignment constraint.
| ptr | Pointer to check |
| Alignment | Alignment constraint to verify. Behavior is undefined if this constraint is not a power of 2. |
|
constexprnoexcept |
Checks if a pointer satisfies an alignment constraint.
| ptr | Pointer to check |
| lanes | Alignment constraint to verify expressed as a SIMD register number of lanes. |
|
constexprnoexcept |
Checks if a pointer satisfies an alignment constraint.
| v | Integral value to check. |
| Alignment | Alignment constraint to verify. Behavior is undefined if this constraint is not a power of 2. |
|
inlineconstexpr |
Callable object reading single value from memory.
Required header: #include <eve/module/core.hpp>
operator* based interface used in the standard has notorious issues with proxy references. To prevent those issues when dealing with complex, potentially SIMD-aware iterators, eve::read is to be used.
| Member | Effect |
|---|---|
| operator() | Performs a single read from memory |
Parameters
ptr: Memory to read from.
Return value
Returns a single value read at the memory location specified by ptr. If ptr is equivalent to nullptr, the behavior is undefined.
|
inlineconstexpr |
Store the elements of a SIMD value into the given memory location.
Parameters
Overloads
|
inlineconstexpr |
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.
Should return new ignore/value/pointer triplet
By default returns ignore/value/pointer tuple, unchanged.
|
inlineconstexpr |
Callable object for computing an unaligned version of a relaxed iterator.
Defined in Header
Convert the pointer or iterator passed as a parameter to a pointer without any information about its alignment.
Parameters
Return value
|
inlineconstexpr |
Callable object writing a scalar value to memory.
operator* based interface used in the standard has notorious issues with proxy references. To prevent those issues when dealing with complex, potentially SIMD-aware iterators, eve::write is to be used.
Defined in Header
Parameters