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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! Backend identity traits.
//!
//! A `atomr-accel` backend (CUDA, ROCm, Metal, oneAPI, Vulkan compute,
//! …) is a coherent triple of *device handle*, *stream / queue*, and
//! *event / fence* types. These traits name them so portable code
//! can be parameterized over `B: AccelBackend` without committing to
//! a vendor SDK.
//!
//! Backends still expose richer concrete types directly — the
//! cuBLAS / cuDNN / cuFFT actors live in the `atomr-accel-cuda`
//! crate and are not part of this trait surface. The traits here
//! capture only the shape that every backend has to provide.
use Debug;
use Arc;
use crateAccelError;
/// Marker trait identifying a compute-acceleration backend.
///
/// Implemented by the `Backend` zero-sized type in each backend
/// crate. Use as a trait bound:
///
/// ```ignore
/// fn observe_load<B: AccelBackend>(d: &B::Device) -> u32 { ... }
/// ```
///
/// The associated types name the lifetime-bounded handles a
/// backend hands out. They're all `Send + Sync + 'static` so they
/// can travel across actor boundaries.
/// Device-handle contract: identification + a hook to observe
/// generation rebuilds (sticky-error recovery).
/// Stream / queue contract: ordered submission of work, plus the
/// ability to record an event for cross-stream synchronization.
/// Convenience type alias for a shared device handle. Every backend
/// hands out devices through `Arc<B::Device>` so they survive context
/// rebuilds without invalidating the outer `ActorRef`.
pub type Device<B> = ;
/// Convenience type alias for a shared stream handle.
pub type Stream<B> = ;