|
Template Numerical Library version\ main:4904c12
|
BiEllpackBase serves as a base class for TNL::Algorithms::Segments::BiEllpack and TNL::Algorithms::Segments::BiEllpackView. More...
#include <TNL/Algorithms/Segments/BiEllpackBase.h>
Public Types | |
| using | ConstOffsetsView = typename OffsetsView::ConstViewType |
| The type for representing the constant vector view with offsets of the BiEllpack groups. | |
| using | DeviceType = Device |
| The device where the segments are operating. | |
| using | IndexType = std::remove_const_t< Index > |
| The type used for indexing of segments elements. | |
| using | OffsetsView = Containers::VectorView< Index, DeviceType, IndexType > |
| The type for representing the vector view with offsets of the BiEllpack groups. | |
| using | SegmentViewType = BiEllpackSegmentView< IndexType, Organization, WarpSize > |
| Accessor type for one particular segment. | |
Public Member Functions | |
| __cuda_callable__ | BiEllpackBase ()=default |
| Default constructor with no parameters to create empty segments view. | |
| __cuda_callable__ | BiEllpackBase (BiEllpackBase &&) noexcept=default |
| Move constructor. | |
| __cuda_callable__ | BiEllpackBase (const BiEllpackBase &)=default |
| Copy constructor. | |
| __cuda_callable__ | BiEllpackBase (IndexType size, IndexType storageSize, OffsetsView segmentsPermutation, OffsetsView groupPointers) |
| Constructor that initializes segments based all necessary data. | |
| template<typename Function> | |
| void | forAllElements (Function &&function) const |
| template<typename Condition, typename Function> | |
| void | forAllElementsIf (Condition condition, Function function) const |
| template<typename Function> | |
| void | forAllSegments (Function &&function) const |
| template<typename Array, typename Function> | |
| void | forElements (const Array &segmentIndexes, Function function) const |
| template<typename Array, typename Function> | |
| void | forElements (const Array &segmentIndexes, Index begin, Index end, Function function) const |
| template<typename Function> | |
| void | forElements (IndexType begin, IndexType end, Function &&function) const |
| template<typename Condition, typename Function> | |
| void | forElementsIf (IndexType begin, IndexType end, Condition condition, Function function) const |
| template<typename Function> | |
| void | forSegments (IndexType begin, IndexType end, Function &&function) const |
| __cuda_callable__ IndexType | getElementCount () const |
| Returns the number of elements managed by all segments. | |
| __cuda_callable__ IndexType | getGlobalIndex (Index segmentIdx, Index localIdx) const |
| Computes the global index of an element managed by the segments. | |
| __cuda_callable__ OffsetsView | getGroupPointersView () |
| Returns a view containing the pointers to the beginning of each segment. | |
| __cuda_callable__ ConstOffsetsView | getGroupPointersView () const |
| Returns a view containing the pointers to the beginning of each segment. | |
| __cuda_callable__ IndexType | getSegmentCount () const |
| Returns the number of segments. | |
| __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 | getSegmentsPermutationView () |
| Returns a view containing the permutation of segments. | |
| __cuda_callable__ ConstOffsetsView | getSegmentsPermutationView () const |
| Returns a view containing the permutation of segments. | |
| __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__ IndexType | getStorageSize () const |
| Returns number of elements that needs to be allocated by a container connected to this segments. | |
| __cuda_callable__ IndexType | getVirtualSegments () const |
| BiEllpackBase & | operator= (BiEllpackBase &&)=delete |
| Move-assignment operator. | |
| BiEllpackBase & | operator= (const BiEllpackBase &)=delete |
| Copy-assignment operator. | |
| void | printStructure (std::ostream &str) const |
| Prints the structure of the segments to the specified output stream. | |
Static Public Member Functions | |
| static constexpr int | getLogWarpSize () |
| Returns the log2 of the warp size used for the segments. | |
| static constexpr ElementsOrganization | getOrganization () |
| Returns the data layout for the biellpack 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 int | getWarpSize () |
| Returns the warp size used for the segments. | |
| static constexpr bool | havePadding () |
| This function denotes that the biellpack format uses padding elements. | |
Protected Member Functions | |
| __cuda_callable__ void | bind (IndexType size, IndexType storageSize, OffsetsView segmentsPermutation, OffsetsView groupPointers) |
| Re-initializes the internal attributes of the base class. | |
| __cuda_callable__ IndexType | getVirtualSegments (IndexType segmentsCount) const |
Protected Attributes | |
| OffsetsView | groupPointers |
| OffsetsView | segmentsPermutation |
| IndexType | size = 0 |
| IndexType | storageSize = 0 |
BiEllpackBase serves as a base class for TNL::Algorithms::Segments::BiEllpack and TNL::Algorithms::Segments::BiEllpackView.
| Device | is type of device where the segments will be operating. |
| Index | is type for indexing of the elements managed by the segments. |
| Organization | is the organization of the elements in the segments—either row-major or column-major order. |
| WarpSize | is the warp size used for the segments. |
|
protected |
Re-initializes the internal attributes of the base class.
Note that this function is protected to ensure that the user cannot modify the base class of segments. For the same reason, in future code development we also need to make sure that all non-const functions in the base class return by value and not by reference.
|
nodiscard |
Computes the global index of an element managed by the segments.
The global index serves as a reference to the element within its container.
| segmentIdx | The index of the segment containing the element. |
| localIdx | The local index of the element within the segment. |
|
staticnodiscard |
Returns string with the segments type.
|
nodiscard |
Returns a segment view (i.e., a segment accessor) for the specified segment index.
| segmentIdx | The index of the requested segment. |
|
staticnodiscard |
Returns string with the serialization type.