cuda::experimental::stf::sump::if_equal#

template<class _Status, class ..._More>
auto cuda::experimental::stf::sump::if_equal(
const _Status __first,
const _More... __more
)#

Restricts a policy to failing statuses equal to any of the given values: if_equal(v1, v2, ...)(p) offers a status to p when it equals one of the values, and otherwise passes it through.

The values share one status type, and the operand must be a status of that same type. On the exception channel there is nothing to match and the exception passes through, so the selector can head a |:

(if_equal(cudaErrorNotReady)(noop) | unwind) << cudaStreamQuery(s); // not-ready is fine; anything else
unwinds

Parameters:
  • __first – [in] The first status value to match.

  • __more – [in] Further status values to match, of the same type as __first.

Returns:

A selector; calling it with a policy p yields the restricted policy.