cuda::experimental::stf::sump::returned#
-
template<class _S = void, class _X>
auto cuda::experimental::stf::sump::returned( - _X &&__x
The code channel, as a selector or as a conversion.
Given a policy,
returned(p)appliespto failing statuses only, and an exception passes through it; see thrown.Given a function,
returned<S>(f)converts: for a failing status of typeS, the answer isf(s); statuses of other types and exceptions forward. The answer follows the same protocol as everywhere: a value of typeSsubstitutes,voidis Nothing,nullvalnever returns, and a throw fromfturns the status into that exception:returned<cudaError_t>([](cudaError_t s) -> cudaError_t { throw std::runtime_error(cudaGetErrorName(s)); })
- Parameters:
__x – [in] The policy, or the function taking an
S.- Returns:
The selector or converter policy.