https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Moose::Kokkos::JaggedArrayInnerSlice< T > Class Template Reference

A one-dimensional view of an inner array along one dimension, with the indices of all other dimensions fixed. More...

#include <KokkosJaggedArray.h>

Public Member Functions

KOKKOS_FUNCTION JaggedArrayInnerSlice (T *data, const unsigned int stride, const unsigned int size)
 Constructor.
 
KOKKOS_FUNCTION unsigned int size () const
 Get the number of entries.
 
KOKKOS_FUNCTION T & operator[] (const unsigned int i) const
 Get an entry.
 

Private Attributes

T *const _data
 Pointer to the first entry.
 
const unsigned int _stride
 Distance between consecutive entries.
 
const unsigned int _size
 Number of entries.
 

Detailed Description

template<typename T>
class Moose::Kokkos::JaggedArrayInnerSlice< T >

A one-dimensional view of an inner array along one dimension, with the indices of all other dimensions fixed.

Entries alias the entries of the inner array.

Template Parameters
TThe data type

Definition at line 153 of file KokkosJaggedArray.h.

Constructor & Destructor Documentation

◆ JaggedArrayInnerSlice()

template<typename T >
KOKKOS_FUNCTION Moose::Kokkos::JaggedArrayInnerSlice< T >::JaggedArrayInnerSlice ( T *  data,
const unsigned int  stride,
const unsigned int  size 
)
inline

Constructor.

Parameters
dataThe pointer to the first entry of the view
strideThe distance between consecutive entries of the view
sizeThe number of entries of the view

Definition at line 163 of file KokkosJaggedArray.h.

164 : _data(data), _stride(stride), _size(size)
165 {
166 }
const unsigned int _stride
Distance between consecutive entries.
KOKKOS_FUNCTION unsigned int size() const
Get the number of entries.
T *const _data
Pointer to the first entry.
const unsigned int _size
Number of entries.

Member Function Documentation

◆ operator[]()

template<typename T >
KOKKOS_FUNCTION T & Moose::Kokkos::JaggedArrayInnerSlice< T >::operator[] ( const unsigned int  i) const
inline

Get an entry.

Parameters
iThe entry index

Definition at line 177 of file KokkosJaggedArray.h.

178 {
179 KOKKOS_ASSERT(i < _size);
180
181 return _data[i * _stride];
182 }

◆ size()

template<typename T >
KOKKOS_FUNCTION unsigned int Moose::Kokkos::JaggedArrayInnerSlice< T >::size ( ) const
inline

Get the number of entries.

Returns
The number of entries

Definition at line 172 of file KokkosJaggedArray.h.

172{ return _size; }

Member Data Documentation

◆ _data

template<typename T >
T* const Moose::Kokkos::JaggedArrayInnerSlice< T >::_data
private

Pointer to the first entry.

Definition at line 188 of file KokkosJaggedArray.h.

Referenced by Moose::Kokkos::JaggedArrayInnerSlice< T >::operator[]().

◆ _size

template<typename T >
const unsigned int Moose::Kokkos::JaggedArrayInnerSlice< T >::_size
private

◆ _stride

template<typename T >
const unsigned int Moose::Kokkos::JaggedArrayInnerSlice< T >::_stride
private

Distance between consecutive entries.

Definition at line 192 of file KokkosJaggedArray.h.

Referenced by Moose::Kokkos::JaggedArrayInnerSlice< T >::operator[]().


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