Gromacs  2025-dev-20241003-bd59e46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Friends
gmx::internal::SimdArrayRef< T > Class Template Reference

#include <gromacs/simd/include/gromacs/simd/simd_memory.h>

Description

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
TSIMD type (e.g. SimdReal)

Public Types

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.
 

Public Member Functions

 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 std::remove_reference_t<U>::pointer, pointer>>>
 SimdArrayRef (U &&o)
 
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.
 

Friends

template<typename U >
class SimdArrayRef
 

Constructor & Destructor Documentation

template<typename T >
gmx::internal::SimdArrayRef< T >::SimdArrayRef ( pointer  begin,
pointer  end 
)
inline

Constructs a reference to a particular range.

Parameters
[in]beginPointer to the beginning of a range.
[in]endPointer to the end of a range.

Passed pointers must remain valid for the lifetime of this object.

template<typename T >
template<typename U , typename = std::enable_if_t<std::is_convertible_v<typename std::remove_reference_t<U>::pointer, pointer>>>
gmx::internal::SimdArrayRef< T >::SimdArrayRef ( U &&  o)
inline


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