DDC 0.5.0
Loading...
Searching...
No Matches
ddc::Chunk< ElementType, SupportType, Allocator > Class Template Reference

#include <chunk.hpp>

Inheritance diagram for ddc::Chunk< ElementType, SupportType, Allocator >:
Inheritance graph
Collaboration diagram for ddc::Chunk< ElementType, SupportType, Allocator >:
Collaboration graph

Public Types

using span_type = ChunkSpan< ElementType, SupportType, Kokkos::layout_right, typename Allocator::memory_space >
 type of a span of this full chunk
 
using view_type = ChunkSpan< ElementType const, SupportType, Kokkos::layout_right, typename Allocator::memory_space >
 type of a view of this full chunk
 
using allocation_mdspan_type = typename base_type::allocation_mdspan_type
 The dereferenceable part of the co-domain but with indexing starting at 0.
 
using const_allocation_mdspan_type = typename base_type::const_allocation_mdspan_type
 
using discrete_domain_type = typename base_type::discrete_domain_type
 
using memory_space = typename Allocator::memory_space
 
using discrete_element_type = typename base_type::discrete_element_type
 
using extents_type = typename base_type::extents_type
 
using layout_type = typename base_type::layout_type
 
using mapping_type = typename base_type::mapping_type
 
using element_type = typename base_type::element_type
 
using value_type = typename base_type::value_type
 
using size_type = typename base_type::size_type
 
using data_handle_type = typename base_type::data_handle_type
 
using reference = typename base_type::reference
 
- Public Types inherited from ddc::ChunkCommon< ElementType, SupportType, Kokkos::layout_right >
using discrete_domain_type = SupportType
 
using allocation_mdspan_type = Kokkos::mdspan< ElementType, Kokkos::dextents< std::size_t, SupportType::rank()>, Kokkos::layout_right >
 The dereferenceable part of the co-domain but with a different domain, starting at 0.
 
using const_allocation_mdspan_type = Kokkos::mdspan< const ElementType, Kokkos::dextents< std::size_t, SupportType::rank()>, Kokkos::layout_right >
 
using discrete_element_type = typename discrete_domain_type::discrete_element_type
 
using extents_type = typename allocation_mdspan_type::extents_type
 
using layout_type = typename allocation_mdspan_type::layout_type
 
using accessor_type = typename allocation_mdspan_type::accessor_type
 
using mapping_type = typename allocation_mdspan_type::mapping_type
 
using element_type = typename allocation_mdspan_type::element_type
 
using value_type = typename allocation_mdspan_type::value_type
 
using size_type = typename allocation_mdspan_type::size_type
 
using data_handle_type = typename allocation_mdspan_type::data_handle_type
 
using reference = typename allocation_mdspan_type::reference
 

Public Member Functions

 Chunk ()=default
 Empty Chunk.
 
 Chunk (std::string const &label, SupportType const &domain, Allocator allocator=Allocator())
 Construct a labeled Chunk on a domain with uninitialized values.
 
 Chunk (SupportType const &domain, Allocator allocator=Allocator())
 Construct a Chunk on a domain with uninitialized values.
 
 Chunk (Chunk const &other)=delete
 Deleted: use deepcopy instead.
 
 Chunk (Chunk &&other) noexcept
 Constructs a new Chunk by move.
 
 ~Chunk () noexcept
 
Chunkoperator= (Chunk const &other)=delete
 Deleted: use deepcopy instead.
 
Chunkoperator= (Chunk &&other) noexcept
 Move-assigns a new value to this field.
 
template<class... QueryDDims>
auto operator[] (DiscreteElement< QueryDDims... > const &slice_spec) const
 Slice out some dimensions.
 
template<class... QueryDDims>
auto operator[] (DiscreteElement< QueryDDims... > const &slice_spec)
 Slice out some dimensions.
 
template<class... DElems>
element_type constoperator() (DElems const &... delems) const noexcept
 Element access using a list of DiscreteElement.
 
template<class... DElems>
element_typeoperator() (DElems const &... delems) noexcept
 Element access using a list of DiscreteElement.
 
char constlabel () const
 Returns the label of the Chunk.
 
ElementType constdata_handle () const
 Access to the underlying allocation pointer.
 
ElementTypedata_handle ()
 Access to the underlying allocation pointer.
 
const_allocation_mdspan_type allocation_mdspan () const
 Provide a mdspan on the memory allocation.
 
allocation_mdspan_type allocation_mdspan ()
 Provide a mdspan on the memory allocation.
 
auto allocation_kokkos_view ()
 Provide an unmanaged Kokkos::View on the memory allocation.
 
auto allocation_kokkos_view () const
 Provide an unmanaged Kokkos::View on the memory allocation.
 
