Template Numerical Library version\ main:4904c12
Loading...
Searching...
No Matches
TNL::Algorithms::Segments::ChunkedEllpackView< Device, Index, Organization > Class Template Reference

ChunkedView is provides a non-owning encapsulation of meta-data stored in the TNL::Algorithms::Segments::ChunkedEllpack segments. More...

#include <TNL/Algorithms/Segments/ChunkedEllpackView.h>

Inheritance diagram for TNL::Algorithms::Segments::ChunkedEllpackView< Device, Index, Organization >:
[legend]
Collaboration diagram for TNL::Algorithms::Segments::ChunkedEllpackView< Device, Index, Organization >:
[legend]

Public Types

using ConstViewType = ChunkedEllpackView< Device, std::add_const_t< Index >, Organization >
 Type of constant segments view.
template<typename Device_, typename Index_>
using ViewTemplate = ChunkedEllpackView< Device_, Index_, Organization >
 Templated view type.
using ViewType = ChunkedEllpackView
 Type of segments view.
Public Types inherited from TNL::Algorithms::Segments::ChunkedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization() >
using ConstOffsetsView
 The type for representing the constant vector view with segment offsets.
using ConstSliceInfoContainerView
using DeviceType
 The device where the segments are operating.
using IndexType
 The type used for indexing of segments elements.
using OffsetsView
 The type for representing the vector view with segment offsets.
using SegmentViewType
 Accessor type for one particular segment.
using SliceInfoContainerView
using SliceInfoType
using ViewTemplate
 Templated view type.

Public Member Functions

__cuda_callable__ ChunkedEllpackView ()=default
 Default constructor with no parameters to create empty segments view.
__cuda_callable__ ChunkedEllpackView (ChunkedEllpackView &&) noexcept=default
 Move constructor.
__cuda_callable__ ChunkedEllpackView (const ChunkedEllpackView &)=default
 Copy constructor.
__cuda_callable__ ChunkedEllpackView (Index size, Index storageSize, Index numberOfSlices, Index chunksInSlice, Index desiredChunkSize, typename Base::OffsetsView segmentToChunkMapping, typename Base::OffsetsView segmentToSliceMapping, typename Base::OffsetsView chunksToSegmentsMapping, typename Base::OffsetsView segmentPointers, typename Base::SliceInfoContainerView slices)
 Constructor that initializes segments based on all necessary data.
__cuda_callable__ void bind (ChunkedEllpackView view)
 Method for rebinding (reinitialization) to another view.
__cuda_callable__ ConstViewType getConstView () const
 Returns a constant view for this instance of segments which can by used for example in lambda functions running in GPU kernels.
__cuda_callable__ ViewType getView ()
 Returns a view for this instance of segments which can by used for example in lambda functions running in GPU kernels.
void load (File &file)
 Method for loading the segments from a file in a binary form.
ChunkedEllpackViewoperator= (ChunkedEllpackView &&)=delete
 Move-assignment operator.
ChunkedEllpackViewoperator= (const ChunkedEllpackView &)=delete
 Copy-assignment operator.
void save (File &file) const
 Method for saving the segments to a file in a binary form.
Public Member Functions inherited from TNL::Algorithms::Segments::ChunkedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization() >
__cuda_callable__ ChunkedEllpackBase ()=default
 Default constructor with no parameters to create empty segments view.
void forAllElements (Function &&function) const
void forAllElementsIf (Condition condition, Function function) const
void forAllSegments (Function &&function) const
void forElements (IndexType begin, IndexType end, Function &&function) const
void forElementsIf (IndexType begin, IndexType end, Condition condition, Function function) const
void forSegments (IndexType begin, IndexType end, Function &&function) const
__cuda_callable__ IndexType getChunksInSlice () const
 Returns the number of chunks in a slice.
__cuda_callable__ OffsetsView getChunksToSegmentsMappingView ()
 Returns a modifiable vector view with mapping of chunks to segments.
__cuda_callable__ IndexType getDesiredChunkSize () const
 Returns the desired chunk size.
__cuda_callable__ IndexType getElementCount () const
 Returns the number of elements managed by all segments.
__cuda_callable__ IndexType getGlobalIndex (IndexType segmentIdx, IndexType localIdx) const
 Computes the global index of an element managed by the segments.
__cuda_callable__ IndexType getNumberOfSlices () const
 Returns the number of slices.
