#[repr(i32)]pub enum AbiError {
NotAvailable = -1,
InvalidPointer = -2,
InvalidKernel = -3,
MalformedPtx = -4,
LaunchFailed = -5,
QuotaExceeded = -6,
Internal = -7,
InvalidDimensions = -8,
InvalidArgs = -9,
KernelArgsUnsupported = -10,
InvalidHandle = -11,
}Expand description
Negative i32 status codes returned by the wasi-cuda host functions.
These are stable across TensorWasm versions; client code may match on the numeric value if it needs to.
Variants§
NotAvailable = -1
CUDA is not available on this host (no toolkit / no driver).
InvalidPointer = -2
A pointer / length pair pointed outside the caller’s linear memory.
InvalidKernel = -3
Wasi-cuda was passed a KernelId that
is not registered (or that belongs to another instance).
MalformedPtx = -4
load_ptx was called with bytes that ptxas rejected.
LaunchFailed = -5
The CUDA driver returned an error during a launch / sync.
QuotaExceeded = -6
Resource limits (max kernels per instance, etc.) were exceeded.
Internal = -7
Generic internal error.
InvalidDimensions = -8
Launch grid / block dimensions exceeded hardware caps or were non-positive. Returned by the host before any CUDA driver call, allowing the guest to distinguish a launch-shape bug from a driver error.
InvalidArgs = -9
Caller passed a structurally invalid argument that is neither a
memory-region issue nor a dimensions issue. Currently used for
non-UTF8 entry names in load_ptx.
KernelArgsUnsupported = -10
Caller passed a well-formed, in-bounds kernel-argument buffer
that exceeds the host’s sanity caps — total argv bytes greater
than MAX_KERNEL_ARGS_BYTES
(4 KiB) or more than
MAX_KERNEL_ARGS (128)
tagged records. Since v0.2.0 (W1.1) the typed-argv lane accepts
arbitrary scalar + pointer argv below those caps; this code is
reserved for cap busts and is kept distinct from
AbiError::InvalidArgs so a guest can tell “your input shape
is too big for the host to accept” from “your input bytes are
malformed.” See wit/wasi-cuda.wit and
crate::kernel_args::parse_argv for the contract.
InvalidHandle = -11
A device-memory handle (from alloc) was passed to free /
memcpy-h2d / memcpy-d2h that is not registered, or that belongs
to another instance. Mirrors AbiError::InvalidKernel for the
kernel registry: a guest cannot forge another instance’s device
buffer handle. See crate::device_mem::DeviceMemRegistry.
Implementations§
Trait Implementations§
impl Copy for AbiError
impl Eq for AbiError
Source§impl From<BackPressureError> for AbiError
impl From<BackPressureError> for AbiError
Source§fn from(e: BackPressureError) -> Self
fn from(e: BackPressureError) -> Self
impl StructuralPartialEq for AbiError
Auto Trait Implementations§
impl Freeze for AbiError
impl RefUnwindSafe for AbiError
impl Send for AbiError
impl Sync for AbiError
impl Unpin for AbiError
impl UnsafeUnpin for AbiError
impl UnwindSafe for AbiError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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