/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.
78 : channel::fixedSize::Base(communicationManager, internalCoordinationBuffer, tokenSize, capacity),
85 HICR_THROW_LOGIC("The passed token buffer slot was not created locally (it must be to be used internally by the channel implementation)\n");
123 HICR_THROW_LOGIC("Attempting to peek for a token with position (%lu), which is beyond than the channel capacity (%lu)", pos, getCircularBuffer()->getCapacity());
133 HICR_THROW_RUNTIME("Attempting to peek position (%lu) but not enough tokens (%lu) are in the buffer", pos, getCircularBuffer()->getDepth());
136 const size_t bufferPos = (getCircularBuffer()->getTailPosition() + pos) % getCircularBuffer()->getCapacity();
158 HICR_THROW_LOGIC("Attempting to pop (%lu) tokens, which is larger than the channel capacity (%lu)", n, getCircularBuffer()->getCapacity());
165 HICR_THROW_RUNTIME("Attempting to pop (%lu) tokens, which is more than the number of current tokens in the channel (%lu)", n, getCircularBuffer()->getDepth());
193 [[nodiscard]] __INLINE__ std::shared_ptr<GlobalMemorySlot> getTokenBuffer() const { return _tokenBuffer; }
Definition communicationManager.hpp:54
virtual __INLINE__ void flushReceived()
Definition communicationManager.hpp:492
__INLINE__ void memcpy(const std::shared_ptr< LocalMemorySlot > &destination, size_t dst_offset, const std::shared_ptr< LocalMemorySlot > &source, size_t src_offset, size_t size)
Definition communicationManager.hpp:267
__INLINE__ void fence(GlobalMemorySlot::tag_t tag)
Definition communicationManager.hpp:377
__INLINE__ CommunicationManager * getCommunicationManager() const
Definition base.hpp:217
__INLINE__ auto getCoordinationBuffer() const
Definition base.hpp:223
__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__ auto getCircularBuffer() const noexcept
Definition base.hpp:167
Definition base.hpp:42
Definition consumer.hpp:41
Consumer(CommunicationManager &communicationManager, 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:72
__INLINE__ size_t peek(const size_t pos=0)
Definition consumer.hpp:119
__INLINE__ void pop(const size_t n=1)
Definition consumer.hpp:155
__INLINE__ void updateDepth()
Definition consumer.hpp:185
__INLINE__ std::shared_ptr< GlobalMemorySlot > getTokenBuffer() const
Definition consumer.hpp:193
Provides a failure model and corresponding exception classes.
Provides base functionality for a fixed-size MPSC channel over HiCR.
Generated by