__cuda_callable__ IndexType getSegmentCount () const
 Returns the number of segments.
__cuda_callable__ OffsetsView getSegmentPointersView ()
 Returns a modifiable vector view with segment pointers.
__cuda_callable__ IndexType getSegmentsCount () const
 Returns the number of segments. Deprecated, use getSegmentCount().
__cuda_callable__ IndexType getSegmentSize (IndexType segmentIdx) const
 Returns the size of a particular segment denoted by segmentIdx.
__cuda_callable__ OffsetsView getSegmentToChunkMappingView ()
 Returns a modifiable vector view with mapping of segments to chunks.
__cuda_callable__ OffsetsView getSegmentToSliceMappingView ()
 Returns a modifiable vector view with mapping of segments to slices.
__cuda_callable__ SegmentViewType getSegmentView (IndexType segmentIdx) const
 Returns a segment view (i.e., a segment accessor) for the specified segment index.
__cuda_callable__ IndexType getSize () const
 Returns the number of elements managed by all segments.
__cuda_callable__ SliceInfoContainerView getSlicesView ()
 Returns a modifiable view with slice information.
__cuda_callable__ IndexType getStorageSize () const
 Returns number of elements that needs to be allocated by a container connected to this segments.
ChunkedEllpackBaseoperator= (const ChunkedEllpackBase &)=delete
 Copy-assignment operator.
void printStructure (std::ostream &str) const
 Prints the structure of the segments to the output stream.

Additional Inherited Members

Static Public Member Functions inherited from TNL::Algorithms::Segments::ChunkedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization() >
static constexpr ElementsOrganization getOrganization ()
 Returns the data layout for the chunked ellpack format (it is always row-major order).
static std::string getSegmentsType ()
 Returns string with the segments type.
static std::string getSerializationType ()
 Returns string with the serialization type.
static constexpr bool havePadding ()
 This function denotes that the chunked ellpack format uses padding elements.
Protected Member Functions inherited from TNL::Algorithms::Segments::ChunkedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization() >
__cuda_callable__ void bind (IndexType size, IndexType storageSize, IndexType numberOfSlices, IndexType chunksInSlice, IndexType desiredChunkSize, OffsetsView segmentToChunkMapping, OffsetsView segmentToSliceMapping, OffsetsView chunksToSegmentsMapping, OffsetsView segmentPointers, SliceInfoContainerView slices)
 Re-initializes the internal attributes of the base class.
Protected Attributes inherited from TNL::Algorithms::Segments::ChunkedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization() >
IndexType chunksInSlice
OffsetsView chunksToSegmentsMapping
IndexType desiredChunkSize
IndexType numberOfSlices
OffsetsView segmentPointers
 Keeps index of the first segment index.
OffsetsView segmentToChunkMapping
 For each segment, this keeps index of the first chunk within a slice.
OffsetsView segmentToSliceMapping
 For each segment, this keeps index of the slice which contains the segment.
IndexType size
SliceInfoContainerView slices
IndexType storageSize

Detailed Description

template<typename Device, typename Index, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization()>
class TNL::Algorithms::Segments::ChunkedEllpackView< Device, Index, Organization >

ChunkedView is provides a non-owning encapsulation of meta-data stored in the TNL::Algorithms::Segments::ChunkedEllpack segments.

Template Parameters
Deviceis type of device where the segments will be operating.
Indexis type for indexing of the elements managed by the segments.
Organizationis the organization of the elements in the segments—either row-major or column-major order.

Member Typedef Documentation

◆ ViewTemplate

template<typename Device, typename Index, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization()>
template<typename Device_, typename Index_>
using TNL::Algorithms::Segments::ChunkedEllpackView< Device, Index, Organization >::ViewTemplate = ChunkedEllpackView< Device_, Index_, Organization >

Templated view type.

Template Parameters
Device_is alternative device type for the view.
Index_is alternative index type for the view.

Member Function Documentation

◆ load()

template<typename Device, typename Index, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization()>
void TNL::Algorithms::Segments::ChunkedEllpackView< Device, Index, Organization >::load ( File & file)

Method for loading the segments from a file in a binary form.

Parameters
fileis the source file.

◆ save()

template<typename Device, typename Index, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization()>
void TNL::Algorithms::Segments::ChunkedEllpackView< Device, Index, Organization >::save ( File & file) const

Method for saving the segments to a file in a binary form.

Parameters
fileis the target file.

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