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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! # atomr-accel
//!
//! Actor-shaped face for compute-acceleration backends, on top of the
//! [atomr](../../atomr) actor runtime. NVIDIA CUDA is the first
//! shipping implementation ([`atomr-accel-cuda`](../atomr_accel_cuda));
//! the same trait surface accommodates AMD ROCm, Apple Metal, Intel
//! oneAPI, and Vulkan compute when those land.
//!
//! ```toml
//! [dependencies]
//! atomr-accel = "0.1"
//! atomr-accel-cuda = "0.1" # active backend
//! ```
//!
//! ```ignore
//! use atomr_accel::prelude::*;
//! use atomr_accel_cuda as cuda;
//! ```
//!
//! ## What this crate is
//!
//! A **thin core** that names the abstractions every backend has to
//! satisfy:
//!
//! - [`AccelBackend`] — marker trait identifying a backend, with
//! associated `Device`, `Stream`, `Event`, `Error` types.
//! - [`AccelDtype`] / [`DType`] — backend-agnostic numeric data-type
//! trait + discriminant. Backends layer their own `*Dtype` trait
//! on top with FFI mappings.
//! - [`AccelRef`] — generation-validated typed device pointer
//! parametric over the backend.
//! - [`AccelError`] — typed error enum, `#[non_exhaustive]` so
//! backends can add `LibraryError` variants without breaking core.
//! - [`CompletionStrategy`] — async wakeup contract for kernel
//! completion (host-fn callback, sync, polled).
//! - [`KernelOp`] — marker trait for typed op envelopes (Sgemm,
//! RngFillUniform, etc.).
//!
//! The core deliberately ships **no concrete actors**. Each backend
//! crate (`atomr-accel-cuda`, future `atomr-accel-rocm`,
//! `atomr-accel-metal`, …) provides its own `DeviceActor`,
//! `KernelActor` family, and library wrappers, and depends on this
//! crate for the trait surface.
//!
//! ## What this crate is not
//!
//! - A least-common-denominator API. Backends expose more than the
//! trait surface — `atomr_accel_cuda::kernel::CudnnActor` has a
//! richer message set than `KernelOp` knows about, and that's
//! fine. The trait surface is for portable code; backend-specific
//! work uses the concrete crate directly.
//! - A device-abstraction layer like wgpu or SYCL. We don't try to
//! compile one shader to many targets. We supervise the right
//! library on the right hardware.
pub use ;
pub use CompletionStrategy;
pub use ;
pub use AccelError;
pub use AccelRef;
pub use KernelOp;