Skip to main content

baracuda_runtime/
error.rs

1//! Error type for `baracuda-runtime`.
2
3use baracuda_cuda_sys::runtime::cudaError_t;
4
5/// A runtime-API error: a non-success `cudaError_t`, a loader failure, or a
6/// feature-not-supported-on-this-driver error.
7pub type Error = baracuda_core::Error<cudaError_t>;
8
9/// Convenient `Result` alias.
10pub type Result<T, E = Error> = core::result::Result<T, E>;
11
12/// Turn a raw `cudaError_t` into `Result<()>`.
13#[inline]
14pub(crate) fn check(status: cudaError_t) -> Result<()> {
15    Error::check(status)
16}