view_type span_cview () const
 
view_type span_view () const
 
span_type span_view ()
 
- Public Member Functions inherited from ddc::ChunkCommon< ElementType, SupportType, Kokkos::layout_right >
KOKKOS_FUNCTION constexpr accessor_type accessor () const
 
KOKKOS_FUNCTION constexpr SupportType::discrete_vector_type extents () const noexcept
 
KOKKOS_FUNCTION constexpr size_type extent () const noexcept
 
KOKKOS_FUNCTION constexpr size_type size () const noexcept
 
KOKKOS_FUNCTION constexpr mapping_type mapping () const noexcept
 
KOKKOS_FUNCTION constexpr bool is_unique () const noexcept
 
KOKKOS_FUNCTION constexpr bool is_exhaustive () const noexcept
 
KOKKOS_FUNCTION constexpr bool is_strided () const noexcept
 
KOKKOS_FUNCTION constexpr size_type stride () const
 
KOKKOS_FUNCTION constexpr SupportType domain () const noexcept
 Provide access to the domain on which this chunk is defined.
 
KOKKOS_FUNCTION constexpr DiscreteDomain< QueryDDims... > domain () const noexcept
 Provide access to the domain on which this chunk is defined.
 

Protected Types

using base_type = ChunkCommon< ElementType, SupportType, Kokkos::layout_right >
 

Friends

template<class , class , class >
class Chunk
 

Additional Inherited Members

- Static Public Member Functions inherited from ddc::ChunkCommon< ElementType, SupportType, Kokkos::layout_right >
static KOKKOS_FUNCTION constexpr int rank () noexcept
 
static KOKKOS_FUNCTION constexpr int rank_dynamic () noexcept
 
static KOKKOS_FUNCTION constexpr size_type static_extent (std::size_t r) noexcept
 
static KOKKOS_FUNCTION constexpr bool is_always_unique () noexcept
 
static KOKKOS_FUNCTION constexpr bool is_always_exhaustive () noexcept
 
static KOKKOS_FUNCTION constexpr bool is_always_strided () noexcept
 
- Protected Member Functions inherited from ddc::ChunkCommon< ElementType, SupportType, Kokkos::layout_right >
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon ()=default
 Empty ChunkCommon.
 
KOKKOS_FUNCTION constexpr ChunkCommon (allocation_mdspan_type allocation_mdspan, SupportType const &domain) noexcept
 Constructs a new ChunkCommon from scratch.
 
KOKKOS_FUNCTION constexpr ChunkCommon (ElementType *ptr, SupportType const &domain)
 Constructs a new ChunkCommon from scratch.
 
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon (ChunkCommon const &other)=default
 Constructs a new ChunkCommon by copy, yields a new view to the same data.
 
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon (ChunkCommon &&other) noexcept=default
 Constructs a new ChunkCommon by move.
 
KOKKOS_DEFAULTED_FUNCTION ~ChunkCommon () noexcept=default
 
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommonoperator= (ChunkCommon const &other)=default
 Copy-assigns a new value to this ChunkCommon, yields a new view to the same data.
 
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommonoperator= (ChunkCommon &&other) noexcept=default
 Move-assigns a new value to this ChunkCommon.
 
KOKKOS_FUNCTION constexpr ElementType * data_handle () const
 Access to the underlying allocation pointer.
 
KOKKOS_FUNCTION constexpr allocation_mdspan_type allocation_mdspan () const
 Provide a modifiable view of the data.
 
- Protected Attributes inherited from ddc::ChunkCommon< ElementType, SupportType, Kokkos::layout_right >
allocation_mdspan_type m_allocation_mdspan
 The raw view of the data.
 
SupportType m_domain
 The mesh on which this chunk is defined.
 

Detailed Description

template<class ElementType, class SupportType, class Allocator>
class ddc::Chunk< ElementType, SupportType, Allocator >

Definition at line 305 of file chunk.hpp.

Member Typedef Documentation

◆ base_type

Definition at line 308 of file chunk.hpp.

◆ span_type

using ddc::Chunk< ElementType, SupportType, Allocator >::span_type = ChunkSpan< ElementType, SupportType, Kokkos::layout_right, typename Allocator::memory_space>

type of a span of this full chunk

Definition at line 312 of file chunk.hpp.

◆ view_type

using ddc::Chunk< ElementType, SupportType, Allocator >::view_type = ChunkSpan< ElementType const, SupportType, Kokkos::layout_right, typename Allocator::memory_space>

type of a view of this full chunk

Definition at line 319 of file chunk.hpp.

◆ allocation_mdspan_type

The dereferenceable part of the co-domain but with indexing starting at 0.

Definition at line 326 of file chunk.hpp.

◆ const_allocation_mdspan_type

