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);
66template<
typename Store>
72 maximum_dimension =
static_cast<Index>(std::numeric_limits<Index>::digits);
74 assert(Store::IS_DYNAMIC ==
true);
76 if (dimension > maximum_dimension) {
77 MT_ERROR_EXIT(
"Requested dimension exceeds maximum allowed: %d", dimension);
82template<Index D, Index O>
229template<Index N, Index P>
251template<Index N, Index P>
273template<Index N, Index P>
320template<
typename T, Index N>
389#pragma GCC diagnostic push
390#pragma GCC diagnostic ignored "-Warray-bounds"
392#pragma GCC diagnostic pop
403#pragma GCC diagnostic push
404#pragma GCC diagnostic ignored "-Warray-bounds"
406#pragma GCC diagnostic pop
426 assert(number_entries <= N);
427 size_ = number_entries;
586 if (number_entries !=
size_) {
589 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()
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.