vecmem 1.14.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
vecmem::device_array< T, N > Class Template Reference

Class mimicking a host-filled std::array in "device code". More...

#include <vecmem/containers/device_array.hpp>

Public Types

Type definitions, mimicking @c std::array
typedef T value_type
 Type of the array elements.
 
typedef std::size_t size_type
 Size type for the array.
 
typedef std::ptrdiff_t difference_type
 Pointer difference type.
 
typedef value_typereference
 Value reference type.
 
typedef const value_typeconst_reference
 Constant value reference type.
 
typedef value_typepointer
 Value pointer type.
 
typedef const value_typeconst_pointer
 Constant value pointer type.
 
typedef pointer iterator
 Forward iterator type.
 
typedef const_pointer const_iterator
 Constant forward iterator type.
 
typedef vecmem::details::reverse_iterator< iteratorreverse_iterator
 Reverse iterator type.
 
typedef vecmem::details::reverse_iterator< const_iteratorconst_reverse_iterator
 Constant reverse iterator type.
 

Public Member Functions

VECMEM_HOST_AND_DEVICE device_array (const data::vector_view< value_type > &data)
 Constructor, on top of a previously allocated/filled block of memory.
 
template<typename OTHERTYPE , std::enable_if_t< details::is_same_nc< T, OTHERTYPE >::value, bool > = true>
VECMEM_HOST_AND_DEVICE device_array (const data::vector_view< OTHERTYPE > &data)
 Construct a const device array from a non-const data object.
 
VECMEM_HOST_AND_DEVICE device_array (const device_array &parent)
 Copy constructor.
 
VECMEM_HOST_AND_DEVICE device_arrayoperator= (const device_array &rhs)
 Copy assignment operator.
 
Array element access functions
VECMEM_HOST_AND_DEVICE reference at (size_type pos)
 Return a specific element of the array in a "safe way" (non-const)
 
VECMEM_HOST_AND_DEVICE const_reference at (size_type pos) const
 Return a specific element of the array in a "safe way" (const)
 
VECMEM_HOST_AND_DEVICE reference operator[] (size_type pos)
 Return a specific element of the array (non-const)
 
VECMEM_HOST_AND_DEVICE const_reference operator[] (size_type pos) const
 Return a specific element of the array (const)
 
VECMEM_HOST_AND_DEVICE reference front ()
 Return the first element of the array (non-const)
 
VECMEM_HOST_AND_DEVICE const_reference front () const
 Return the first element of the array (const)
 
VECMEM_HOST_AND_DEVICE reference back ()
 Return the last element of the array (non-const)
 
VECMEM_HOST_AND_DEVICE const_reference back () const
 Return the last element of the array (const)
 
VECMEM_HOST_AND_DEVICE pointer data ()
 Access the underlying memory array (non-const)
 
VECMEM_HOST_AND_DEVICE const_pointer data () const
 Access the underlying memory array (const)
 
Iterator providing functions
VECMEM_HOST_AND_DEVICE iterator begin ()
 Return a forward iterator pointing at the beginning of the array.
 
VECMEM_HOST_AND_DEVICE const_iterator begin () const
 Return a constant forward iterator pointing at the beginning of the array.
 
VECMEM_HOST_AND_DEVICE const_iterator cbegin () const
 Return a constant forward iterator pointing at the beginning of the array.
 
VECMEM_HOST_AND_DEVICE iterator end ()
 Return a forward iterator pointing at the end of the array.
 
VECMEM_HOST_AND_DEVICE const_iterator end () const
 Return a constant forward iterator pointing at the end of the array.
 
VECMEM_HOST_AND_DEVICE const_iterator cend () const
 Return a constant forward iterator pointing at the end of the array.
 
VECMEM_HOST_AND_DEVICE reverse_iterator rbegin ()
 Return a reverse iterator pointing at the end of the array.
 
VECMEM_HOST_AND_DEVICE const_reverse_iterator rbegin () const
 Return a constant reverse iterator pointing at the end of the array.
 
VECMEM_HOST_AND_DEVICE const_reverse_iterator crbegin () const
 Return a constant reverse iterator pointing at the end of the array.
 
VECMEM_HOST_AND_DEVICE reverse_iterator rend ()
 Return a reverse iterator pointing at the beginning of the array.
 
VECMEM_HOST_AND_DEVICE const_reverse_iterator rend () const
 Return a constant reverse iterator pointing at the beginning of the array.
 
VECMEM_HOST_AND_DEVICE const_reverse_iterator crend () const
 Return a constant reverse iterator pointing at the beginning of the array.
 
Capacity checking functions
VECMEM_HOST_AND_DEVICE constexpr bool empty () const
 Check whether the array is empty.
 
VECMEM_HOST_AND_DEVICE constexpr size_type size () const
 Return the number of elements in the array.
 
VECMEM_HOST_AND_DEVICE constexpr size_type max_size () const
 Return the maximum (fixed) number of elements in the array.
 

Detailed Description

template<typename T, std::size_t N>
class vecmem::device_array< T, N >

Class mimicking a host-filled std::array in "device code".

Unlike vecmem::array, its size must be defined at compile time. Since for arrays whose size is defined at runtime, one can use vecmem::device_vector instead.


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