◆ discrete_domain_type

◆ memory_space

using ddc::Chunk< ElementType, SupportType, Allocator >::memory_space = typename Allocator::memory_space

Definition at line 332 of file chunk.hpp.

◆ discrete_element_type

◆ extents_type

◆ layout_type

◆ mapping_type

◆ element_type

◆ value_type

◆ size_type

◆ data_handle_type

◆ reference

Constructor & Destructor Documentation

◆ Chunk() [1/5]

◆ Chunk() [2/5]

ddc::Chunk< ElementType, SupportType, Allocator >::Chunk ( std::string const label,
SupportType const domain,
Allocator  allocator = Allocator() 
)
inlineexplicit

Construct a labeled Chunk on a domain with uninitialized values.

Definition at line 365 of file chunk.hpp.

◆ Chunk() [3/5]

ddc::Chunk< ElementType, SupportType, Allocator >::Chunk ( SupportType const domain,
Allocator  allocator = Allocator() 
)
inlineexplicit

Construct a Chunk on a domain with uninitialized values.

Definition at line 376 of file chunk.hpp.

◆ Chunk() [4/5]

Deleted: use deepcopy instead.

◆ Chunk() [5/5]

Constructs a new Chunk by move.

Parameters
otherthe Chunk to move

Definition at line 387 of file chunk.hpp.

◆ ~Chunk()

Definition at line 396 of file chunk.hpp.

Member Function Documentation

◆ operator=() [1/2]

Deleted: use deepcopy instead.

◆ operator=() [2/2]

Move-assigns a new value to this field.

Parameters
otherthe Chunk to move
Returns
*this

Definition at line 410 of file chunk.hpp.

◆ operator[]() [1/2]

template<class... QueryDDims>
auto ddc::Chunk< ElementType, SupportType, Allocator >::operator[] ( DiscreteElement< QueryDDims... > const slice_spec) const
inline

Slice out some dimensions.

Definition at line 429 of file chunk.hpp.

◆ operator[]() [2/2]

template<class... QueryDDims>
auto ddc::Chunk< ElementType, SupportType, Allocator >::operator[] ( DiscreteElement< QueryDDims... > const slice_spec)
inline

Slice out some dimensions.

Definition at line 436 of file chunk.hpp.

◆ operator()() [1/2]

template<class... DElems>
element_type const & ddc::Chunk< ElementType, SupportType, Allocator >::operator() ( DElems const &...  delems) const
inlinenoexcept

Element access using a list of DiscreteElement.

Parameters
delemsdiscrete coordinates
Returns
const-reference to this element

Definition at line 446 of file chunk.hpp.

◆ operator()() [2/2]

template<class... DElems>
element_type & ddc::Chunk< ElementType, SupportType, Allocator >::operator() ( DElems const &...  delems)
inlinenoexcept

Element access using a list of DiscreteElement.

Parameters
delemsdiscrete coordinates
Returns
reference to this element

Definition at line 463 of file chunk.hpp.

◆ label()

Returns the label of the Chunk.

Returns
c-string

Definition at line 478 of file chunk.hpp.

◆ data_handle() [1/2]

Access to the underlying allocation pointer.

Returns
read-only allocation pointer

Definition at line 486 of file chunk.hpp.

◆ data_handle() [2/2]

Access to the underlying allocation pointer.

Returns
allocation pointer

Definition at line 494 of file chunk.hpp.

◆ allocation_mdspan() [1/2]

Provide a mdspan on the memory allocation.

Returns
read-only allocation mdspan

Definition at line 502 of file chunk.hpp.

◆ allocation_mdspan() [2/2]

Provide a mdspan on the memory allocation.

Returns
allocation mdspan

Definition at line 510 of file chunk.hpp.

◆ allocation_kokkos_view() [1/2]

auto ddc::Chunk< ElementType, SupportType, Allocator >::allocation_kokkos_view ( )
inline

Provide an unmanaged Kokkos::View on the memory allocation.

Returns
allocation Kokkos::View

Definition at line 518 of file chunk.hpp.

◆ allocation_kokkos_view() [2/2]

auto ddc::Chunk< ElementType, SupportType, Allocator >::allocation_kokkos_view ( ) const
inline

Provide an unmanaged Kokkos::View on the memory allocation.

Returns
read-only allocation Kokkos::View

Definition at line 534 of file chunk.hpp.

◆ span_cview()

Definition at line 547 of file chunk.hpp.

◆ span_view() [1/2]

Definition at line 552 of file chunk.hpp.

◆ span_view() [2/2]

Definition at line 557 of file chunk.hpp.

Friends And Related Symbol Documentation

◆ Chunk

Definition at line 353 of file chunk.hpp.


The documentation for this class was generated from the following file: