21class OwningTensor<Tensor<ElementType, DomainType, LayoutStridedPolicy, MemorySpace>, Storage>
22 :
public Tensor<ElementType, DomainType, LayoutStridedPolicy, MemorySpace>
24 using Base = Tensor<ElementType, DomainType, LayoutStridedPolicy, MemorySpace>;
28 KOKKOS_FUNCTION
void rebind_to_owned_storage(DomainType
const& domain)
30 static_cast<Base&
>(*this)
31 = Base(ddc::ChunkSpan<
35 MemorySpace>(m_storage.data(), domain));
39 KOKKOS_FUNCTION
explicit OwningTensor(Base tensor, Storage&& storage)
41 , m_storage(std::move(storage))
43 rebind_to_owned_storage(tensor.domain());
47 : Base(static_cast<Base const&>(other))
48 , m_storage(other.m_storage)
50 rebind_to_owned_storage(other.domain());
54 : Base(static_cast<Base&&>(other))
55 , m_storage(std::move(other.m_storage))
57 rebind_to_owned_storage(other.domain());
62 m_storage = other.m_storage;
63 rebind_to_owned_storage(other.domain());
69 m_storage = std::move(other.m_storage);
70 rebind_to_owned_storage(other.domain());
74 KOKKOS_FUNCTION Storage&
storage() noexcept
79 KOKKOS_FUNCTION Storage
const&
storage() const noexcept
KOKKOS_FUNCTION OwningTensor & operator=(OwningTensor const &other)
KOKKOS_FUNCTION OwningTensor(Base tensor, Storage &&storage)
KOKKOS_FUNCTION OwningTensor & operator=(OwningTensor &&other)
KOKKOS_FUNCTION Storage const & storage() const noexcept
KOKKOS_FUNCTION OwningTensor(OwningTensor const &other)