Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t > Class Template Reference

Dynamic storage with view semantics and contiguous access. More...

#include <Stokhos_ViewStorage.hpp>

Classes

struct  apply
 Turn ViewStorage into a meta-function class usable with mpl::apply. More...
 

Public Types

typedef ordinal_t ordinal_type
 
typedef value_t value_type
 
typedef device_t execution_space
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 

Public Member Functions

KOKKOS_INLINE_FUNCTION ViewStorage (const error_storage_type_is_not_allocateable &z=error_storage_type_is_not_allocateable(), const value_type &x=value_type(0))
 Constructor to satisfy Sacado::MP::Vector, disabled via error type.
 
KOKKOS_INLINE_FUNCTION ViewStorage (pointer v, const ordinal_type &arg_size=0, const ordinal_type &arg_stride=0)
 Constructor.
 
KOKKOS_INLINE_FUNCTION ViewStorage (const ordinal_type &sz, const value_type *x)
 Constructor from array.
 
KOKKOS_INLINE_FUNCTION ViewStorage (const ordinal_type &sz, pointer v, bool owned)
 Constructor for creating a view.
 
KOKKOS_INLINE_FUNCTION ViewStorage (const ViewStorage &s)
 Constructor.
 
KOKKOS_INLINE_FUNCTION ViewStorage (const ViewStorage &s, const ordinal_type &arg_begin, const ordinal_type &arg_end)
 
KOKKOS_INLINE_FUNCTION ~ViewStorage ()
 Destructor.
 
KOKKOS_INLINE_FUNCTION void init (const_reference v)
 Initialize values to a constant value.
 
KOKKOS_INLINE_FUNCTION void init (const_pointer v, const ordinal_type &sz=0)
 Initialize values to an array of values.
 
KOKKOS_INLINE_FUNCTION void load (pointer v)
 Load values to an array of values.
 
KOKKOS_INLINE_FUNCTION void resize (ordinal_type s)
 Resize function disabled.
 
KOKKOS_INLINE_FUNCTION void shallowReset (pointer v, const error_storage_type_is_not_resizeable &, const error_storage_type_is_not_resizeable &, const bool owned)
 Reset function disabled.
 
KOKKOS_INLINE_FUNCTION ordinal_type size () const
 Return size.
 
KOKKOS_INLINE_FUNCTION reference operator[] (const ordinal_type &i) const
 Coefficient access (avoid if possible)
 
template<int i>
KOKKOS_INLINE_FUNCTION reference getCoeff ()
 
template<int i>
KOKKOS_INLINE_FUNCTION const_reference getCoeff () const
 
KOKKOS_INLINE_FUNCTION const_pointer coeff () const
 Get coefficients.
 
KOKKOS_INLINE_FUNCTION pointer coeff ()
 Get coefficients.
 

Static Public Attributes

static const bool is_static = static_length != 0
 
static const int static_size = static_length
 
static const bool supports_reset = false
 
static const bool supports_resize = ! is_static
 
static const bool supports_view = true
 

Private Types

enum  { stride_one = 1 == static_stride }
 

Private Member Functions

KOKKOS_INLINE_FUNCTION ViewStorageoperator= (const ViewStorage &)
 Assignment operator.
 

Private Attributes

const pointer coeff_
 Coefficient values.
 
const Kokkos::Impl::integral_nonzero_constant< ordinal_t, static_length > size_
 Size of array.
 
const Kokkos::Impl::integral_nonzero_constant< ordinal_t, static_stride > stride_
 Stride of array.
 

Detailed Description

template<typename ordinal_t, typename value_t, unsigned static_length, unsigned static_stride, typename device_t>
class Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >

Dynamic storage with view semantics and contiguous access.

Definition at line 65 of file Stokhos_ViewStorage.hpp.

Member Typedef Documentation

◆ ordinal_type

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
typedef ordinal_t Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::ordinal_type

Definition at line 77 of file Stokhos_ViewStorage.hpp.

◆ value_type

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
typedef value_t Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::value_type

Definition at line 78 of file Stokhos_ViewStorage.hpp.

◆ execution_space

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
typedef device_t Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::execution_space

Definition at line 79 of file Stokhos_ViewStorage.hpp.

◆ reference

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
typedef value_type& Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::reference

Definition at line 80 of file Stokhos_ViewStorage.hpp.

◆ const_reference

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
typedef const value_type& Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::const_reference

Definition at line 81 of file Stokhos_ViewStorage.hpp.

◆ pointer

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
typedef value_type* Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::pointer

Definition at line 82 of file Stokhos_ViewStorage.hpp.

◆ const_pointer

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
typedef const value_type* Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::const_pointer

Definition at line 83 of file Stokhos_ViewStorage.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
anonymous enum
private
Enumerator
stride_one 

Definition at line 68 of file Stokhos_ViewStorage.hpp.

Constructor & Destructor Documentation

◆ ViewStorage() [1/6]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::ViewStorage ( const error_storage_type_is_not_allocateable & z = error_storage_type_is_not_allocateable(),
const value_type & x = value_type(0) )

