|
|
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> |
| using | Self = ChunkedEllpack< Device_, Index_, IndexAllocator_, Organization_ > |
| | Templated type for creating ChunkedEllpack segments with different template parameters.
|
|
using | SliceInfoAllocator = typename Allocators::Default< Device >::template Allocator< typename Base::SliceInfoType > |
| using | SliceInfoContainer |
| template<typename Device_, typename Index_> |
| using | ViewTemplate = ChunkedEllpackView< Device_, Index_, Organization > |
| | Templated view type.
|
|
using | ViewType = ChunkedEllpackView< Device, Index, Organization > |
| | Type of segments view.
|
|
using | ConstOffsetsView |
| | The type for representing the constant vector view with segment offsets.
|
|
using | ConstSliceInfoContainerView |
|
using | DeviceType |
| | The device where the segments are operating.
|
|
using | IndexType |
| | The type used for indexing of segments elements.
|
|
using | OffsetsView |
| | The type for representing the vector view with segment offsets.
|
|
using | SegmentViewType |
| | Accessor type for one particular segment.
|
|
using | SliceInfoContainerView |
|
using | SliceInfoType |
| using | ViewTemplate |
| | Templated view type.
|
|
|
| ChunkedEllpack ()=default |
| | Constructor with no parameters to create empty segments.
|
|
| ChunkedEllpack (ChunkedEllpack &&segments) noexcept=default |
| | Move constructor.
|
|
| ChunkedEllpack (const ChunkedEllpack &segments) |
| | Copy constructor (makes deep copy).
|
| template<typename SizesContainer, std::enable_if_t< IsArrayType< SizesContainer >::value, bool > = true> |
| | ChunkedEllpack (const SizesContainer &segmentsSizes) |
| | Constructor that initializes segments based on their sizes.
|
| template<typename ListIndex> |
| | ChunkedEllpack (const std::initializer_list< ListIndex > &segmentsSizes) |
| | Constructor that initializes segments using an initializer list.
|
|
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.
|
|
ChunkedEllpack & | operator= (ChunkedEllpack &&) noexcept(false) |
| | Move-assignment operator.
|
|
ChunkedEllpack & | operator= (const ChunkedEllpack &segments) |
| | Copy-assignment operator (makes a deep copy).
|
| template<typename Device_, typename Index_, typename IndexAllocator_, ElementsOrganization Organization_> |
| ChunkedEllpack & | operator= (const ChunkedEllpack< Device_, Index_, IndexAllocator_, Organization_ > &segments) |
| | Assignment operator for segments with different template parameters.
|
|
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 &segmentsSizes) |
| | Set sizes of particular segments.
|
|
__cuda_callable__ | ChunkedEllpackBase ()=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 | getChunksInSlice () const |
| | Returns the number of chunks in a slice.
|
|
__cuda_callable__ OffsetsView | getChunksToSegmentsMappingView () |
| | Returns a modifiable vector view with mapping of chunks to segments.
|
|
__cuda_callable__ IndexType | getDesiredChunkSize () const |
| | Returns the desired chunk size.
|
|
__cuda_callable__ IndexType | getElementCount () const |
| | Returns the number of elements managed by all segments.
|
| __cuda_callable__ IndexType | getGlobalIndex (IndexType segmentIdx, IndexType localIdx) const |
| | Computes the global index of an element managed by the segments.
|
|
__cuda_callable__ IndexType | getNumberOfSlices () const |
| | Returns the number of slices.
|
|
__cuda_callable__ IndexType | getSegmentCount () const |
| | Returns the number of segments.
|
|
__cuda_callable__ OffsetsView | getSegmentPointersView () |
| | Returns a modifiable vector view with segment pointers.
|
|
__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 | getSegmentToChunkMappingView () |
| | Returns a modifiable vector view with mapping of segments to chunks.
|
|
__cuda_callable__ OffsetsView | getSegmentToSliceMappingView () |
| | Returns a modifiable vector view with mapping of segments to slices.
|
| __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__ SliceInfoContainerView | getSlicesView () |
| | Returns a modifiable view with slice information.
|
|
__cuda_callable__ IndexType | getStorageSize () const |
| | Returns number of elements that needs to be allocated by a container connected to this segments.
|
|
ChunkedEllpackBase & | operator= (const ChunkedEllpackBase &)=delete |
| | Copy-assignment operator.
|
|
void | printStructure (std::ostream &str) const |
| | Prints the structure of the segments to the output stream.
|
template<typename Device, typename Index, typename IndexAllocator = typename Allocators::Default< Device >::template Allocator< Index >,
ElementsOrganization Organization = DefaultElementsOrganization< Device >::getOrganization()>
class TNL::Algorithms::Segments::ChunkedEllpack< Device, Index, IndexAllocator, Organization >
Data structure for Chunked Ellpack segments.
Chunked Ellpack segments are inspired by the paper [Heller M., Oberhuber T., Improved Row-grouped CSR Format for Storing of Sparse Matrices on GPU, Proceedings of Algoritmy 2012, 2012, Handlovičová A., Minarechová Z. and Ševčovič D. (ed.), pages 282-290](https://geraldine.fjfi.cvut.cz/~oberhuber/data/vyzkum/publikace/12-heller-oberhuber-improved-rgcsr-format.pdf).
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. |