Template Numerical Library version\ main:4e6e2c1
Loading...
Searching...
No Matches
TNL::Algorithms::Segments::SortedSegmentsView< EmbeddedSegmentsView_ > Class Template Reference

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

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

Inheritance diagram for TNL::Algorithms::Segments::SortedSegmentsView< EmbeddedSegmentsView_ >:
[legend]
Collaboration diagram for TNL::Algorithms::Segments::SortedSegmentsView< EmbeddedSegmentsView_ >:
[legend]

Public Types

using ConstPermutationView
using ConstViewType = SortedSegmentsView< EmbeddedSegmentsConstView >
 Type of constant segments view.
using DeviceType
 The device where the segments are operating.
using EmbeddedSegmentsConstView
using EmbeddedSegmentsView
using IndexType
 The type used for indexing of segments elements.
using PermutationView
template<typename Device_, typename Index_>
using ViewTemplate = SortedSegmentsView< typename EmbeddedSegmentsView::template ViewTemplate< Device_, Index_ > >
 Templated view type.
using ViewType = SortedSegmentsView< EmbeddedSegmentsView >
 Type of segments view.
Public Types inherited from TNL::Algorithms::Segments::SortedSegmentsBase< EmbeddedSegmentsView_ >
using ConstPermutationView = typename Containers::VectorView< std::add_const_t< IndexType >, DeviceType, IndexType >
using DeviceType = typename EmbeddedSegmentsView::DeviceType
 The device where the segments are operating.
using EmbeddedSegmentsConstView = typename EmbeddedSegmentsView::ConstViewType
using EmbeddedSegmentsView = EmbeddedSegmentsView_
using IndexType = typename EmbeddedSegmentsView::IndexType
 The type used for indexing of segments elements.
using PermutationView = typename Containers::VectorView< IndexType, DeviceType, IndexType >
using SegmentViewType = typename EmbeddedSegmentsView::SegmentViewType
 Accessor type for one particular segment.

Public Member Functions

__cuda_callable__ SortedSegmentsView ()=default
 Default constructor with no parameters to create empty segments view.
__cuda_callable__ SortedSegmentsView (const SortedSegmentsView &)=default
 Copy constructor.
__cuda_callable__ SortedSegmentsView (EmbeddedSegmentsView embeddedSegmentsView, PermutationView segmentsPermutation, PermutationView inverseSegmentsPermutation)
 Constructor with embedded segments view and segments permutation.
__cuda_callable__ SortedSegmentsView (SortedSegmentsView &&) noexcept=default
 Move constructor.
__cuda_callable__ void bind (const EmbeddedSegmentsConstView &embeddedSegmentsView, const ConstPermutationView &segmentsPermutation, const ConstPermutationView &inverseSegmentsPermutation)
 Method for rebinding (reinitialization) to another view.
__cuda_callable__ void bind (const EmbeddedSegmentsView &embeddedSegmentsView, const PermutationView &segmentsPermutation, const PermutationView &inverseSegmentsPermutation)
 Method for rebinding (reinitialization) to another view.
__cuda_callable__ void bind (SortedSegmentsView &&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 be 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.
SortedSegmentsViewoperator= (const SortedSegmentsView &)=delete
 Copy-assignment operator.
SortedSegmentsViewoperator= (SortedSegmentsView &&)=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::SortedSegmentsBase< EmbeddedSegmentsView_ >
__cuda_callable__ SortedSegmentsBase ()=default
 Default constructor with no parameters to create empty segments view.
__cuda_callable__ SortedSegmentsBase (const SortedSegmentsBase &)=default
 Copy constructor.
__cuda_callable__ SortedSegmentsBase (SortedSegmentsBase &&) noexcept=default
 Move constructor.
__cuda_callable__ IndexType getElementCount () const
 Returns the number of elements managed by all segments.
__cuda_callable__ EmbeddedSegmentsView getEmbeddedSegmentsView ()
__cuda_callable__ EmbeddedSegmentsConstView getEmbeddedSegmentsView () const
__cuda_callable__ IndexType getGlobalIndex (IndexType segmentIdx, IndexType localIdx) const
 Computes the global index of an element managed by the segments.
__cuda_callable__ PermutationView getInverseSegmentsPermutationView ()
 Returns a modifiable vector view with inverse segments permutation.
__cuda_callable__ ConstPermutationView getInverseSegmentsPermutationView () const
 Returns a constant vector view with inverse segments permutation..
__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__ PermutationView getSegmentsPermutationView ()
 Returns a modifiable vector view with segments permutation.
__cuda_callable__ ConstPermutationView getSegmentsPermutationView () const
 Returns a constant vector view with segments permutation..
__cuda_callable__ SegmentViewType getSegmentView (IndexType segmentIdx) const
 Returns a segment view (i.e., a segment accessor) for the specified segment index.
__cuda_callable__ IndexType getSigma () const
 Gets the value of sigma.
__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.
SortedSegmentsBaseoperator= (const SortedSegmentsBase &)=delete
 Copy-assignment operator.
SortedSegmentsBaseoperator= (SortedSegmentsBase &&)=delete
 Move-assignment operator.
__cuda_callable__ void setSigma (IndexType value)
 Sets the value of sigma.

Additional Inherited Members

Static Public Member Functions inherited from TNL::Algorithms::Segments::SortedSegmentsBase< EmbeddedSegmentsView_ >
static constexpr ElementsOrganization getOrganization ()
 Returns the data layout (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 bool havePadding ()
 This function denotes if the underlying segments use the padding elements.
Protected Member Functions inherited from TNL::Algorithms::Segments::SortedSegmentsBase< EmbeddedSegmentsView_ >
__cuda_callable__ void bind (const EmbeddedSegmentsView &embeddedSegmentsView, const PermutationView &segmentsPermutation, const PermutationView &inverseSegmentsPermutation)
 Re-initializes the internal attributes of the base class.
Protected Attributes inherited from TNL::Algorithms::Segments::SortedSegmentsBase< EmbeddedSegmentsView_ >
EmbeddedSegmentsView embeddedSegmentsView
PermutationView inverseSegmentsPermutationView
PermutationView segmentsPermutationView
 Vector view with the segments permutation.
IndexType sigma = -1

Detailed Description

template<typename EmbeddedSegmentsView_>
class TNL::Algorithms::Segments::SortedSegmentsView< EmbeddedSegmentsView_ >

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

Template Parameters
EmbeddedSegmentsis a type of segments used to manage the data.

Member Typedef Documentation

◆ ViewTemplate

template<typename EmbeddedSegmentsView_>
template<typename Device_, typename Index_>
using TNL::Algorithms::Segments::SortedSegmentsView< EmbeddedSegmentsView_ >::ViewTemplate = SortedSegmentsView< typename EmbeddedSegmentsView::template ViewTemplate< Device_, Index_ > >

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 EmbeddedSegmentsView_>
void TNL::Algorithms::Segments::SortedSegmentsView< EmbeddedSegmentsView_ >::load ( File & file)

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

Parameters
fileis the source file.

◆ save()

template<typename EmbeddedSegmentsView_>
void TNL::Algorithms::Segments::SortedSegmentsView< EmbeddedSegmentsView_ >::save ( File & file) const

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

Parameters
fileis the target file.

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