cuda::experimental::stf::cuda_safe_call

Defined in include/cuda/experimental/__stf/utility/cuda_safe_call.cuh

template<typename T>
void cuda::experimental::stf::cuda_safe_call(const T status, const cuda::std::source_location loc = cuda::std::source_location::current())

Enforces successful call of CUDA API functions.

If status is 0, the function has no effect. Otherwise, the function prints pertinent error information to stderr and aborts the program.

Template Parameters

T – status type, can be cudaError_t, cublasStatus_t, or cusolverStatus_t

Parameters
  • status – status value, usually the result of a CUDA API call

  • loc – location of the call, defaulted