Template Numerical Library version\ main:8b8c8226
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TNL::Algorithms::Segments::ChunkedEllpack< Device, Index, IndexAllocator, Organization > Class Template Reference
Collaboration diagram for TNL::Algorithms::Segments::ChunkedEllpack< Device, Index, IndexAllocator, Organization >:
Collaboration graph
[legend]

Public Types

using ChunkedEllpackSliceInfoAllocator = typename Allocators::Default< Device >::template Allocator< ChunkedEllpackSliceInfoType >
 
using ChunkedEllpackSliceInfoContainer = Containers::Array< typename TNL::copy_const< ChunkedEllpackSliceInfoType >::template from< Index >::type, DeviceType, IndexType, ChunkedEllpackSliceInfoAllocator >
 
using ChunkedEllpackSliceInfoType = typename ViewType::ChunkedEllpackSliceInfoType
 
using ConstViewType = typename ViewType::ConstViewType
 
using DeviceType = Device
 
using IndexType = std::remove_const_t< Index >
 
using OffsetsContainer = Containers::Vector< Index, DeviceType, IndexType, IndexAllocator >
 
using SegmentViewType = typename ViewType::SegmentViewType
 
template<typename Device_ , typename Index_ >
using ViewTemplate = ChunkedEllpackView< Device_, Index_, Organization >
 
using ViewType = ChunkedEllpackView< Device, Index, Organization >
 

Public Member Functions

 ChunkedEllpack (ChunkedEllpack &&segments) noexcept=default
 
 ChunkedEllpack (const ChunkedEllpack &segments)=default
 
template<typename SizesContainer >
 ChunkedEllpack (const SizesContainer &sizes)
 
template<typename ListIndex >
 ChunkedEllpack (const std::initializer_list< ListIndex > &segmentsSizes)
 
template<typename Function >
void forAllElements (Function &&f) const
 
template<typename Function >
void forAllSegments (Function &&f) const
 
template<typename Function >
void forElements (IndexType first, IndexType last, Function &&f) const
 
template<typename Function >
void forSegments (IndexType begin, IndexType end, Function &&f) const
 
ConstViewType getConstView () const
 
__cuda_callable__ IndexType getGlobalIndex (Index segmentIdx, Index localIdx) const
 
__cuda_callable__ IndexType getSegmentsCount () const
 Number of segments.
 
IndexType getSegmentSize (IndexType segmentIdx) const
 
__cuda_callable__ SegmentViewType getSegmentView (IndexType segmentIdx) const
 
__cuda_callable__ IndexType getSize () const
 Number segments.
 
__cuda_callable__ IndexType getStorageSize () const
 
ViewType getView ()
 
void load (File &file)
 
ChunkedEllpackoperator= (const ChunkedEllpack &source)=default
 
template<typename Device_ , typename Index_ , typename IndexAllocator_ , ElementsOrganization Organization_>
ChunkedEllpackoperator= (const ChunkedEllpack< Device_, Index_, IndexAllocator_, Organization_ > &source)
 
template<typename Device_ , typename Index_ , typename IndexAllocator_ , ElementsOrganization Organization_>
ChunkedEllpack< Device, Index, IndexAllocator, Organization > & operator= (const ChunkedEllpack< Device_, Index_, IndexAllocator_, Organization_ > &source)
 
template<typename Fetch >
SegmentsPrinter< ChunkedEllpack, Fetch > print (Fetch &&fetch) const
 
template<typename Fetch >
auto print (Fetch &&fetch) const -> SegmentsPrinter< ChunkedEllpack, Fetch >
 
void printStructure (std::ostream &str)
 
template<typename Fetch , typename Reduction , typename ResultKeeper , typename Real >
void reduceAllSegments (Fetch &fetch, const Reduction &reduction, ResultKeeper &keeper, const Real &zero) const
 
template<typename Fetch , typename Reduction , typename ResultKeeper , typename Real >
void reduceSegments (IndexType first, IndexType last, Fetch &fetch, const Reduction &reduction, ResultKeeper &keeper, const Real &zero) const
 
void reset ()
 
void save (File &file) const
 
template<typename SizesHolder = OffsetsContainer>
void setSegmentsSizes (const SizesHolder &sizes)
 Set sizes of particular segments.
 

Static Public Member Functions

static constexpr ElementsOrganization getOrganization ()
 
static String getSegmentsType ()
 
static std::string getSerializationType ()
 
static constexpr bool havePadding ()
 

Protected Member Functions

template<typename SegmentsSizes >
void resolveSliceSizes (SegmentsSizes &rowLengths)
 
template<typename SegmentsSizes >
bool setSlice (SegmentsSizes &rowLengths, IndexType sliceIdx, IndexType &elementsToAllocation)
 

Protected Attributes

IndexType chunksInSlice = 256
 
OffsetsContainer chunksToSegmentsMapping
 
IndexType desiredChunkSize = 16
 
IndexType numberOfSlices = 0
 
OffsetsContainer rowPointers
 
OffsetsContainer rowToChunkMapping
 
OffsetsContainer rowToSliceMapping
 
IndexType size = 0
 
ChunkedEllpackSliceInfoContainer slices
 
IndexType storageSize = 0
 

Member Data Documentation

◆ rowPointers

template<typename Device , typename Index , typename IndexAllocator = typename Allocators::Default< Device >::template Allocator< Index >, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization()>
OffsetsContainer TNL::Algorithms::Segments::ChunkedEllpack< Device, Index, IndexAllocator, Organization >::rowPointers
protected

Keeps index of the first segment index.

◆ rowToChunkMapping

template<typename Device , typename Index , typename IndexAllocator = typename Allocators::Default< Device >::template Allocator< Index >, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization()>
OffsetsContainer TNL::Algorithms::Segments::ChunkedEllpack< Device, Index, IndexAllocator, Organization >::rowToChunkMapping
protected

For each row, this keeps index of the first chunk within a slice.

◆ rowToSliceMapping

template<typename Device , typename Index , typename IndexAllocator = typename Allocators::Default< Device >::template Allocator< Index >, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization()>
OffsetsContainer TNL::Algorithms::Segments::ChunkedEllpack< Device, Index, IndexAllocator, Organization >::rowToSliceMapping
protected

For each segment, this keeps index of the slice which contains the segment.


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