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 = ChunkSpan< ElementType, DiscreteDomain< DDims... >, std::experimental::layout_right, typename Allocator::memory_space >
 type of a span of this full chunk More...
 
using view_type = ChunkSpan< ElementType const, DiscreteDomain< DDims... >, std::experimental::layout_right, typename Allocator::memory_space >
 type of a view of this full chunk More...
 
using allocation_mdspan_type = typename base_type::allocation_mdspan_type
 The dereferenceable part of the co-domain but with indexing starting at 0. More...
 
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. More...
 
 Chunk (std::string const &label, mdomain_type const &domain, Allocator allocator=Allocator())
 Construct a labeled Chunk on a domain with uninitialized values. More...
 
 Chunk (mdomain_type const &domain, Allocator allocator=Allocator())
 Construct a Chunk on a domain with uninitialized values. More...
 
 Chunk (Chunk const &other)=delete
 Deleted: use deepcopy instead. More...
 
 Chunk (Chunk &&other)
 Constructs a new Chunk by move. More...
 
 ~Chunk ()
 
Chunkoperator= (Chunk const &other)=delete
 Deleted: use deepcopy instead. More...
 
Chunkoperator= (Chunk &&other)
 Move-assigns a new value to this field. More...
 
template<class... QueryDDims>
auto operator[] (DiscreteElement< QueryDDims... > const &slice_spec) const
 Slice out some dimensions. More...
 
template<class... QueryDDims>
auto operator[] (DiscreteElement< QueryDDims... > const &slice_spec)
 Slice out some dimensions. More...
 
template<class... QueryDDims>
auto operator[] (DiscreteDomain< QueryDDims... > const &odomain) const
 Slice out some dimensions. More...
 
template<class... QueryDDims>
auto operator[] (DiscreteDomain< QueryDDims... > const &odomain)
 Slice out some dimensions. More...
 
template<class... DElems>
element_type const & operator() (DElems const &... delems) const noexcept
 Element access using a list of DiscreteElement. More...
 
template<class... DElems>
element_typeoperator() (DElems const &... delems) noexcept
 Element access using a list of DiscreteElement. More...
 
char const * label () const
 Returns the label of the Chunk. More...
 
ElementType const * data_handle () const
 Access to the underlying allocation pointer. More...
 
ElementType * data_handle ()
 Access to the underlying allocation pointer. More...
 
const_allocation_mdspan_type allocation_mdspan () const
 Provide a mdspan on the memory allocation. More...
 
allocation_mdspan_type allocation_mdspan ()
 Provide a mdspan on the memory allocation. More...
 
auto allocation_kokkos_view ()
 Provide an unmanaged Kokkos::View on the memory allocation. More...
 
auto allocation_kokkos_view () const
 Provide an unmanaged Kokkos::View on the memory allocation. More...
 
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. More...
 

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 = ChunkSpan< ElementType, DiscreteDomain<DDims...>, std::experimental::layout_right, typename Allocator::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 = ChunkSpan< 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 Function 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: