Template Numerical Library version main:e6bb26f
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
TNL::Algorithms::Segments::Ellpack< Device, Index, IndexAllocator, Organization, Alignment > Class Template Reference

Public Types

using ConstViewType = typename ViewType::ConstViewType
 
using DeviceType = Device
 
using IndexType = std::remove_const_t< Index >
 
using OffsetsContainer = Containers::Vector< IndexType, DeviceType, IndexType >
 
using SegmentsSizes = OffsetsContainer
 
using SegmentViewType = SegmentView< IndexType, Organization >
 
template<typename Device_ , typename Index_ >
using ViewTemplate = EllpackView< Device_, Index_, Organization, Alignment >
 
using ViewType = EllpackView< Device, Index, Organization, Alignment >
 

Public Member Functions

 Ellpack (const Ellpack &segments)=default
 
template<typename SizesContainer >
 Ellpack (const SizesContainer &sizes)
 
template<typename ListIndex >
 Ellpack (const std::initializer_list< ListIndex > &segmentsSizes)
 
 Ellpack (Ellpack &&segments) noexcept=default
 
 Ellpack (IndexType segmentsCount, IndexType segmentSize)
 
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
 
const ConstViewType getConstView () const
 
__cuda_callable__ IndexType getGlobalIndex (Index segmentIdx, Index localIdx) const
 
__cuda_callable__ IndexType getSegmentsCount () const
 Number segments.
 
__cuda_callable__ IndexType getSegmentSize (IndexType segmentIdx) const
 
__cuda_callable__ SegmentViewType getSegmentView (IndexType segmentIdx) const
 
__cuda_callable__ IndexType getSize () const
 
__cuda_callable__ IndexType getStorageSize () const
 Returns number of elements that needs to be allocated by a container connected to this segments. More...
 
ViewType getView ()
 
void load (File &file)
 
Ellpackoperator= (const Ellpack &source)=default
 
template<typename Device_ , typename Index_ , typename IndexAllocator_ , ElementsOrganization Organization_, int Alignment_>
Ellpackoperator= (const Ellpack< Device_, Index_, IndexAllocator_, Organization_, Alignment_ > &source)
 
template<typename Device_ , typename Index_ , typename IndexAllocator_ , ElementsOrganization Organization_, int Alignment_>
Ellpack< Device, Index, IndexAllocator, Organization, Alignment > & operator= (const Ellpack< Device_, Index_, IndexAllocator_, Organization_, Alignment_ > &source)
 
template<typename Fetch >
SegmentsPrinter< Ellpack, Fetch > print (Fetch &&fetch) const
 
template<typename Fetch >
auto print (Fetch &&fetch) const -> SegmentsPrinter< Ellpack, Fetch >
 
template<typename Fetch , typename Reduction , typename ResultKeeper , typename Real >
void reduceAllSegments (Fetch &fetch, const Reduction &reduction, ResultKeeper &keeper, const Real &zero) const
 Call reduceSegments for all segments.
 
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.
 
void setSegmentsSizes (IndexType segmentsCount, IndexType segmentSize)
 

Static Public Member Functions

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

Protected Attributes

IndexType alignedSize = 0
 
IndexType segmentSize = 0
 
IndexType size = 0
 

Member Function Documentation

◆ getStorageSize()

template<typename Device , typename Index , typename IndexAllocator , ElementsOrganization Organization, int Alignment>
__cuda_callable__ auto TNL::Algorithms::Segments::Ellpack< Device, Index, IndexAllocator, Organization, Alignment >::getStorageSize

Returns number of elements that needs to be allocated by a container connected to this segments.

Returns
size of container connected to this segments.

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