Skip to main content

dynlink_cuda/
error.rs

1// Copyright (C) The Strand-Braid Authors
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4use thiserror::Error;
5
6#[derive(Error, Debug)]
7pub enum CudaError {
8    #[error("dynamic library `{lib}` could not be loaded: `{source}`")]
9    DynLibLoadError {
10        lib: String,
11        source: libloading::Error,
12    },
13    #[error("CUDA returned code `{status}`")]
14    ErrCode { status: u32 },
15    #[error("Name `{name}` could not be opened: `{source}`")]
16    NameFFIError {
17        name: String,
18        source: libloading::Error,
19    },
20}