pub(crate) fn check(error: DeviceError, api_name: &str) -> Result<()> {
    match error {
        DeviceError::CUDA_SUCCESS => Ok(()),
        DeviceError::CUDA_ERROR_ASSERT => Err(AccelError::DeviceAssertionFailed),
        DeviceError::CUDA_ERROR_NOT_READY => Err(AccelError::AsyncOperationNotReady),
        _ => Err(AccelError::CUDAError {
            api_name: api_name.into(),
            error,
        }),
    }
}
/// Convert return code of CUDA Driver/Runtime API into Result
Convert return code of CUDA Driver/Runtime API into Result
Convert return code of CUDA Driver / Runtime API into Result
pub(crate) fn check(error: DeviceError, api_name: &str) -> Result<()> {
    match error {
        DeviceError::CUDA_SUCCESS => Ok(()),
        DeviceError::CUDA_ERROR_ASSERT => Err(AccelError::DeviceAssertionFailed),
        DeviceError::CUDA_ERROR_NOT_READY => Err(AccelError::AsyncOperationNotReady),
        _ => Err(AccelError::CUDAError {
            api_name: api_name.into(),
            error,
        }),
    }
}
pub ( crate ) fn check ( error : DeviceError , api_name : & str ) -> Result < ( ) > { match error { DeviceError :: CUDA_SUCCESS => Ok ( ( ) ) , DeviceError :: CUDA_ERROR_ASSERT => Err ( AccelError :: DeviceAssertionFailed ) , DeviceError :: CUDA_ERROR_NOT_READY => Err ( AccelError :: AsyncOperationNotReady ) , _ => Err ( AccelError :: CUDAError { api_name : api_name . into ( ) , error , } ) , } }
Convert return code of CUDA Driver/Runtime API into Result
Convert return code of CUDA Driver / Runtime API into Result
error
DeviceError
api_name
&str
error
DeviceError
api_name
&str