Constructor to satisfy Sacado::MP::Vector, disabled via error type.

◆ ViewStorage() [2/6]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::ViewStorage ( pointer v,
const ordinal_type & arg_size = 0,
const ordinal_type & arg_stride = 0 )
inline

Constructor.

Definition at line 100 of file Stokhos_ViewStorage.hpp.

◆ ViewStorage() [3/6]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::ViewStorage ( const ordinal_type & sz,
const value_type * x )
inline

Constructor from array.

Definition at line 107 of file Stokhos_ViewStorage.hpp.

◆ ViewStorage() [4/6]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::ViewStorage ( const ordinal_type & sz,
pointer v,
bool owned )
inline

Constructor for creating a view.

Definition at line 111 of file Stokhos_ViewStorage.hpp.

◆ ViewStorage() [5/6]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::ViewStorage ( const ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t > & s)
inline

Constructor.

Definition at line 116 of file Stokhos_ViewStorage.hpp.

◆ ViewStorage() [6/6]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::ViewStorage ( const ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t > & s,
const ordinal_type & arg_begin,
const ordinal_type & arg_end )
inline

Definition at line 120 of file Stokhos_ViewStorage.hpp.

◆ ~ViewStorage()

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::~ViewStorage ( )
inline

Destructor.

Definition at line 128 of file Stokhos_ViewStorage.hpp.

Member Function Documentation

◆ operator=()

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION ViewStorage & Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::operator= ( const ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t > & )
private

Assignment operator.

◆ init() [1/2]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION void Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::init ( const_reference v)
inline

Initialize values to a constant value.

Definition at line 138 of file Stokhos_ViewStorage.hpp.

◆ init() [2/2]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION void Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::init ( const_pointer v,
const ordinal_type & sz = 0 )
inline

Initialize values to an array of values.

Definition at line 151 of file Stokhos_ViewStorage.hpp.

◆ load()

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION void Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::load ( pointer v)
inline

Load values to an array of values.

Definition at line 163 of file Stokhos_ViewStorage.hpp.

◆ resize()

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION void Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::resize ( ordinal_type s)
inline

Resize function disabled.

Definition at line 174 of file Stokhos_ViewStorage.hpp.

◆ shallowReset()

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION void Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::shallowReset ( pointer v,
const error_storage_type_is_not_resizeable & ,
const error_storage_type_is_not_resizeable & ,
const bool owned )

Reset function disabled.

◆ size()

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION ordinal_type Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::size ( ) const
inline

Return size.

Definition at line 186 of file Stokhos_ViewStorage.hpp.

◆ operator[]()

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION reference Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::operator[] ( const ordinal_type & i) const
inline

Coefficient access (avoid if possible)

Definition at line 190 of file Stokhos_ViewStorage.hpp.

◆ getCoeff() [1/2]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
template<int i>
KOKKOS_INLINE_FUNCTION reference Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::getCoeff ( )
inline

Definition at line 197 of file Stokhos_ViewStorage.hpp.

◆ getCoeff() [2/2]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
template<int i>
KOKKOS_INLINE_FUNCTION const_reference Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::getCoeff ( ) const
inline

Definition at line 201 of file Stokhos_ViewStorage.hpp.

◆ coeff() [1/2]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION const_pointer Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::coeff ( ) const
inline

Get coefficients.

Definition at line 205 of file Stokhos_ViewStorage.hpp.

◆ coeff() [2/2]

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
KOKKOS_INLINE_FUNCTION pointer Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::coeff ( )
inline

Get coefficients.

Definition at line 209 of file Stokhos_ViewStorage.hpp.

Member Data Documentation

◆ is_static

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
const bool Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::is_static = static_length != 0
static

Definition at line 71 of file Stokhos_ViewStorage.hpp.

◆ static_size

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
const int Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::static_size = static_length
static

Definition at line 72 of file Stokhos_ViewStorage.hpp.

◆ supports_reset

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
const bool Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::supports_reset = false
static

Definition at line 73 of file Stokhos_ViewStorage.hpp.

◆ supports_resize

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
const bool Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::supports_resize = ! is_static
static

Definition at line 74 of file Stokhos_ViewStorage.hpp.

◆ supports_view

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
const bool Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::supports_view = true
static

Definition at line 75 of file Stokhos_ViewStorage.hpp.

◆ coeff_

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
const pointer Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::coeff_
private

Coefficient values.

Definition at line 214 of file Stokhos_ViewStorage.hpp.

◆ size_

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
const Kokkos::Impl::integral_nonzero_constant< ordinal_t , static_length > Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::size_
private

Size of array.

Definition at line 217 of file Stokhos_ViewStorage.hpp.

◆ stride_

template<typename ordinal_t , typename value_t , unsigned static_length, unsigned static_stride, typename device_t >
const Kokkos::Impl::integral_nonzero_constant< ordinal_t , static_stride > Stokhos::ViewStorage< ordinal_t, value_t, static_length, static_stride, device_t >::stride_
private

Stride of array.

Definition at line 220 of file Stokhos_ViewStorage.hpp.


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