pub trait AccelDevice:
Send
+ Sync
+ 'static {
type Backend: AccelBackend;
// Required methods
fn device_id(&self) -> u32;
fn generation(&self) -> u64;
}Expand description
Device-handle contract: identification + a hook to observe generation rebuilds (sticky-error recovery).
Required Associated Types§
type Backend: AccelBackend
Required Methods§
Sourcefn device_id(&self) -> u32
fn device_id(&self) -> u32
Stable, opaque device id. CUDA returns the ordinal; ROCm
returns the hipDevice_t; Metal returns a hashed
MTLDevice.registryID.
Sourcefn generation(&self) -> u64
fn generation(&self) -> u64
Current generation counter. Bumped every time the underlying
device context is torn down + rebuilt (e.g. cuda sticky-error
recovery). AccelRefs minted against an older generation
fail their next access().