template<typename T>
class gmx::internal::SimdArrayRef< T >
STL-like container for aligned SIMD type. Used as ArrayRef<SimdReal>.
Should provide the same interface as ArrayRef. Any missing functions should be added as needed. The pointer type (used e.g. for initialization) is a real pointer. The reference type (used e.g. for operator[] and iterator dereference) is SimdReference which executes the aligned load/store as is appropriate. For both iterator and element access, the access happens in blocks of SIMD width. Meaning that a[1] refers to the 2nd SIMD vector and thus reals 8-15 for 8-wide SIMD. The starting address has to be aligned and the length has to be multiple of the SIMD width.
- Template Parameters
-
| T | SIMD type (e.g. SimdReal) |
|
|
using | size_type = size_t |
| | Type for representing size of the container.
|
| |
|
using | difference_type = std::ptrdiff_t |
| | Type for representing difference between two container indices.
|
| |
|
using | value_type = T |
| | Type of values stored in the container.
|
| |
|
using | pointer = SimdTraitsT< T > * |
| | Pointer to a container element.
|
| |
|
using | reference = internal::SimdReference< T > |
| | Reference to a container element.
|
| |
|
using | iterator = SimdIterator< T > |
| | Iterator type for the container.
|
| |
|
using | reverse_iterator = std::reverse_iterator< iterator > |
| | Standard reverse iterator.
|
| |
|
| | SimdArrayRef (pointer begin, pointer end) |
| | Constructs a reference to a particular range. More...
|
| |
| template<typename U , typename = std::enable_if_t<std::is_convertible_v<typename U::pointer, pointer>>> |
| | SimdArrayRef (U &o) |
| | Constructs a reference to a container or another ArrayRef (lvalue overload) More...
|
| |
| template<typename U , typename = std::enable_if_t<std::is_convertible_v<typename U::pointer, pointer>>> |
| | SimdArrayRef (U &&o) |
| | Constructs a reference to a container or another ArrayRef (rvalue overload) More...
|
| |
|
size_type | size () const |
| | Returns the size of the container.
|
| |
|
bool | empty () const |
| | Whether the container is empty.
|
| |
|
iterator | begin () const |
| | Returns an iterator to the beginning of the container.
|
| |
|
iterator | end () const |
| | Returns an iterator to the end of the container.
|
| |
|
reference | operator[] (size_type n) |
| | Access container element.
|
| |
|
reference | front () const |
| | Returns the first element in the container.
|
| |
|
reference | back () const |
| | Returns the first element in the container.
|
| |
template<typename T >
template<typename U , typename = std::enable_if_t<std::is_convertible_v<typename U::pointer, pointer>>>
Constructs a reference to a container or another ArrayRef (lvalue overload)
- Parameters
-
| [in] | o | container or ArrayRef to reference. |
Can be used to create a reference to a whole vector, std::array, or another ArrayRef (e.g., ArrayRef<int> to ArrayRef<const int>). The destination has to have a convertible pointer type (identical besides const or base class).
Passed container must remain valid and not be reallocated for the lifetime of this object.
This constructor is not explicit to allow directly passing a container to a method that takes ArrayRef.
template<typename T >
template<typename U , typename = std::enable_if_t<std::is_convertible_v<typename U::pointer, pointer>>>
Constructs a reference to a container or another ArrayRef (rvalue overload)
- Parameters
-
| [in] | o | container or ArrayRef to reference. |
This overload allows passing temporary containers directly to functions taking ArrayRef. The temporary lives for the full statement, so this is safe for immediate use but dangerous if the ArrayRef is stored.
This constructor is not explicit to allow directly passing a temporary to a method that takes ArrayRef.