|
|
using | ConstViewType = typename ViewType::ConstViewType |
| | Type of constant segments view.
|
|
using | IndexAllocatorType = IndexAllocator |
|
using | OffsetsContainer = Containers::Vector< Index, Device, typename Base::IndexType, IndexAllocator > |
| | Type of container storing offsets of particular segments.
|
| template<typename Device_ = Device, typename Index_ = Index, typename IndexAllocator_ = typename Allocators::Default< Device_ >::template Allocator< Index_ >, ElementsOrganization Organization_ = Organization, int Alignment_ = Alignment> |
| using | Self = Ellpack< Device_, Index_, IndexAllocator_, Organization_, Alignment_ > |
| | Templated type for creating Ellpack segments with different template parameters.
|
| template<typename Device_, typename Index_> |
| using | ViewTemplate = EllpackView< Device_, Index_, Organization, Alignment > |
| | Templated view type.
|
|
using | ViewType = EllpackView< Device, Index, Organization, Alignment > |
| | Type of segments view.
|
|
using | DeviceType |
| | The device where the segments are operating.
|
|
using | IndexType |
| | The type used for indexing of segments elements.
|
|
using | SegmentViewType |
| | Accessor type for one particular segment.
|
|
|
| Ellpack ()=default |
| | Constructor with no parameters to create empty segments.
|
|
| Ellpack (const Ellpack &segments)=default |
| | Copy constructor (makes deep copy).
|
| template<typename SizesContainer, std::enable_if_t< IsArrayType< SizesContainer >::value, bool > = true> |
| | Ellpack (const SizesContainer &sizes) |
| | Constructor that initializes segments based on their sizes.
|
| template<typename ListIndex> |
| | Ellpack (const std::initializer_list< ListIndex > &segmentsSizes) |
| | Constructor that initializes segments using an initializer list.
|
|
| Ellpack (Ellpack &&segments) noexcept=default |
| | Move constructor.
|
|
| Ellpack (Index segmentsCount, Index segmentSize) |
| | Constructor that initializes segments based on the number of segments and the size of each segment.
|
|
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.
|
|
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.
|
|
Ellpack & | operator= (const Ellpack &segments) |
| | Copy-assignment operator.
|
| template<typename Device_, typename Index_, typename IndexAllocator_, ElementsOrganization Organization_, int Alignment_> |
| Ellpack & | operator= (const Ellpack< Device_, Index_, IndexAllocator_, Organization_, Alignment_ > &segments) |
| | Assignment operator for segments with different template parameters.
|
|
Ellpack & | operator= (Ellpack &&) noexcept |
| | Move-assignment operator.
|
|
void | reset () |
| | Reset the segments to empty states (it means that there is no segment in the segments).
|
| void | save (File &file) const |
| | Method for saving the segments to a file in a binary form.
|
| template<typename SizesContainer> |
| void | setSegmentsSizes (const SizesContainer &sizes) |
| | Set sizes of particular segments.
|
| void | setSegmentsSizes (Index segmentsCount, Index segmentSize) |
| | Set sizes of the segments.
|
|
__cuda_callable__ | EllpackBase ()=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 | getAlignedSize () const |
| | Returns the aligned number of segments.
|
|
__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__ 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__ 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.
|
|
EllpackBase & | operator= (const EllpackBase &)=delete |
| | Copy-assignment operator.
|
template<typename Device, typename Index, typename IndexAllocator = typename Allocators::Default< Device >::template Allocator< Index >,
ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), int Alignment = 32>
class TNL::Algorithms::Segments::Ellpack< Device, Index, IndexAllocator, Organization, Alignment >
Data structure for Ellpack segments.
Ellpack segments are inspired by the Ellpack format, which is commonly used for storing sparse matrices on parallel architectures. Compared to CSR, Ellpack has a fixed number of elements per segment, which can be more efficient for certain operations. Therefore, this format may be preferable to CSR if all segments contain approximately the same number of elements.
See TNL::Algorithms::Segments for more details about segments.
- Template Parameters
-
| Device | The type of device on which the segments will operate. |
| Index | The type used for indexing elements managed by the segments. |
| IndexAllocator | The allocator used for managing index containers. |
| Organization | The organization of the elements in the segments—either row-major or column-major order. |
| Alignment | The alignment of the number of segments (to optimize data alignment, particularly on GPUs). |