Template Numerical Library version\ main:4e6e2c1
Loading...
Searching...
No Matches
TNL::Algorithms::Segments::BiEllpackSegmentView< Index, Organization, WarpSize > Class Template Reference

Data structure for accessing particular segment of BiEllpack segments. More...

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

Collaboration diagram for TNL::Algorithms::Segments::BiEllpackSegmentView< Index, Organization, WarpSize >:
[legend]

Public Types

using GroupsWidthType = Containers::StaticVector< getGroupsCount(), IndexType >
using IndexType = Index
 Type for indexing elements in related segments.

Public Member Functions

__cuda_callable__ BiEllpackSegmentView (BiEllpackSegmentView &&) noexcept=default
 Move constructor.
__cuda_callable__ BiEllpackSegmentView (const BiEllpackSegmentView &)=default
 Copy constructor.
__cuda_callable__ BiEllpackSegmentView (IndexType segmentIdx, IndexType offset, IndexType inStripIdx, const GroupsWidthType &groupsWidth)
 Constructor.
__cuda_callable__ IndexType getGlobalIndex (IndexType localIdx) const
 Get global index of an element with rank localIdx in the segment.
__cuda_callable__ IndexType getSegmentIndex () const
 Get index of the segment.
__cuda_callable__ IndexType getSize () const
 Get the size of the segment, i.e. number of elements in the segment.
__cuda_callable__ BiEllpackSegmentViewoperator= (BiEllpackSegmentView &&) noexcept=default
 Move assignment operator.
__cuda_callable__ BiEllpackSegmentViewoperator= (const BiEllpackSegmentView &)=default
 Copy assignment operator.
__cuda_callable__ void setSegmentIndex (IndexType index)
 Set index of the segment.

Static Public Member Functions

static constexpr int getGroupsCount ()
 Returns the number of groups used for the segments.
static constexpr int getLogWarpSize ()
 Returns the log of the warp size used for the segments.
static constexpr int getWarpSize ()
 Returns the warp size used for the segments.

Protected Attributes

IndexType groupOffset
GroupsWidthType groupsWidth
IndexType inStripIdx
IndexType segmentIdx
IndexType segmentSize

Detailed Description

template<typename Index, ElementsOrganization Organization, int WarpSize = Backend::getWarpSize()>
class TNL::Algorithms::Segments::BiEllpackSegmentView< Index, Organization, WarpSize >

Data structure for accessing particular segment of BiEllpack segments.

Template Parameters
Indexis type for indexing elements in related segments.
Organizationis the organization of the elements in the segments—either row-major or column-major order.
WarpSizeis the warp size used for the segments.

See the template specializations TNL::Algorithms::Segments::SegmentView< Index, ColumnMajorOrder > and TNL::Algorithms::Segments::SegmentView< Index, RowMajorOrder > for column-major and row-major elements organization respectively. They have equivalent interface.

Constructor & Destructor Documentation

◆ BiEllpackSegmentView()

template<typename Index, ElementsOrganization Organization, int WarpSize = Backend::getWarpSize()>
__cuda_callable__ TNL::Algorithms::Segments::BiEllpackSegmentView< Index, Organization, WarpSize >::BiEllpackSegmentView ( IndexType segmentIdx,
IndexType offset,
IndexType inStripIdx,
const GroupsWidthType & groupsWidth )
inline

Constructor.

Parameters
segmentIdxis the segment index.
offsetis offset of the first group of the strip the segment belongs to.
inStripIdxis index of the segment within its strip.
groupsWidthis a static vector containing widths of the strip groups.

Member Function Documentation

◆ getGlobalIndex()

template<typename Index, ElementsOrganization Organization, int WarpSize = Backend::getWarpSize()>
__cuda_callable__ IndexType TNL::Algorithms::Segments::BiEllpackSegmentView< Index, Organization, WarpSize >::getGlobalIndex ( IndexType localIdx) const
inlinenodiscard

Get global index of an element with rank localIdx in the segment.

Parameters
localIdxis the rank of the element in the segment.
Returns
global index of the element.

◆ getSegmentIndex()

template<typename Index, ElementsOrganization Organization, int WarpSize = Backend::getWarpSize()>
__cuda_callable__ IndexType TNL::Algorithms::Segments::BiEllpackSegmentView< Index, Organization, WarpSize >::getSegmentIndex ( ) const
inlinenodiscard

Get index of the segment.

Returns
index of the segment.

◆ getSize()

template<typename Index, ElementsOrganization Organization, int WarpSize = Backend::getWarpSize()>
__cuda_callable__ IndexType TNL::Algorithms::Segments::BiEllpackSegmentView< Index, Organization, WarpSize >::getSize ( ) const
inlinenodiscard

Get the size of the segment, i.e. number of elements in the segment.

Returns
number of elements in the segment.

◆ setSegmentIndex()

template<typename Index, ElementsOrganization Organization, int WarpSize = Backend::getWarpSize()>
__cuda_callable__ void TNL::Algorithms::Segments::BiEllpackSegmentView< Index, Organization, WarpSize >::setSegmentIndex ( IndexType index)
inline

Set index of the segment.

Parameters
indexof the segment.

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