28 domain->registerRegions(
_regions, FI_REMOTE_WRITE);
31 return domain->remoteRegions();
41 if (endpoint.
domain()->usingRecvBufForCqData())
49 auto completionData = completion.
tryData();
60 auto immData = completionData->data();
75 return std::make_optional<Target::GrainReadResult>(grainIndex);
115 domain->registerRegions(
_bounceBuffer.getRegions(), FI_REMOTE_WRITE);
118 return domain->remoteRegions();
131 if (endpoint.
domain()->usingRecvBufForCqData())
139 auto completionData = completion.
tryData();
150 auto const immData = completionData->data();
157 if (header.count == 0)
161 return std::make_optional<Target::SampleReadResult>(header.headIndex, header.count);
190 auto const entrySize = oneSampleSize * maxSyncBatchSize;
191 auto const historySize = layout.
bufferLength * oneSampleSize;
193 auto const entryCount = (historySize + entrySize - 1U) / entrySize;
195 MXL_INFO(
"Creating audio bounce buffer with entry size {} bytes and entry count {}, maxSyncBatchSize {} historySize {} bufferLength {}",
201 return {entryCount, entrySize, layout};
A bounce buffer for audio samples.
Type to represent a completion entry from a CompletionQueue.
std::optional< Data > tryData() const noexcept
Attempt to access the data variant. Returns std::nullopt if this is an error entry.
RAII Wrapper around a libfabric endpoint (fi_ep).
std::shared_ptr< Domain > domain() const
Get the domain that the endpoint has beed created on.
void recv(LocalRegion region) const
Push a recv work request to the endpoint work queue.
static Exception invalidState(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INVALID_STATE exception.
Immediate data representation for discrete flow transfers.
Unpacked unpack() const noexcept
Unpack the immediate data into ring buffer index and slice index.
virtual std::optional< Target::ReadResult > read(Endpoint const &endpoint, Completion const &completion) override
std::vector< Region > _regions
virtual bool canReadGrains() const noexcept override
This protocol can read grains, but not samples, since it is designed for remote writes of grain buffe...
std::optional< Target::ImmediateDataLocation > _immDataBuffer
virtual std::optional< TargetInfoBounceBufferInfo > bounceBufferInfo() const override
RMAGrainIngressProtocol(std::vector< Region > regions)
virtual bool canReadSamples() const noexcept override
This protocol cannot read samples, since it is designed for remote writes of grain buffers.
virtual void reset() override
LocalRegion immDataRegion()
virtual std::vector< RemoteRegion > registerMemory(std::shared_ptr< Domain > domain) override
Register local memory regions used in this protocol.
virtual void start(Endpoint const &endpoint) override
Start receiving.
virtual std::optional< Target::ReadResult > read(Endpoint const &endpoint, Completion const &completion) override
virtual bool canReadGrains() const noexcept override
This protocol cannot read grains, since it is designed for remote writes of audio samples.
virtual std::optional< TargetInfoBounceBufferInfo > bounceBufferInfo() const override
AudioBounceBuffer makeAudioBounceBuffer(DataLayout::Continuous const &layout, std::uint32_t maxSyncBatchSize)
Helper function to create an AudioBounceBuffer based on the given audio data layout and maximum synch...
std::optional< Target::ImmediateDataLocation > _immDataBuffer
virtual bool canReadSamples() const noexcept override
This protocol can read samples, since it is designed for remote writes of audio samples.
RMASampleIngressProtocol(Region region, DataLayout::Continuous const &dataLayout, std::uint32_t maxSyncBatchSize)
AudioBounceBuffer _bounceBuffer
virtual std::vector< RemoteRegion > registerMemory(std::shared_ptr< Domain > domain) override
Register local memory regions used in this protocol.
virtual void start(Endpoint const &endpoint) override
Start receiving.
LocalRegion immDataRegion()
virtual void reset() override
Represent a memory region (unregistered).
std::uint64_t getGrainIndexInRingSlot(std::vector< Region > const ®ions, std::uint16_t slot)
void setValidSlicesForGrain(std::vector< Region > const ®ions, std::uint16_t slot, std::uint16_t validSlices)
Continuous layout variant of DataLayout.
Represent a source memory region used for for data transfer.
Information about the bounce buffer on the target, if the target uses one.