GEOS
Public Types | Public Member Functions | List of all members
geos::ElementsReporterBuffer Class Reference

A buffer to count and store element ids during kernel execution. This facilitates the reporting mechanism by allowing a preallocated space for storing & counting elements. More...

#include <SolutionCheckHelpers.hpp>

Public Types

using ElementCount = ElementsReporterCollector::ElementCount
 Type alias for elements count (e.g., localIndex, globalIndex).
 

Public Member Functions

 ElementsReporterBuffer (bool enabled, ElementCount maxCollectionSize)
 Construct a preallocated buffer to collect a limited quantity of ids in kernels. More...
 
 ElementsReporterBuffer (ElementsReporterBuffer &&other)=default
 Transfers ownership of an ElementsReporterBuffer to another instance (move semantics).
 
ElementsReporterBufferoperator= (ElementsReporterBuffer &&other)=default
 Transfers ownership of an ElementsReporterBuffer to another instance (move semantics).
 
 ElementsReporterBuffer (ElementsReporterBuffer const &)=delete
 Copying prevented as it doesn't seem relevant / useful.
 
ElementsReporterBufferoperator= (ElementsReporterBuffer const &)=delete
 Copying prevented as it doesn't seem relevant / useful.
 
ElementCount getSignaledElementsCount () const
 
ElementCount getCollectedElementsCount () const
 
ElementReport const & operator[] (ElementCount id) const
 
auto begin () const
 
auto end () const
 
bool enabled () const
 
bool empty () const
 
bool isComplete () const
 
ElementsReporterCollector createCollector (arrayView1d< globalIndex const > const &localToGlobalId) const
 
ElementsReporterOutput createOutput () const
 

Detailed Description

A buffer to count and store element ids during kernel execution. This facilitates the reporting mechanism by allowing a preallocated space for storing & counting elements.

Definition at line 88 of file SolutionCheckHelpers.hpp.

Constructor & Destructor Documentation

◆ ElementsReporterBuffer()

geos::ElementsReporterBuffer::ElementsReporterBuffer ( bool  enabled,
ElementCount  maxCollectionSize 
)

Construct a preallocated buffer to collect a limited quantity of ids in kernels.

Parameters
maxCollectionSizeLimit of the buffer. If 0, the buffering functionnality is disabled and only the counting is enabled.

Member Function Documentation

◆ begin()

auto geos::ElementsReporterBuffer::begin ( ) const
inline
Returns
iterator pointing at beginning of collected elements in the buffer.

Definition at line 143 of file SolutionCheckHelpers.hpp.

◆ createCollector()

ElementsReporterCollector geos::ElementsReporterBuffer::createCollector ( arrayView1d< globalIndex const > const &  localToGlobalId) const
Returns
A view on the ids array owned by the instance. -> change comment to explain the interest for kernels

◆ empty()

bool geos::ElementsReporterBuffer::empty ( ) const
inline
Returns
true when there are no elements collected (always false when enabled() is false).

Definition at line 161 of file SolutionCheckHelpers.hpp.

◆ enabled()

bool geos::ElementsReporterBuffer::enabled ( ) const
inline
Returns
true when the collection of elements is enabled.

Definition at line 155 of file SolutionCheckHelpers.hpp.

◆ end()

auto geos::ElementsReporterBuffer::end ( ) const
inline
Returns
iterator pointing after the last collected element in the buffer.

Definition at line 149 of file SolutionCheckHelpers.hpp.

◆ getCollectedElementsCount()

ElementCount geos::ElementsReporterBuffer::getCollectedElementsCount ( ) const
inline
Returns
the collected elements that could effectivly be stored (zero if no collection is enabled).

Definition at line 131 of file SolutionCheckHelpers.hpp.

◆ getSignaledElementsCount()

ElementCount geos::ElementsReporterBuffer::getSignaledElementsCount ( ) const
inline
Returns
the count of signaled elements.

Definition at line 125 of file SolutionCheckHelpers.hpp.

◆ isComplete()

bool geos::ElementsReporterBuffer::isComplete ( ) const
inline
Returns
true if the collection of elements completely fills the buffer.

Definition at line 167 of file SolutionCheckHelpers.hpp.

◆ operator[]()

ElementReport const& geos::ElementsReporterBuffer::operator[] ( ElementCount  id) const
inline
Returns
a reference to an element report by its ID within the buffer (0 -> collected count-1).

Definition at line 137 of file SolutionCheckHelpers.hpp.


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