10#include "Kokkos_Macros.hpp"
11#if !defined(MiniTensor_Storage_h)
12#define MiniTensor_Storage_h
22template<Index N, Index C>
45#if defined(KOKKOS_ENABLE_CUDA)
52 static_cast<Index>(std::numeric_limits<Index>::digits);
82 return dimension <= N ? dimension : N;
89template<
typename Store>
95 maximum_dimension =
static_cast<Index>(std::numeric_limits<Index>::digits);
97 assert(Store::IS_DYNAMIC ==
true);
99 if (dimension > maximum_dimension) {
100 MT_ERROR_EXIT(
"Requested dimension exceeds maximum allowed: %d", dimension);
105template<Index D, Index O>
252template<Index N, Index P>
274template<Index N, Index P>
296template<Index N, Index P>
343template<
typename T, Index N>
412#pragma GCC diagnostic push
413#pragma GCC diagnostic ignored "-Warray-bounds"
415#pragma GCC diagnostic pop
426#pragma GCC diagnostic push
427#pragma GCC diagnostic ignored "-Warray-bounds"
429#pragma GCC diagnostic pop
454 assert(number_entries <= N);
455 size_ = number_entries;
614 if (number_entries !=
size_) {
617 size_ = number_entries;
#define KOKKOS_INLINE_FUNCTION
#define MT_ERROR_EXIT(...)
T const * const_pointer_type
static constexpr Index value
KOKKOS_INLINE_FUNCTION T const & operator[](Index const i) const
KOKKOS_INLINE_FUNCTION pointer_type get_pointer()
KOKKOS_INLINE_FUNCTION T & operator[](Index const i)
Storage< T, DYNAMIC > & operator=(Storage< T, DYNAMIC > const &s)=delete
static constexpr Index value
KOKKOS_INLINE_FUNCTION const_pointer_type get_const_pointer() const
KOKKOS_INLINE_FUNCTION Storage()
KOKKOS_INLINE_FUNCTION constexpr Index bound_dimension(Index const dimension)
static constexpr bool IS_STATIC
KOKKOS_INLINE_FUNCTION void resize(Index const number_entries)
T const * const_pointer_type
static constexpr Index value
static constexpr Index maximum_dimension
static constexpr Index value
static constexpr Index value
static constexpr Index value
static constexpr Index value
KOKKOS_INLINE_FUNCTION ~Storage()
KOKKOS_INLINE_FUNCTION pointer_type get_pointer()
KOKKOS_INLINE_FUNCTION Index size() const
KOKKOS_INLINE_FUNCTION void clear()
KOKKOS_INLINE_FUNCTION ~Storage()
static constexpr bool IS_DYNAMIC
static KOKKOS_INLINE_FUNCTION constexpr Index static_size()
static KOKKOS_INLINE_FUNCTION constexpr Index static_size()
void check_dynamic(Index const dimension)
static constexpr Index value
KOKKOS_INLINE_FUNCTION T const & operator[](Index const i) const
Storage< T, N > & operator=(Storage< T, N > const &s)=delete
Storage(Storage< T, N > const &s)=delete
KOKKOS_INLINE_FUNCTION T & operator[](Index const i)
T const & const_reference_type
KOKKOS_INLINE_FUNCTION Index size() const
KOKKOS_INLINE_FUNCTION Storage(Index const number_entries)
Storage(Storage< T, DYNAMIC > const &s)=delete
T const & const_reference_type
KOKKOS_INLINE_FUNCTION void clear()
KOKKOS_INLINE_FUNCTION void resize(Index const number_entries)
KOKKOS_INLINE_FUNCTION const_pointer_type get_const_pointer() const
KOKKOS_INLINE_FUNCTION Storage(Index const number_entries)
KOKKOS_INLINE_FUNCTION Storage()
uint32_t Index
Indexing type.
constexpr Index DYNAMIC
Indicator for dynamic storage.
Manipulation of static and dynamic dimensions.
Set to constant value if not dynamic.
Integer power template restricted to orders defined below.
Integer square for manipulations between 2nd and 4rd-order tensors.