Skip to main content

cudaGetLastError

Function cudaGetLastError 

Source
pub unsafe extern "C" fn cudaGetLastError() -> cudaError_t
Expand description

Returns the last error from a runtime call.

Returns the last error that has been produced by any of the runtime calls in the same instance of the CUDA Runtime library in the host thread and resets it to cudaError_t::CUDA_SUCCESS.

Note: Multiple instances of the CUDA Runtime library can be present in an application when using a library that statically links the CUDA Runtime.

Note that this function may also return error codes from previous, asynchronous launches.

Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.

Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.

ยงReturn value

See also: cudaPeekAtLastError, cudaGetErrorName, cudaGetErrorString, cudaError.