/home/runner/work/HiCR/HiCR/include/hicr/frontends/channel/fixedSize/spsc/consumer.hpp Source File
|
HiCR
|
consumer.hpp
Go to the documentation of this file.
80 : channel::fixedSize::Base(coordinationCommunicationManager, payloadCommunicationManager, internalCoordinationBuffer, tokenSize, capacity),
87 HICR_THROW_LOGIC("The passed token buffer slot was not created locally (it must be to be used internally by the channel implementation)\n");
125 HICR_THROW_LOGIC("Attempting to peek for a token with position (%lu), which is beyond than the channel capacity (%lu)", pos, getCircularBuffer()->getCapacity());
136 HICR_THROW_RUNTIME("Attempting to peek position (%lu) but not enough tokens (%lu) are in the buffer", pos, getCircularBuffer()->getDepth());
139 const size_t bufferPos = (getCircularBuffer()->getTailPosition() + pos) % getCircularBuffer()->getCapacity();
161 HICR_THROW_LOGIC("Attempting to pop (%lu) tokens, which is larger than the channel capacity (%lu)", n, getCircularBuffer()->getCapacity());
168 HICR_THROW_RUNTIME("Attempting to pop (%lu) tokens, which is more than the number of current tokens in the channel (%lu)", n, getCircularBuffer()->getDepth());
198 [[nodiscard]] __INLINE__ std::shared_ptr<GlobalMemorySlot> getTokenBuffer() const { return _tokenBuffer; }
Definition communicationManager.hpp:54
virtual __INLINE__ void flushReceived()
Definition communicationManager.hpp:469
__INLINE__ auto getCoordinationBuffer() const
Definition base.hpp:235
__INLINE__ size_t getTokenSize() const noexcept
Definition base.hpp:84
static __INLINE__ size_t getTokenBufferSize(const size_t tokenSize, const size_t capacity) noexcept
Definition base.hpp:123
__INLINE__ CommunicationManager * getPayloadCommunicationManager() const
Definition base.hpp:223
__INLINE__ CommunicationManager * getCoordinationCommunicationManager() const
Definition base.hpp:229
__INLINE__ auto getCircularBuffer() const noexcept
Definition base.hpp:167
Definition base.hpp:42
Definition consumer.hpp:41
Consumer(CommunicationManager &coordinationCommunicationManager, CommunicationManager &payloadCommunicationManager, const std::shared_ptr< GlobalMemorySlot > &tokenBuffer, const std::shared_ptr< LocalMemorySlot > &internalCoordinationBuffer, std::shared_ptr< GlobalMemorySlot > producerCoordinationBuffer, const size_t tokenSize, const size_t capacity)
Definition consumer.hpp:73
__INLINE__ size_t peek(const size_t pos=0)
Definition consumer.hpp:121
__INLINE__ void pop(const size_t n=1)
Definition consumer.hpp:158
__INLINE__ void updateDepth()
Definition consumer.hpp:190
__INLINE__ std::shared_ptr< GlobalMemorySlot > getTokenBuffer() const
Definition consumer.hpp:198
Provides a failure model and corresponding exception classes.
Provides base functionality for a fixed-size MPSC channel over HiCR.
Generated by