#[non_exhaustive]pub enum GpuError {
Driver(DriverError),
InvalidDevice {
ordinal: usize,
count: usize,
},
DeviceMismatch {
expected: usize,
got: usize,
},
OutOfMemory {
requested_bytes: usize,
free_bytes: usize,
},
BudgetExceeded {
requested_bytes: usize,
budget_bytes: usize,
used_bytes: usize,
},
LengthMismatch {
a: usize,
b: usize,
},
ShapeMismatch {
op: &'static str,
expected: Vec<usize>,
got: Vec<usize>,
},
Blas(CublasError),
Solver(CusolverError),
PtxCompileFailed {
kernel: &'static str,
},
InvalidState {
message: String,
},
}Expand description
Errors produced by GPU operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Driver(DriverError)
CUDA driver error forwarded from cudarc.
InvalidDevice
Device ordinal is out of range.
DeviceMismatch
Tried to operate on buffers from different devices.
OutOfMemory
GPU out of memory. Contains the requested size and the free bytes at the time of the failed allocation.
BudgetExceeded
Allocation rejected because it would exceed the user-configured memory
budget (see crate::memory_guard::MemoryGuard::set_budget).
LengthMismatch
Binary op received buffers with different lengths.
ShapeMismatch
Matrix multiplication shape mismatch (inner dimensions differ).
Blas(CublasError)
cuBLAS error forwarded from cudarc.
Solver(CusolverError)
cuSOLVER error forwarded from cudarc.
PtxCompileFailed
PTX kernel compilation failed (e.g. unsupported GPU architecture).
InvalidState
An operation was attempted in an invalid state (e.g., capture on a sealed pool, or cuSOLVER reported a negative info value).
Trait Implementations§
Source§impl Error for GpuError
impl Error for GpuError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<CublasError> for GpuError
Available on crate feature cuda only.
impl From<CublasError> for GpuError
cuda only.Source§fn from(e: CublasError) -> Self
fn from(e: CublasError) -> Self
Source§impl From<CusolverError> for GpuError
Available on crate feature cuda only.
impl From<CusolverError> for GpuError
cuda only.Source§fn from(e: CusolverError) -> Self
fn from(e: CusolverError) -> Self
Source§impl From<DriverError> for GpuError
Available on crate feature cuda only.
impl From<DriverError> for GpuError
cuda only.Source§fn from(e: DriverError) -> Self
fn from(e: DriverError) -> Self
Auto Trait Implementations§
impl Freeze for GpuError
impl RefUnwindSafe for GpuError
impl Send for GpuError
impl Sync for GpuError
impl Unpin for GpuError
impl UnsafeUnpin for GpuError
impl UnwindSafe for GpuError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more