cuda::experimental::stf::operator|=#

Overloads#

operator|=(lhs, rhs)#

inline access_mode &cuda::experimental::stf::operator|=(
access_mode &lhs,
access_mode rhs
)

In-place version of operator|

operator|=(noexcept)#

template<class _Fn, ::cuda::std::enable_if_t<::cuda::std::is_invocable_v<_Fn&>, int> = 0>
::std::exception_ptr &cuda::experimental::stf::operator|=(
::std::exception_ptr &__first,
_Fn &&__step
) noexcept

Runs __step; if it throws, the exception is kept in __first unless one is already there, and control continues.

This is the spelling for a function that ends something (a pop, a finalize, a release): such a function must complete its state transition whatever its individual steps report, and only then act on the failure. Write each step as e |= [&] { ... }; on a std::exception_ptr e;, and finish with the algebra deciding what the failure becomes: if (e) on_throw(policy) << [&] { std::rethrow_exception(e); };. Later failures are dropped; in practice they are echoes of the first (an asynchronous CUDA fault surfaces again at every later synchronize). |= reads as the algebra’s |: first claim, the left operand keeps its failure if it has one. Implemented on defer, so it inherits the header’s behaviour when exceptions are disabled. Nothing is allocated unless a step fails.

Lookup: the operator lives in this namespace and is found through the closure type’s associated namespace, so it works unqualified wherever the lambda is written inside cuda::experimental::stf; user code elsewhere names it with using cuda::experimental::stf::operator|=;.