14#include <rdma/fi_domain.h>
46 std::uint64_t
id()
const noexcept;
51 ::fi_hmem_iface
iface()
const noexcept;
56 std::string
toString()
const noexcept;
61 bool isHost()
const noexcept;
81 using Inner = std::variant<Host, Cuda>;
112 ::iovec
const*
asIovec() const noexcept;
117 ::iovec
toIovec() const noexcept;
145 :
_inner(std::move(inner))
182 std::size_t
size() const noexcept
188 ::iovec
const*
asIovec() const noexcept;
191 static std::vector<::iovec> iovecsFromGroup(std::vector<
Region> const& group) noexcept;
217 std::vector<Region>
const& regions() const noexcept;
220 DataLayout const& dataLayout() const noexcept;
223 std::uint32_t maxSyncBatchSize() const noexcept;
Describes the layout of data within memory regions.
Represent a collection of memory regions.
friend MxlRegions mxlFabricsRegionsFromMutableFlow(FlowData &flow)
Convert a FlowData's memory regions to MxlRegions. FlowData are obtained from an MXL FlowWriter or Fl...
MxlRegions(std::vector< Region > regions, DataLayout dataLayout, std::uint32_t maxSyncBatchSize=0)
DataLayout const & dataLayout() const noexcept
std::vector< Region > const & regions() const noexcept
View accessor for the underlying regions.
std::vector< Region > _regions
friend MxlRegions mxlFabricsRegionsFromFlow(FlowData &flow)
std::uint32_t _maxSyncBatchSize
std::uint32_t maxSyncBatchSize() const noexcept
const_iterator begin() const
static std::vector<::iovec > iovecsFromGroup(std::vector< Region > const &group) noexcept
Region const & operator[](std::size_t index) const
std::vector< Region >::const_iterator const_iterator
std::vector<::iovec > _iovecs
std::size_t size() const noexcept
std::vector< Region >::iterator iterator
Region & operator[](std::size_t index)
std::vector< Region > _inner
const_iterator end() const
RegionGroup(std::vector< Region > inner)
Represent a host memory location variant.
Represent the location of a memory region.
std::variant< Host, Cuda > Inner
std::string toString() const noexcept
Generate a string representation of the memory location.
std::uint64_t id() const noexcept
Return the device id. For host location 0 is returned.
static Location host() noexcept
specify a host memory location.
static Location cuda(int deviceId) noexcept
specify a CUDA device memory location.
bool isHost() const noexcept
Return true if the memory location is on host.
::fi_hmem_iface iface() const noexcept
Convert the current location to libfabric "iface" representation.
Represent a memory region (unregistered).
::iovec toIovec() const noexcept
Convert the Region to an iovec structure.
Region(std::uintptr_t base, std::size_t size, std::uint64_t const *grainIndexPtr, std::uint16_t *validSlicesPtr, Location loc=Location::host()) noexcept
Construct a Region object.
::iovec iovecFromRegion(std::uintptr_t, std::size_t) noexcept
::iovec const * asIovec() const noexcept
Return the underlying iovec structure representing the memory region.
std::uint16_t * validSlicesPtr
std::uint64_t const * grainIndexPtr
struct mxlFlowReader_t * mxlFlowReader
struct mxlFlowWriter_t * mxlFlowWriter
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)