DDC 0.0.0

a discrete domain computation library

ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator > Class Template Reference
Inheritance diagram for ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >:
Inheritance graph

Public Types

using span_type
 type of a span of this full chunk
 
using view_type
 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 mdomain_type = typename base_type::mdomain_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 Member Functions

 Chunk ()=default
 Empty Chunk.
 
 Chunk (std::string const &label, mdomain_type const &domain, Allocator allocator=Allocator())
 Construct a labeled Chunk on a domain with uninitialized values.
 
 Chunk (mdomain_type 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)
 Constructs a new Chunk by move.
 
 ~Chunk ()
 
Chunkoperator= (Chunk const &other)=delete
 Deleted: use deepcopy instead.
 
Chunkoperator= (Chunk &&other)
 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... QueryDDims>
auto operator[] (DiscreteDomain< QueryDDims... > const &odomain) const
 Slice out some dimensions.
 
template<class... QueryDDims>
auto operator[] (DiscreteDomain< QueryDDims... > const &odomain)
 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 ()
 

Protected Types

using base_type = ChunkCommon<ElementType, DiscreteDomain<DDims...>, std::experimental::layout_right>
 
using internal_mdspan_type = typename base_type::internal_mdspan_type
 ND memory view.
 

Friends

template<class , class , class >
class Chunk
 

Member Typedef Documentation

◆ base_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::base_type = ChunkCommon<ElementType, DiscreteDomain<DDims...>, std::experimental::layout_right>
protected

◆ internal_mdspan_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::internal_mdspan_type = typename base_type::internal_mdspan_type
protected

ND memory view.

◆ span_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::span_type
Initial value:
DiscreteDomain<DDims...>,
std::experimental::layout_right,
typename Allocator::memory_space>
constexpr bool enable_chunk
Definition chunk_traits.hpp:16
ChunkSpan(KokkosView const &view, DiscreteDomain< DDims... > domain) -> ChunkSpan< detail::kokkos_to_mdspan_element_t< typename KokkosView::data_type >, DiscreteDomain< DDims... >, detail::kokkos_to_mdspan_layout_t< typename KokkosView::array_layout >, typename KokkosView::memory_space >

type of a span of this full chunk

◆ view_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::view_type
Initial value:
ElementType const,
DiscreteDomain<DDims...>,
std::experimental::layout_right,
typename Allocator::memory_space>

type of a view of this full chunk

◆ allocation_mdspan_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::allocation_mdspan_type = typename base_type::allocation_mdspan_type

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

◆ const_allocation_mdspan_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::const_allocation_mdspan_type = typename base_type::const_allocation_mdspan_type

◆ mdomain_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::mdomain_type = typename base_type::mdomain_type

◆ memory_space

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::memory_space = typename Allocator::memory_space

◆ discrete_element_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::discrete_element_type = typename base_type::discrete_element_type

◆ extents_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::extents_type = typename base_type::extents_type

◆ layout_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::layout_type = typename base_type::layout_type

◆ mapping_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::mapping_type = typename base_type::mapping_type

◆ element_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::element_type = typename base_type::element_type

◆ value_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::value_type = typename base_type::value_type

◆ size_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::size_type = typename base_type::size_type

◆ data_handle_type

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::data_handle_type = typename base_type::data_handle_type

◆ reference

template<class ElementType , class... DDims, class Allocator >
using ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::reference = typename base_type::reference

Constructor & Destructor Documentation

◆ Chunk() [1/5]

template<class ElementType , class... DDims, class Allocator >
ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::Chunk ( )
default

Empty Chunk.

◆ Chunk() [2/5]

template<class ElementType , class... DDims, class Allocator >
ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::Chunk ( std::string const & label,
mdomain_type const & domain,
Allocator allocator = Allocator() )
inlineexplicit

Construct a labeled Chunk on a domain with uninitialized values.

◆ Chunk() [3/5]

template<class ElementType , class... DDims, class Allocator >
ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::Chunk ( mdomain_type const & domain,
Allocator allocator = Allocator() )
inlineexplicit

Construct a Chunk on a domain with uninitialized values.

