Base Class Reference

HiCR: HiCR::channel::variableSize::Base Class Reference
HiCR
HiCR::channel::variableSize::Base Class Reference

#include <base.hpp>

Inheritance diagram for HiCR::channel::variableSize::Base:
HiCR::channel::Base HiCR::channel::variableSize::MPSC::locking::Consumer HiCR::channel::variableSize::MPSC::locking::Producer HiCR::channel::variableSize::SPSC::Consumer HiCR::channel::variableSize::SPSC::Producer HiCR::channel::variableSize::MPSC::nonlocking::Producer

Protected Member Functions

 Base (CommunicationManager &communicationManager, const std::shared_ptr< LocalMemorySlot > &coordinationBufferForCounts, const std::shared_ptr< LocalMemorySlot > &coordinationBufferForPayloads, const size_t capacity, const size_t payloadCapacity)
 
__INLINE__ auto getCircularBufferForCounts () const
 
__INLINE__ auto getCircularBufferForPayloads () const
 
__INLINE__ auto getCoordinationBufferForCounts () const
 
__INLINE__ auto getCoordinationBufferForPayloads () const
 
- Protected Member Functions inherited from HiCR::channel::Base
 Base (CommunicationManager &communicationManager, const std::shared_ptr< LocalMemorySlot > &coordinationBuffer, const size_t tokenSize, const size_t capacity)
 
__INLINE__ CommunicationManagergetCommunicationManager () const
 
__INLINE__ auto getCoordinationBuffer () const
 

Additional Inherited Members

- Public Member Functions inherited from HiCR::channel::Base
__INLINE__ size_t getTokenSize () const noexcept
 
__INLINE__ size_t getDepth () const noexcept
 
__INLINE__ bool isFull () const noexcept
 
__INLINE__ bool isEmpty () const noexcept
 
__INLINE__ auto getCircularBuffer () const noexcept
 
- Static Public Member Functions inherited from HiCR::channel::Base
static __INLINE__ size_t getCoordinationBufferSize () noexcept
 
static __INLINE__ void initializeCoordinationBuffer (const std::shared_ptr< LocalMemorySlot > &coordinationBuffer)
 
static __INLINE__ size_t getTokenBufferSize (const size_t tokenSize, const size_t capacity) noexcept
 

Detailed Description

A HiCR variable-size channel base

Constructor & Destructor Documentation

◆ Base()

HiCR::channel::variableSize::Base::Base ( CommunicationManager communicationManager,
const std::shared_ptr< LocalMemorySlot > &  coordinationBufferForCounts,
const std::shared_ptr< LocalMemorySlot > &  coordinationBufferForPayloads,
const size_t  capacity,
const size_t  payloadCapacity 
)
inlineprotected

The constructor of the extended base Channel class.

It requires the user to provide the allocated memory slots for the exchange (data) and coordination buffers.

Parameters
[in]communicationManagerThe backend's memory manager to facilitate communication between the producer and consumer sides
[in]coordinationBufferForCountsThis is a small buffer that enables the consumer to signal how many payloads (as a count) it has popped.
[in]coordinationBufferForPayloadsThis is a small buffer that enables the consumer to signal how many bytes from the payload data it has popped.
[in]capacityThe maximum number of elements (possibly different-sized) that can be held by this channel
[in]payloadCapacityThe maximum number of total bytes (including all different sized elements) that will be held by this channel
Note
: The token size in var-size channels is used only internally, and is passed as having a type size_t (with size sizeof(size_t)) The key extension to the base channel class is the use of an extended circular buffer instead of a circular buffer. This is because we need to manage payload head and tail in addition to the head an tail pointers for different elements.

Member Function Documentation

◆ getCircularBufferForCounts()

__INLINE__ auto HiCR::channel::variableSize::Base::getCircularBufferForCounts ( ) const
inlineprotected

Gets the internal circular buffer used for token counts

Returns
the internal circular buffer used for token counts

◆ getCircularBufferForPayloads()

__INLINE__ auto HiCR::channel::variableSize::Base::getCircularBufferForPayloads ( ) const
inlineprotected

Gets the internal circular buffer used for token payloads

Returns
the internal circular buffer used for token payloads

◆ getCoordinationBufferForCounts()

__INLINE__ auto HiCR::channel::variableSize::Base::getCoordinationBufferForCounts ( ) const
inlineprotected

Gets the internal coordination buffer used for token counts

Returns
the internal coordination buffer used for token counts

◆ getCoordinationBufferForPayloads()

__INLINE__ auto HiCR::channel::variableSize::Base::getCoordinationBufferForPayloads ( ) const
inlineprotected

Gets the internal coordination buffer used for token payloads

Returns
the internal coordination buffer used for token payloads

The documentation for this class was generated from the following file:
  • /home/runner/work/HiCR/HiCR/include/hicr/frontends/channel/variableSize/base.hpp