Template Numerical Library: TNL::Algorithms::Segments::SlicedEllpackView< Device, Index, Organization, SliceSize > Class Template Reference

Template Numerical Library version\ main:c7077e4fd

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
TNL::Algorithms::Segments::SlicedEllpackView< Device, Index, Organization, SliceSize > Class Template Reference

SlicedEllpackView is provides a non-owning encapsulation of meta-data stored in the TNL::Algorithms::Segments::SlicedEllpack segments. More...

`#include <TNL/Algorithms/Segments/SlicedEllpackView.h>`

Inheritance diagram for TNL::Algorithms::Segments::SlicedEllpackView< Device, Index, Organization, SliceSize >:
[legend]
Collaboration diagram for TNL::Algorithms::Segments::SlicedEllpackView< Device, Index, Organization, SliceSize >:
[legend]

## Public Types
using | ConstViewType = SlicedEllpackView< Device, std::add_const_t< Index >, Organization, SliceSize >
| Type of constant segments view.
template<typename Device_, typename Index_>
using | ViewTemplate = SlicedEllpackView< Device_, Index_, Organization, SliceSize >
| Templated view type.
using | ViewType = SlicedEllpackView
| Type of segments view.
Public Types inherited from TNL::Algorithms::Segments::SlicedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), 32 >
using | ConstOffsetsView
| The type for representing the constant vector view with segment offsets.
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.

## Public Member Functions
__cuda_callable__ | SlicedEllpackView ()=default
| Default constructor with no parameters to create empty segments view.
__cuda_callable__ | SlicedEllpackView (const SlicedEllpackView &)=default
| Copy constructor.
__cuda_callable__ | SlicedEllpackView (Index size, Index alignedSize, Index segmentsCount, typename Base::OffsetsView sliceOffsets, typename Base::OffsetsView sliceSegmentSizes)
| Constructor that initializes segments based all necessary data.
__cuda_callable__ | SlicedEllpackView (SlicedEllpackView &&) noexcept=default
| Move constructor.
__cuda_callable__ void | bind (SlicedEllpackView view)
| Method for rebinding (reinitialization) to another view.
__cuda_callable__ 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.
__cuda_callable__ 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.
SlicedEllpackView & | operator= (const SlicedEllpackView &)=delete
| Copy-assignment operator.
SlicedEllpackView & | operator= (SlicedEllpackView &&)=delete
| Move-assignment operator.
void | save (File &file) const
| Method for saving the segments to a file in a binary form.
Public Member Functions inherited from TNL::Algorithms::Segments::SlicedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), 32 >
__cuda_callable__ | SlicedEllpackBase ()=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 | 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__ OffsetsView | getSliceOffsetsView ()
| Returns a modifiable vector view with the offsets of particular slices.
__cuda_callable__ OffsetsView | getSliceSegmentSizesView ()
| Returns a modifiable vector view with the segment sizes in particular slices.
__cuda_callable__ IndexType | getStorageSize () const
| Returns number of elements that needs to be allocated by a container connected to this segments.
SlicedEllpackBase & | operator= (const SlicedEllpackBase &)=delete
| Copy-assignment operator.

## Additional Inherited Members
Static Public Member Functions inherited from TNL::Algorithms::Segments::SlicedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), 32 >
static constexpr ElementsOrganization | getOrganization ()
| Returns the data layout.
static std::string | getSegmentsType ()
| Returns string with the segments type.
static std::string | getSerializationType ()
| Returns string with the serialization type.
static constexpr int | getSliceSize ()
| Returns the size of each slice.
static constexpr bool | havePadding ()
| This function denotes that the SlicedEllpack format use padding elements.
Protected Member Functions inherited from TNL::Algorithms::Segments::SlicedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), 32 >
__cuda_callable__ void | bind (IndexType size, IndexType storageSize, IndexType segmentsCount, OffsetsView sliceOffsets, OffsetsView sliceSegmentSizes)
| Re-initializes the internal attributes of the base class.
Protected Attributes inherited from TNL::Algorithms::Segments::SlicedEllpackBase< Device, Index, Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), 32 >
IndexType | segmentsCount
IndexType | size
OffsetsView | sliceOffsets
OffsetsView | sliceSegmentSizes
IndexType | storageSize

## Detailed Description

template<typename Device, typename Index, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), int SliceSize = 32>
class TNL::Algorithms::Segments::SlicedEllpackView< Device, Index, Organization, SliceSize >

SlicedEllpackView is provides a non-owning encapsulation of meta-data stored in the TNL::Algorithms::Segments::SlicedEllpack segments.

Template Parameters

  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.
  SliceSize | is the size of each slice.

## Member Typedef Documentation

## ◆ ViewTemplate

template<typename Device, typename Index, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), int SliceSize = 32>
template<typename Device_, typename Index_>

using TNL::Algorithms::Segments::SlicedEllpackView< Device, Index, Organization, SliceSize >::ViewTemplate = SlicedEllpackView< Device_, Index_, Organization, SliceSize >

Templated view type.

Template Parameters

  Device_ | is alternative device type for the view.
  Index_ | is alternative index type for the view.

## Member Function Documentation

## ◆ load()

template<typename Device, typename Index, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), int SliceSize = 32>

void TNL::Algorithms::Segments::SlicedEllpackView< Device, Index, Organization, SliceSize >::load | ( | File & | file | ) |

Method for loading the segments from a file in a binary form.

Parameters

  file | is the source file.

## ◆ save()

template<typename Device, typename Index, ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(), int SliceSize = 32>

void TNL::Algorithms::Segments::SlicedEllpackView< Device, Index, Organization, SliceSize >::save | ( | File & | file | ) | const

Method for saving the segments to a file in a binary form.

Parameters

  file | is the target file.

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

- src/TNL/Algorithms/Segments/SlicedEllpackView.h