DDC 0.0.0

a discrete domain computation library

Chunk< ElementType, DiscreteDomain< DDims... >, Allocator > Class Template Reference
Inheritance diagram for 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 difference_type = typename base_type::difference_type
 
using pointer = typename base_type::pointer
 
using reference = typename base_type::reference
 

Public Member Functions

 Chunk ()=default
 Empty Chunk. More...
 
 Chunk (mdomain_type const &domain, Allocator allocator=Allocator())
 Construct a Chunk on a domain with uninitialized values. More...
 
template<class OElementType , class... ODDims, class LayoutType >
 Chunk (ChunkSpan< OElementType, DiscreteDomain< ODDims... >, LayoutType > chunk_span, Allocator allocator=Allocator())
 Construct a Chunk from a deepcopy of a ChunkSpan. 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... ODDims>
element_type const & operator() (DiscreteElement< ODDims > const &... delems) const noexcept
 Element access using a list of DiscreteElement. More...
 
template<class... ODDims>
element_typeoperator() (DiscreteElement< ODDims > const &... delems) noexcept
 Element access using a list of DiscreteElement. More...
 
template<class... ODDims, class = std::enable_if_t<sizeof...(ODDims) != 1>>
element_type const & operator() (DiscreteElement< ODDims... > const &delems) const noexcept
 Element access using a multi-dimensional DiscreteElement. More...
 
template<class... ODDims, class = std::enable_if_t<sizeof...(ODDims) != 1>>
element_typeoperator() (DiscreteElement< ODDims... > const &delems) noexcept
 Element access using a multi-dimensional DiscreteElement. More...
 
ElementType const * data () const
 Access to the underlying allocation pointer. More...
 
ElementType * data ()
 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...
 
constexpr auto allocation_kokkos_view ()
 Provide a mdspan on the memory allocation. More...
 
constexpr auto allocation_kokkos_view () const
 Provide a mdspan 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 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 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 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 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 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 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 Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::mdomain_type = typename base_type::mdomain_type

◆ memory_space

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

◆ discrete_element_type

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

◆ extents_type

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

◆ layout_type

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

◆ mapping_type

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

◆ element_type

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

◆ value_type

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

◆ size_type

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

◆ difference_type

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

◆ pointer

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

◆ reference

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

Constructor & Destructor Documentation

◆ Chunk() [1/5]

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

Empty Chunk.

◆ Chunk() [2/5]

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

Construct a Chunk on a domain with uninitialized values.

◆ Chunk() [3/5]

template<class ElementType , class... DDims, class Allocator >
template<class OElementType , class... ODDims, class LayoutType >
Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::Chunk ( ChunkSpan< OElementType, DiscreteDomain< ODDims... >, LayoutType >  chunk_span,
Allocator  allocator = Allocator() 
)
inlineexplicit

Construct a Chunk from a deepcopy of a ChunkSpan.

◆ Chunk() [4/5]

template<class ElementType , class... DDims, class Allocator >
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 >
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 >
Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::~Chunk ( )
inline

Member Function Documentation

◆ operator=() [1/2]

template<class ElementType , class... DDims, class Allocator >
Chunk& 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& 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 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 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 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 Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::operator[] ( DiscreteDomain< QueryDDims... > const &  odomain)
inline

Slice out some dimensions.

◆ operator()() [1/4]

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

Element access using a list of DiscreteElement.

Parameters
delems1D discrete coordinates
Returns
const-reference to this element

◆ operator()() [2/4]

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

Element access using a list of DiscreteElement.

Parameters
delems1D discrete coordinates
Returns
reference to this element

◆ operator()() [3/4]

template<class ElementType , class... DDims, class Allocator >
template<class... ODDims, class = std::enable_if_t<sizeof...(ODDims) != 1>>
element_type const& Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::operator() ( DiscreteElement< ODDims... > const &  delems) const
inlinenoexcept

Element access using a multi-dimensional DiscreteElement.

Parameters
delemsdiscrete coordinates
Returns
const-reference to this element

◆ operator()() [4/4]

template<class ElementType , class... DDims, class Allocator >
template<class... ODDims, class = std::enable_if_t<sizeof...(ODDims) != 1>>
element_type& Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::operator() ( DiscreteElement< ODDims... > const &  delems)
inlinenoexcept

Element access using a multi-dimensional DiscreteElement.

Parameters
delemsdiscrete coordinates
Returns
reference to this element

◆ data() [1/2]

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

Access to the underlying allocation pointer.

Returns
read-only allocation pointer

◆ data() [2/2]

template<class ElementType , class... DDims, class Allocator >
ElementType* Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::data ( )
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 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 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 >
constexpr auto Chunk< ElementType, DiscreteDomain< DDims... >, Allocator >::allocation_kokkos_view ( )
inlineconstexpr

Provide a mdspan on the memory allocation.

Returns
allocation mdspan

◆ allocation_kokkos_view() [2/2]

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

Provide a mdspan on the memory allocation.

Returns
allocation mdspan

◆ span_cview()

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

◆ span_view() [1/2]

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

◆ span_view() [2/2]

template<class ElementType , class... DDims, class Allocator >
span_type 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: