21 if (!(
_raw.flags & FI_REMOTE_CQ_DATA))
31 return (
_raw.flags & FI_RMA) && (
_raw.flags & FI_REMOTE_WRITE);
36 return (
_raw.flags & FI_RMA) && (
_raw.flags & FI_WRITE);
44 _raw.err_data =
nullptr;
45 _raw.err_data_size = 0;
83 std::uniform_int_distribution<Completion::Token> dist;
84 std::random_device rd;
85 std::mt19937 eng{rd()};
92 if (
auto error = std::get_if<Error>(&
_inner); error)
112 if (
auto error = std::get_if<Error>(&
_inner); error)
122 return std::holds_alternative<Data>(
_inner);
127 return std::holds_alternative<Error>(
_inner);
Data variant of the completion entry instance.
bool isLocalWrite() const noexcept
Indicates whether the completion entry represents a local write operation.
Completion::Token token() const noexcept
This used to associate a completion entry with an endpoint when multiple endpoints use the same compl...
std::optional< std::uint64_t > data() const noexcept
Accessor for the immediate data associated with the completion entry.
Data(::fi_cq_data_entry const &raw)
bool isRemoteWrite() const noexcept
Indicates whether the completion entry represents a remote write operation.
Error variant of the completion entry instance.
std::string toString() const
Generate a hman-readable string representation of the error entry.
Token token() const noexcept
This used to associate a completion entry with an endpoint when multiple endpoints use the same compl...
Error(::fi_cq_err_entry const &raw, std::shared_ptr< CompletionQueue > queue)
std::shared_ptr< CompletionQueue > _cq
Token token() const noexcept
Get the token that was associated with the operation that has completed.
static constexpr Token tokenFromContextValue(void *contextValue) noexcept
Convert between completion tokens and context values that can be written to and read from raw libfabr...
bool isErrEntry() const noexcept
check whether this is an error entry
Data data() const
Accessor for the data variant. Calling this on an error entry will throw.
static Token randomToken()
std::uintptr_t Token
A token used to associate a completion entry with an endpoint.
std::optional< Data > tryData() const noexcept
Attempt to access the data variant. Returns std::nullopt if this is an error entry.
std::optional< Error > tryErr() const noexcept
Attempt to access the error variant. Returns std::nullopt if this is a data entry.
bool isDataEntry() const noexcept
Check whether this is a data entry.
Error err() const
Accessor for the error variant. Calling this on a data entry will throw.
static Exception invalidState(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INVALID_STATE exception.
::fi_info * raw() noexcept
Returns the raw fi_info object managed by this FabricInfo instance.