1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 Craton Software Company
//! `wasi-cuda` host bridge — the explicit GPU kernel-launch API exposed to
//! Wasm modules.
//!
//! Wasm code imports the functions defined in [`abi::MODULE`] and uses them
//! to upload PTX modules ([`abi::FN_LOAD_PTX`]) and launch kernels
//! ([`abi::FN_LAUNCH`]). On hosts without CUDA the host functions return
//! [`abi::AbiError::NotAvailable`]; on CUDA hosts they call into the
//! `cust` crate via the `cuda` feature.
//!
//! See `wit/wasi-cuda.wit` at the workspace root for the Component-Model
//! interface definition (`wasi:cuda/host@0.2.0`) — the WIT and the
//! constants in [`abi`] are kept in lockstep.
//!
//! The [`scheduler`] module exposes a separate `wasi:scheduler/host@0.1.0`
//! interface for cooperative deadlines (roadmap feature #4) — guests
//! offer suspend points via `yield()` and the host returns a non-zero
//! code when the per-instance deadline is approaching. See
//! `docs/COOPERATIVE-YIELD.md`.
// Process-wide CUDA primary-context binding (roadmap fix #6). Only meaningful
// on `--features cuda`; the module itself is `#![cfg(feature = "cuda")]`.
pub use InstanceMetricsSnapshot;
pub use ;