DDC 0.7.0
Loading...
Searching...
No Matches
ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy > Class Template Reference

#include <chunk_common.hpp>

Inheritance diagram for ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >:
Inheritance graph
Collaboration diagram for ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >:
Collaboration graph

Public Types

using discrete_domain_type = DiscreteDomain< DDims... >
 
using allocation_mdspan_type = Kokkos::mdspan< ElementType, Kokkos::dextents< std::size_t, sizeof...(DDims)>, LayoutStridedPolicy >
 The dereferenceable part of the co-domain but with a different domain, starting at 0.
 
using const_allocation_mdspan_type = Kokkos::mdspan< ElementType const, Kokkos::dextents< std::size_t, sizeof...(DDims)>, LayoutStridedPolicy >
 
using discrete_element_type = typename discrete_domain_type::discrete_element_type
 
using discrete_vector_type = typename discrete_domain_type::discrete_vector_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

KOKKOS_FUNCTION constexpr accessor_type accessor () const
 
KOKKOS_FUNCTION constexpr DiscreteVector< DDims... > extents () const noexcept
 
template<class QueryDDim >
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
 
template<class QueryDDim >
KOKKOS_FUNCTION constexpr size_type stride () const
 
KOKKOS_FUNCTION constexpr discrete_domain_type domain () const noexcept
 Provide access to the domain on which this chunk is defined.
 
template<class... QueryDDims>
KOKKOS_FUNCTION constexpr DiscreteDomain< QueryDDims... > domain () const noexcept
 Provide access to the domain on which this chunk is defined.
 

Static Public Member Functions

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 Types

using internal_mdspan_type = Kokkos::mdspan< ElementType, Kokkos::dextents< std::size_t, sizeof...(DDims)>, Kokkos::layout_stride >
 the raw mdspan underlying this, with the same indexing (0 might no be dereferenceable)
 

Protected Member Functions

KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon ()=default
 Empty ChunkCommon.
 
KOKKOS_FUNCTION constexpr ChunkCommon (internal_mdspan_type internal_mdspan, discrete_domain_type const &domain) noexcept
 Constructs a new ChunkCommon from scratch.
 
