Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 41 variants Load(LoadError), UnsupportedArchitecture { target: String, }, NoCompatibleArtifact { name: Cow<'static, str>, major: u32, minor: u32, }, Artifact(ArtifactError), ThreadLocalStreamUnsupported, ForeignStreamMismatch, Operation(Box<dyn Error + Send + Sync>), Completion(Arc<Self>), CompletionWorkerStopped, ResourceDestructionPanicked, CompletionPanicked, ManagedHostAccessUnsupported, ReentrantAccess, LockPoisoned { name: Cow<'static, str>, }, LaunchContract(LaunchContractError), Compiler { message: String, }, NvJitLink { code: Status, diagnostic: String, }, Cuda { code: Status, }, Nvrtc { code: Status, }, Nvvm { code: Status, }, InteriorNul, Io(Error), DeviceNotFound, UnsupportedPinnedAlignment { align: usize, }, OwnershipShared { name: Cow<'static, str>, }, MemoryContextMismatch, NullHandle, NullPointer { name: Cow<'static, str>, }, NotPositive { name: Cow<'static, str>, }, Empty { name: Cow<'static, str>, }, UnknownEnumValue { name: Cow<'static, str>, value: i64, }, OutOfRange { name: Cow<'static, str>, }, LengthMismatch { name: Cow<'static, str>, expected: usize, actual: usize, }, BufferTooSmall { name: Cow<'static, str>, required: usize, actual: usize, }, SizeMismatch { name: Cow<'static, str>, expected: usize, actual: usize, }, Misaligned { name: Cow<'static, str>, alignment: usize, }, GraphDependencyMismatch, GraphNodeMismatch, ContextMismatch { name: Cow<'static, str>, }, StreamContextMismatch, CheckpointDirectionMismatch { operation: &'static str, },
}
Expand description

CUDA wrapper failures, including native status codes, compiler diagnostics, resource ownership, and submission tracking.

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.
§

Load(LoadError)

A library or symbol would not load.

§

UnsupportedArchitecture

The requested GPU architecture cannot be represented or supported by this operation.

Fields

§target: String

Requested GPU architecture name.

§

NoCompatibleArtifact

No embedded artifact with the requested name matches the target compute capability.

Fields

§name: Cow<'static, str>

Requested embedded artifact name.

§major: u32

Target compute capability major component.

§minor: u32

Target compute capability minor component.

§

Artifact(ArtifactError)

Embedded artifact selection, decoding, or loading failed.

Tuple Fields

§0: ArtifactError

Underlying artifact error.

§

ThreadLocalStreamUnsupported

A per-thread default stream cannot be retained as a stream shared across threads.

§

ForeignStreamMismatch

The foreign readiness stream and Singe stream refer to different native CUDA streams.

§

Operation(Box<dyn Error + Send + Sync>)

The submitted native operation returned an error.

Tuple Fields

§0: Box<dyn Error + Send + Sync>

Underlying native operation error.

§

Completion(Arc<Self>)

An error was retained while waiting for submission completion.

Tuple Fields

§0: Arc<Self>

Shared error retained by the submission completion state.

§

CompletionWorkerStopped

The worker responsible for tracking CUDA completion stopped.

§

ResourceDestructionPanicked

Destroying a retained submission resource panicked.

§

CompletionPanicked

Retiring completed submission state panicked.

§

ManagedHostAccessUnsupported

The device cannot provide the concurrent managed access required for managed host access.

§

ReentrantAccess

CUDA access was requested while the calling thread already held a host or enqueue access guard.

§

LockPoisoned

A lock was poisoned by an earlier panic.

Fields

§name: Cow<'static, str>

Name of the locked resource.

§

LaunchContract(LaunchContractError)

Kernel argument, launch, or memory-access validation failed.

Tuple Fields

§0: LaunchContractError

Kernel launch contract violation.

§

Compiler

A compiler operation failed with a diagnostic message.

Fields

§message: String

Diagnostic text returned by the compiler integration.

nvJitLink returned a failure status, with the linker’s error log.

Fields

§code: Status

Native device-linker status.

§diagnostic: String

The linker’s error log, empty when none was read.

§

Cuda

A CUDA driver or runtime call returned a failure status.

Fields

§code: Status

Native CUDA status.

§

Nvrtc

An NVRTC call returned a failure status.

Fields

§code: Status

Native NVRTC status.

§

Nvvm

An NVVM call returned a failure status.

Fields

§code: Status

Native NVVM status.

§

InteriorNul

A string intended for a native NUL-terminated interface contains an interior NUL byte.

