8#include "tensor_impl.hpp"
15template <
class Q, 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();
65 if (natural_ids[0] < Q::value) {
76 return std::numeric_limits<std::size_t>::max();
79 template <
class Tensor,
class Elem,
class Id,
class FunctorType>
81 const FunctorType& access,
85 if (elem.template uid<Id>() == 0) {
87 }
else if (elem.template uid<Id>() == 1) {
88 return -access(tensor, elem);
90 return access(tensor, elem);
94 KOKKOS_FUNCTION
static constexpr std::array<std::size_t,
rank()>
98 std::array<std::size_t,
rank()> ids;
99 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::array< std::size_t, rank()> mem_id_to_canonical_natural_ids(std::size_t mem_id)
static KOKKOS_FUNCTION constexpr std::size_t access_id(std::array< std::size_t, sizeof...(TensorIndex)> const natural_ids)
static constexpr bool is_explicitely_stored_tensor
ddc::DiscreteDomain< TensorIndex... > subindices_domain_t
static KOKKOS_FUNCTION constexpr subindices_domain_t subindices_domain()
static KOKKOS_FUNCTION constexpr Tensor::element_type process_access(const FunctorType &access, Tensor tensor, Elem elem)
static KOKKOS_FUNCTION constexpr std::size_t size()
static KOKKOS_FUNCTION constexpr std::size_t rank()
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 KOKKOS_FUNCTION constexpr std::size_t access_id_to_mem_id(std::size_t access_id)
static constexpr bool is_tensor_index
static KOKKOS_FUNCTION constexpr std::size_t access_size()