◆ Chunk() [4/5]

template<class ElementType , class... DDims, class Allocator >
ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::Chunk ( Chunk< ElementType, DiscreteDomain< DDims... >, Allocator > const & other)
delete

Deleted: use deepcopy instead.

◆ Chunk() [5/5]

template<class ElementType , class... DDims, class Allocator >
ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::Chunk ( Chunk< ElementType, DiscreteDomain< DDims... >, Allocator > && other)
inline

Constructs a new Chunk by move.

Parameters
otherthe Chunk to move

◆ ~Chunk()

template<class ElementType , class... DDims, class Allocator >
ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::~Chunk ( )
inline

Member Function Documentation

◆ operator=() [1/2]

template<class ElementType , class... DDims, class Allocator >
Chunk & ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::operator= ( Chunk< ElementType, DiscreteDomain< DDims... >, Allocator > const & other)
delete

Deleted: use deepcopy instead.

◆ operator=() [2/2]

template<class ElementType , class... DDims, class Allocator >
Chunk & ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::operator= ( Chunk< ElementType, DiscreteDomain< DDims... >, Allocator > && other)
inline

Move-assigns a new value to this field.

Parameters
otherthe Chunk to move
Returns
*this

◆ operator[]() [1/4]

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

Slice out some dimensions.

◆ operator[]() [2/4]

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

Slice out some dimensions.

◆ operator[]() [3/4]

template<class ElementType , class... DDims, class Allocator >
template<class... QueryDDims>
auto ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::operator[] ( DiscreteDomain< QueryDDims... > const & odomain) const
inline

Slice out some dimensions.

◆ operator[]() [4/4]

template<class ElementType , class... DDims, class Allocator >
template<class... QueryDDims>
auto ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::operator[] ( DiscreteDomain< QueryDDims... > const & odomain)
inline

Slice out some dimensions.

◆ operator()() [1/2]

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

Element access using a list of DiscreteElement.

Parameters
delemsdiscrete coordinates
Returns
const-reference to this element

◆ operator()() [2/2]

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

Element access using a list of DiscreteElement.

Parameters
delemsdiscrete coordinates
Returns
reference to this element

◆ label()

template<class ElementType , class... DDims, class Allocator >
char const * ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::label ( ) const
inline

Returns the label of the Chunk.

Returns
c-string

◆ data_handle() [1/2]

template<class ElementType , class... DDims, class Allocator >
ElementType const * ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::data_handle ( ) const
inline

Access to the underlying allocation pointer.

Returns
read-only allocation pointer

◆ data_handle() [2/2]

template<class ElementType , class... DDims, class Allocator >
ElementType * ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::data_handle ( )
inline

Access to the underlying allocation pointer.

Returns
allocation pointer

◆ allocation_mdspan() [1/2]

template<class ElementType , class... DDims, class Allocator >
const_allocation_mdspan_type ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::allocation_mdspan ( ) const
inline

Provide a mdspan on the memory allocation.

Returns
read-only allocation mdspan

◆ allocation_mdspan() [2/2]

template<class ElementType , class... DDims, class Allocator >
allocation_mdspan_type ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::allocation_mdspan ( )
inline

Provide a mdspan on the memory allocation.

Returns
allocation mdspan

◆ allocation_kokkos_view() [1/2]

template<class ElementType , class... DDims, class Allocator >
auto ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::allocation_kokkos_view ( )
inline

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

Returns
allocation Kokkos::View

◆ allocation_kokkos_view() [2/2]

template<class ElementType , class... DDims, class Allocator >
auto ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::allocation_kokkos_view ( ) const
inline

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

Returns
read-only allocation Kokkos::View

◆ span_cview()

template<class ElementType , class... DDims, class Allocator >
view_type ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::span_cview ( ) const
inline

◆ span_view() [1/2]

template<class ElementType , class... DDims, class Allocator >
view_type ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::span_view ( ) const
inline

◆ span_view() [2/2]

template<class ElementType , class... DDims, class Allocator >
span_type ddc::Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::span_view ( )
inline

Friends And Related Symbol Documentation

◆ Chunk

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

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