Skip to main content

CudaError

Enum CudaError 

Source
#[non_exhaustive]
pub enum CudaError {
Show 14 variants Unavailable { message: String, }, Driver { operation: &'static str, code: c_int, name: String, }, OutputTooSmall { required: usize, have: usize, }, LengthTooLarge { len: usize, }, HostAllocationFailed { bytes: usize, }, HostAllocationTooLarge { requested: usize, cap: usize, what: &'static str, }, LengthNotElementAligned { bytes: usize, element_size: usize, }, ImageTooLarge { width: u32, height: u32, channels: usize, }, StatePoisoned { message: String, }, CompletionFailed { primary: Box<CudaError>, completion: Box<CudaError>, }, ResourceReleaseFailed { primary: Box<CudaError>, release: Box<CudaError>, }, KernelStatus { kernel: &'static str, code: u32, detail: u32, }, InvalidArgument { message: String, }, InternalInvariant { what: &'static str, },
}
Expand description

Error returned by CUDA driver and J2K CUDA kernel helpers.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unavailable

CUDA driver library or device is unavailable.

Fields

§message: String

Human-readable availability failure.

§

Driver

CUDA Driver API call failed.

Fields

§operation: &'static str

Driver operation name.

§code: c_int

Raw CUDA result code.

§name: String

CUDA error name, when available.

§

OutputTooSmall

Host output buffer is too small for a device download.

Fields

§required: usize

Required byte count.

§have: usize

Provided byte count.

§

LengthTooLarge

Byte length cannot be represented by the kernel ABI.

Fields

§len: usize

Byte length.

§

HostAllocationFailed

A host-side allocation needed by a CUDA operation could not be reserved.

Fields

§bytes: usize

Requested host allocation size in bytes.

§

HostAllocationTooLarge

Simultaneously live host allocations would exceed the codec policy.

Fields

§requested: usize

Aggregate requested host byte count, saturated on overflow.

§cap: usize

Maximum permitted simultaneously live host bytes.

§what: &'static str

Logical operation requiring the allocation.

§

LengthNotElementAligned

Device byte length is not aligned to the requested typed view element.

Fields

§bytes: usize

Byte length.

§element_size: usize

Requested element size.

§

ImageTooLarge

Image dimensions overflowed allocation or launch geometry.

Fields

§width: u32

Image width.

§height: u32

Image height.

§channels: usize

Channel count.

§

StatePoisoned

Internal runtime state lock was poisoned.

Fields

§message: String

Poison error message.

§

CompletionFailed

A CUDA operation failed and the follow-up completion check also failed.

Fields

§primary: Box<CudaError>

Error returned by the original CUDA operation.

§completion: Box<CudaError>

Error returned while establishing context-wide completion.

§

ResourceReleaseFailed

A CUDA operation failed and releasing its retained resources also failed.

Fields

§primary: Box<CudaError>

Error returned by the original CUDA operation.

§release: Box<CudaError>

Error returned while releasing retained resources.

§

KernelStatus

A J2K CUDA kernel reported a validated runtime failure.

Fields

§kernel: &'static str

Kernel entry point or logical stage name.

§code: u32

Kernel-defined status code.

§detail: u32

Kernel-defined detail code.

§

InvalidArgument

Caller supplied arguments that cannot be represented by this runtime API.

Fields

§message: String

Human-readable validation failure.

§

InternalInvariant

Validated host-side planning state contradicted materialized launch data.

Fields

§what: &'static str

Stable description of the failed invariant.

Implementations§

Source§

impl CudaError

Source

pub fn is_unavailable(&self) -> bool

True when the error means the CUDA driver or device is unavailable.

Trait Implementations§

Source§

impl Debug for CudaError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CudaError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for CudaError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.