§

Io(Error)

An operating-system I/O operation failed.

Tuple Fields

§0: Error

Underlying I/O error.

§

DeviceNotFound

The requested CUDA device could not be found.

§

UnsupportedPinnedAlignment

A pinned host allocation needs an alignment above 4096 bytes, or CUDA returned a chunk that is not page-aligned.

Fields

§align: usize

Alignment in bytes that the pool cannot give.

§

OwnershipShared

An owner cannot be consumed or released while other owners share it.

Fields

§name: Cow<'static, str>

Name of the shared owner.

§

MemoryContextMismatch

The memory allocation belongs to another CUDA context.

§

NullHandle

A native call returned a null handle where a live resource was required.

§

NullPointer

A pointer argument or native result is null where a valid address is required.

Fields

§name: Cow<'static, str>

Name of the pointer.

§

NotPositive

A value must be greater than zero.

Fields

§name: Cow<'static, str>

Name of the value.

§

Empty

A value or collection is empty where content is required.

Fields

§name: Cow<'static, str>

Name of the value.

§

UnknownEnumValue

A native enum value has no typed variant in this crate.

Fields

§name: Cow<'static, str>

Name of the typed enum.

§value: i64

Unrecognized native value.

§

OutOfRange

A named argument or computed extent exceeds the supported range.

Fields

§name: Cow<'static, str>

Name of the argument or computed extent that exceeded its range.

§

LengthMismatch

Two lengths that must be equal differ.

Fields

§name: Cow<'static, str>

Name of the value whose length is checked.

§expected: usize

Required length.

§actual: usize

Supplied length.

§

BufferTooSmall

A buffer cannot hold what the operation reads from or writes to it.

Fields

§name: Cow<'static, str>

Name of the buffer.

§required: usize

Required length.

§actual: usize

Supplied length.

§

SizeMismatch

Two byte sizes that must be equal differ.

Fields

§name: Cow<'static, str>

Name of the value whose size is checked.

§expected: usize

Required size in bytes.

§actual: usize

Supplied size in bytes.

§

Misaligned

An address, offset, or size is not a multiple of the required alignment.

Fields

§name: Cow<'static, str>

Name of the address, offset, or size.

§alignment: usize

Required alignment in bytes.

§

GraphDependencyMismatch

Graph dependency relationships do not match the required graph state.

§

GraphNodeMismatch

A graph node belongs to a different graph.

§

ContextMismatch

A CUDA object other than memory or a stream belongs to a different CUDA context.

Fields

§name: Cow<'static, str>

Name of the object.

§

StreamContextMismatch

The stream belongs to a different CUDA context.

§

CheckpointDirectionMismatch

A checkpoint region was copied against its operation’s direction: to the host during a restore, or from the host during a checkpoint.

Fields

§operation: &'static str

The region’s operation, checkpoint or restore.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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

Replaced by Error::source.
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
Source§

impl From<ArtifactError> for Error

Source§

fn from(source: ArtifactError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for GraphUpdateError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<LaunchContractError> for Error

Source§

fn from(source: LaunchContractError) -> Self

Converts to this type from the input type.
Source§

impl From<LoadError> for Error

Source§

fn from(source: LoadError) -> Self

Converts to this type from the input type.
Source§

impl From<NulError> for Error

Source§

fn from(_: NulError) -> Self

Converts to this type from the input type.
Source§

impl From<Status> for Error

Source§

fn from(code: Status) -> Self

Converts to this type from the input type.
Source§

impl From<Status> for Error

Source§

fn from(code: Status) -> Self

Converts to this type from the input type.
Source§

impl From<Status> for Error

Source§

fn from(code: Status) -> Self

Converts to this type from the input type.
Source§

impl From<Status> for Error

Source§

fn from(code: Status) -> Self

Converts to this type from the input type.
Source§

impl From<UnknownEnumValue> for Error

Source§

fn from(error: UnknownEnumValue) -> Self

Converts to this type from the input type.
Source§

impl From<cudaError_enum> for Error

Source§

fn from(status: cudaError_t) -> Self

Converts to this type from the input type.
Source§

impl From<nvJitLinkResult> for Error

Source§

fn from(status: nvJitLinkResult) -> Self

Converts to this type from the input type.
Source§

impl From<nvrtcResult> for Error

Source§

fn from(status: nvrtcResult) -> Self

Converts to this type from the input type.
Source§

impl From<nvvmResult> for Error

Source§

fn from(status: nvvmResult) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Forget for Error

§

impl Freeze for Error

§

impl Move for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.