template<class Mapping = mapping_type, std::enable_if_t< std::is_constructible_v< Mapping, extents_type >, int > = 0>
KOKKOS_FUNCTION constexpr ChunkCommon (ElementType *ptr, discrete_domain_type 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 ElementTypedata_handle () const
 Access to the underlying allocation pointer.
 
KOKKOS_FUNCTION constexpr internal_mdspan_type internal_mdspan () const
 Provide a modifiable view of the data.
 
KOKKOS_FUNCTION constexpr allocation_mdspan_type allocation_mdspan () const
 Provide a modifiable view of the data.
 

Protected Attributes

internal_mdspan_type m_internal_mdspan
 The raw view of the data.
 
discrete_domain_type m_domain
 The mesh on which this chunk is defined.
 

Friends

template<class , class , class >
class ChunkCommon
 
template<class , class , class , class >
class ChunkSpan
 
template<class , class , class >
class Chunk
 

Detailed Description

template<class ElementType, class... DDims, class LayoutStridedPolicy>
class ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >

Definition at line 36 of file chunk_common.hpp.

Member Typedef Documentation

◆ internal_mdspan_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::internal_mdspan_type = Kokkos::mdspan< ElementType, Kokkos::dextents<std::size_t, sizeof...(DDims)>, Kokkos::layout_stride>
protected

the raw mdspan underlying this, with the same indexing (0 might no be dereferenceable)

Definition at line 40 of file chunk_common.hpp.

◆ discrete_domain_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::discrete_domain_type = DiscreteDomain<DDims...>

Definition at line 46 of file chunk_common.hpp.

◆ allocation_mdspan_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::allocation_mdspan_type = Kokkos::mdspan< ElementType, Kokkos::dextents<std::size_t, sizeof...(DDims)>, LayoutStridedPolicy>

The dereferenceable part of the co-domain but with a different domain, starting at 0.

Definition at line 49 of file chunk_common.hpp.

◆ const_allocation_mdspan_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::const_allocation_mdspan_type = Kokkos::mdspan< ElementType const, Kokkos::dextents<std::size_t, sizeof...(DDims)>, LayoutStridedPolicy>

Definition at line 54 of file chunk_common.hpp.

◆ discrete_element_type

◆ discrete_vector_type

◆ extents_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::extents_type = typename allocation_mdspan_type::extents_type

Definition at line 63 of file chunk_common.hpp.

◆ layout_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::layout_type = typename allocation_mdspan_type::layout_type

Definition at line 65 of file chunk_common.hpp.

◆ accessor_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::accessor_type = typename allocation_mdspan_type::accessor_type

Definition at line 67 of file chunk_common.hpp.

◆ mapping_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::mapping_type = typename allocation_mdspan_type::mapping_type

Definition at line 69 of file chunk_common.hpp.

◆ element_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::element_type = typename allocation_mdspan_type::element_type

Definition at line 71 of file chunk_common.hpp.

◆ value_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::value_type = typename allocation_mdspan_type::value_type

Definition at line 73 of file chunk_common.hpp.

◆ size_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::size_type = typename allocation_mdspan_type::size_type

Definition at line 75 of file chunk_common.hpp.

◆ data_handle_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::data_handle_type = typename allocation_mdspan_type::data_handle_type

Definition at line 77 of file chunk_common.hpp.

◆ reference

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::reference = typename allocation_mdspan_type::reference

Definition at line 79 of file chunk_common.hpp.

Constructor & Destructor Documentation

◆ ChunkCommon() [1/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_DEFAULTED_FUNCTION constexpr ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( )
constexprprotecteddefault

Empty ChunkCommon.

◆ ChunkCommon() [2/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( internal_mdspan_type  internal_mdspan,
discrete_domain_type const domain 
)
inlineconstexprprotectednoexcept

Constructs a new ChunkCommon from scratch.

Parameters
internal_mdspan
domain

Definition at line 223 of file chunk_common.hpp.

◆ ChunkCommon() [3/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class Mapping = mapping_type, std::enable_if_t< std::is_constructible_v< Mapping, extents_type >, int > = 0>
KOKKOS_FUNCTION constexpr ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( ElementType ptr,
discrete_domain_type const domain 
)
inlineconstexprprotected

Constructs a new ChunkCommon from scratch.

Parameters
ptrthe allocation pointer to the data
domainthe domain that sustains the view

Definition at line 238 of file chunk_common.hpp.

◆ ChunkCommon() [4/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_DEFAULTED_FUNCTION constexpr ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy > const other)
constexprprotecteddefault

Constructs a new ChunkCommon by copy, yields a new view to the same data.

Parameters
otherthe ChunkCommon to copy

◆ ChunkCommon() [5/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_DEFAULTED_FUNCTION constexpr ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy > &&  other)
constexprprotecteddefaultnoexcept

Constructs a new ChunkCommon by move.

Parameters
otherthe ChunkCommon to move

◆ ~ChunkCommon()

Member Function Documentation

◆ rank()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static KOKKOS_FUNCTION constexpr int ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::rank ( )
inlinestaticconstexprnoexcept

Definition at line 101 of file chunk_common.hpp.

◆ rank_dynamic()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static KOKKOS_FUNCTION constexpr int ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::rank_dynamic ( )
inlinestaticconstexprnoexcept

Definition at line 106 of file chunk_common.hpp.

◆ static_extent()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static KOKKOS_FUNCTION constexpr size_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::static_extent ( std::size_t  r)
inlinestaticconstexprnoexcept

Definition at line 111 of file chunk_common.hpp.

◆ is_always_unique()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static KOKKOS_FUNCTION constexpr bool ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_always_unique ( )
inlinestaticconstexprnoexcept

Definition at line 116 of file chunk_common.hpp.

◆ is_always_exhaustive()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static KOKKOS_FUNCTION constexpr bool ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_always_exhaustive ( )
inlinestaticconstexprnoexcept

Definition at line 121 of file chunk_common.hpp.

◆ is_always_strided()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static KOKKOS_FUNCTION constexpr bool ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_always_strided ( )
inlinestaticconstexprnoexcept

Definition at line 126 of file chunk_common.hpp.

◆ accessor()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr accessor_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::accessor ( ) const
inlineconstexpr

Definition at line 151 of file chunk_common.hpp.

◆ extents()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr DiscreteVector< DDims... > ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::extents ( ) const
inlineconstexprnoexcept

Definition at line 156 of file chunk_common.hpp.

◆ extent()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class QueryDDim >
KOKKOS_FUNCTION constexpr size_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::extent ( ) const
inlineconstexprnoexcept

Definition at line 162 of file chunk_common.hpp.

◆ size()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr size_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::size ( ) const
inlineconstexprnoexcept

Definition at line 167 of file chunk_common.hpp.

◆ mapping()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr mapping_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::mapping ( ) const
inlineconstexprnoexcept

Definition at line 172 of file chunk_common.hpp.

◆ is_unique()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr bool ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_unique ( ) const
inlineconstexprnoexcept

Definition at line 177 of file chunk_common.hpp.

◆ is_exhaustive()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr bool ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_exhaustive ( ) const
inlineconstexprnoexcept

Definition at line 182 of file chunk_common.hpp.

◆ is_strided()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr bool ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_strided ( ) const
inlineconstexprnoexcept

Definition at line 187 of file chunk_common.hpp.

◆ stride()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class QueryDDim >
KOKKOS_FUNCTION constexpr size_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::stride ( ) const
inlineconstexpr

Definition at line 193 of file chunk_common.hpp.

◆ domain() [1/2]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr discrete_domain_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::domain ( ) const
inlineconstexprnoexcept

Provide access to the domain on which this chunk is defined.

Returns
the domain on which this chunk is defined

Definition at line 201 of file chunk_common.hpp.

◆ domain() [2/2]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class... QueryDDims>
KOKKOS_FUNCTION constexpr DiscreteDomain< QueryDDims... > ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::domain ( ) const
inlineconstexprnoexcept

Provide access to the domain on which this chunk is defined.

Returns
the domain on which this chunk is defined

Definition at line 210 of file chunk_common.hpp.

◆ operator=() [1/2]

Copy-assigns a new value to this ChunkCommon, yields a new view to the same data.

Parameters
otherthe ChunkCommon to copy
Returns
*this

◆ operator=() [2/2]

Move-assigns a new value to this ChunkCommon.

Parameters
otherthe ChunkCommon to move
Returns
*this

◆ data_handle()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr ElementType * ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::data_handle ( ) const
inlineconstexprprotected

Access to the underlying allocation pointer.

Returns
allocation pointer

Definition at line 274 of file chunk_common.hpp.

◆ internal_mdspan()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr internal_mdspan_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::internal_mdspan ( ) const
inlineconstexprprotected

Provide a modifiable view of the data.

Returns
a modifiable view of the data

Definition at line 286 of file chunk_common.hpp.

◆ allocation_mdspan()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
KOKKOS_FUNCTION constexpr allocation_mdspan_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::allocation_mdspan ( ) const
inlineconstexprprotected

Provide a modifiable view of the data.

Returns
a modifiable view of the data

Definition at line 294 of file chunk_common.hpp.

Friends And Related Symbol Documentation

◆ ChunkCommon

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class , class , class >
friend class ChunkCommon
friend

Definition at line 83 of file chunk_common.hpp.

◆ ChunkSpan

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class , class , class , class >
friend class ChunkSpan
friend

Definition at line 86 of file chunk_common.hpp.

◆ Chunk

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class , class , class >
friend class Chunk
friend

Definition at line 89 of file chunk_common.hpp.

Member Data Documentation

◆ m_internal_mdspan

template<class ElementType , class... DDims, class LayoutStridedPolicy >
internal_mdspan_type ddc::ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::m_internal_mdspan
protected

The raw view of the data.

Definition at line 95 of file chunk_common.hpp.

◆ m_domain

The mesh on which this chunk is defined.

Definition at line 98 of file chunk_common.hpp.


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