Skip to main content

AccelDevice

Trait AccelDevice 

Source
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§

Required Methods§

Source

fn device_id(&self) -> u32

Stable, opaque device id. CUDA returns the ordinal; ROCm returns the hipDevice_t; Metal returns a hashed MTLDevice.registryID.

Source

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().

Implementors§