8#include "tensor_impl.hpp"
15template <TensorNatIndex... TensorIndex>
26 ddc::DiscreteElement<
TensorIndex...>(ddc::DiscreteElement<TensorIndex>(0)...),
28 ddc::DiscreteVector<TensorIndex>(TensorIndex::size())...));
31 KOKKOS_FUNCTION
static constexpr std::size_t
rank()
33 return (TensorIndex::rank() + ...);
36 KOKKOS_FUNCTION
static constexpr std::size_t
size()
38 return (TensorIndex::size() * ...);
41 KOKKOS_FUNCTION
static constexpr std::size_t
mem_size()
51 KOKKOS_FUNCTION
static constexpr std::size_t
mem_id(
52 std::array<std::size_t,
sizeof...(
TensorIndex)>
const natural_ids)
54 return std::numeric_limits<std::size_t>::max();
57 KOKKOS_FUNCTION
static constexpr std::size_t
access_id(
58 std::array<std::size_t,
sizeof...(
TensorIndex)>
const natural_ids)
60 if (!std::all_of(natural_ids.begin(), natural_ids.end(), [&](
const std::size_t
id) {
61 return id == *natural_ids.begin();
72 return std::numeric_limits<std::size_t>::max();
75 template <
class Tensor,
class Elem,
class Id,
class FunctorType>
77 const FunctorType& access,
81 if (elem.template uid<Id>() == 0) {
84 return access(tensor, elem);
88 KOKKOS_FUNCTION
static constexpr std::array<std::size_t,
rank()>
92 std::array<std::size_t,
rank()> ids;
93 for (
auto i = ids.begin(); i < ids.end(); ++i) {
Tensor(ddc::Chunk< ElementType, SupportType, Allocator >) -> Tensor< ElementType, SupportType, Kokkos::layout_right, typename Allocator::memory_space >
The top-level namespace of SimiLie.
static KOKKOS_FUNCTION constexpr std::size_t size()
static KOKKOS_FUNCTION constexpr Tensor::element_type process_access(const FunctorType &access, Tensor tensor, Elem elem)
static KOKKOS_FUNCTION constexpr std::array< std::size_t, rank()> mem_id_to_canonical_natural_ids(std::size_t mem_id)
static KOKKOS_FUNCTION constexpr std::size_t rank()
static constexpr bool is_tensor_index
static KOKKOS_FUNCTION constexpr std::size_t access_id(std::array< std::size_t, sizeof...(TensorIndex)> const natural_ids)
ddc::DiscreteDomain< TensorIndex... > subindices_domain_t
static KOKKOS_FUNCTION constexpr subindices_domain_t subindices_domain()
static KOKKOS_FUNCTION constexpr std::size_t access_id_to_mem_id(std::size_t access_id)
static KOKKOS_FUNCTION constexpr std::size_t mem_id(std::array< std::size_t, sizeof...(TensorIndex)> const natural_ids)
static KOKKOS_FUNCTION constexpr std::size_t mem_size()
static constexpr bool is_explicitely_stored_tensor
static KOKKOS_FUNCTION constexpr std::size_t access_size()