Skip to main content

CpuRefBackend

Struct CpuRefBackend 

Source
pub struct CpuRefBackend;
Expand description

Dispatch backend backed by vyre_reference::reference_eval.

Trait Implementations§

Source§

impl Clone for CpuRefBackend

Source§

fn clone(&self) -> CpuRefBackend

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CpuRefBackend

Source§

impl Debug for CpuRefBackend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CpuRefBackend

Source§

fn default() -> CpuRefBackend

Returns the “default value” for a type. Read more
Source§

impl Sealed for CpuRefBackend

Source§

impl VyreBackend for CpuRefBackend

Source§

fn id(&self) -> &'static str

Stable backend identifier used for logging, certificates, and adapter selection. Read more
Source§

fn version(&self) -> &'static str

Backend implementation version string used for certificates and regression tracking. Read more
Source§

fn dispatch( &self, program: &Program, inputs: &[Vec<u8>], config: &DispatchConfig, ) -> Result<Vec<Vec<u8>>, BackendError>

Executes the program with the given input buffers and returns the output buffers. Read more
Source§

fn supported_ops(&self) -> &HashSet<OpId>

Operation ids this backend can execute without further lowering.
Source§

fn max_workgroup_size(&self) -> [u32; 3]

Maximum supported workgroup size per axis [x, y, z]. Read more
Source§

fn max_compute_workgroups_per_dimension(&self) -> u32

Maximum number of compute workgroups the backend can launch in one dispatch dimension. Read more
Source§

fn dispatch_borrowed( &self, program: &Program, inputs: &[&[u8]], config: &DispatchConfig, ) -> Result<Vec<Vec<u8>>, BackendError>

Executes the program with borrowed input buffers. Read more
Source§

fn dispatch_borrowed_timed( &self, program: &Program, inputs: &[&[u8]], config: &DispatchConfig, ) -> Result<TimedDispatchResult, BackendError>

Executes a borrowed-input dispatch and returns backend-owned timing. Read more
Source§

fn dispatch_borrowed_into( &self, program: &Program, inputs: &[&[u8]], config: &DispatchConfig, outputs: &mut Vec<Vec<u8>>, ) -> Result<(), BackendError>

Executes the program with borrowed input buffers and writes outputs into caller-owned storage. Read more
Source§

fn allocate_resident(&self, _byte_len: usize) -> Result<Resource, BackendError>

Allocate a backend-resident buffer and return a stable resource handle. Read more
Source§

fn upload_resident( &self, _resource: &Resource, _bytes: &[u8], ) -> Result<(), BackendError>

Upload bytes into a backend-resident resource. Read more
Source§

fn upload_resident_many( &self, _uploads: &[(&Resource, &[u8])], ) -> Result<(), BackendError>

Upload several backend-resident resources as one logical staging operation. Read more
Source§

fn upload_resident_at( &self, _resource: &Resource, _dst_offset_bytes: usize, _bytes: &[u8], ) -> Result<(), BackendError>

Upload bytes into a subrange of a backend-resident resource. Read more
Source§

fn upload_resident_at_many( &self, _uploads: &[(&Resource, usize, &[u8])], ) -> Result<(), BackendError>

Upload several resident subranges as one logical staging operation. Read more
Source§

fn download_resident( &self, resource: &Resource, ) -> Result<Vec<u8>, BackendError>

Download a backend-resident resource into a new host buffer. Read more
Source§

fn download_resident_into( &self, _resource: &Resource, _out: &mut Vec<u8>, ) -> Result<(), BackendError>

Download a backend-resident resource into caller-owned storage. Read more
Source§

fn download_resident_range( &self, resource: &Resource, byte_offset: usize, byte_len: usize, ) -> Result<Vec<u8>, BackendError>

Download a byte range from a backend-resident resource into a new host buffer. Read more
Source§

fn download_resident_range_into( &self, _resource: &Resource, _byte_offset: usize, _byte_len: usize, _out: &mut Vec<u8>, ) -> Result<(), BackendError>

Download a byte range from a backend-resident resource into caller-owned storage. Read more
Source§

fn download_resident_ranges_into( &self, ranges: &[(&Resource, usize, usize)], outputs: &mut [&mut Vec<u8>], ) -> Result<(), BackendError>

Download several byte ranges from backend-resident resources into caller-owned storage as one logical readback operation. Read more
Source§

fn free_resident(&self, _resource: Resource) -> Result<(), BackendError>

Free a backend-resident resource previously returned by VyreBackend::allocate_resident. Read more
Source§

fn dispatch_resident_timed( &self, _program: &Program, _resources: &[Resource], _config: &DispatchConfig, ) -> Result<TimedDispatchResult, BackendError>

Dispatch using backend-resident resources and return backend-owned timing. Read more
Source§

fn dispatch_resident_sequence_read_ranges_into( &self, steps: &[ResidentDispatchStep<'_>], read_ranges: &[ResidentReadRange<'_>], outputs: &mut [&mut Vec<u8>], ) -> Result<(), BackendError>

Dispatch an ordered sequence of resident-buffer programs and read selected resident byte ranges into caller-owned storage. Read more
Source§

fn dispatch_resident_sequence_read_ranges_timed_into( &self, steps: &[ResidentDispatchStep<'_>], read_ranges: &[ResidentReadRange<'_>], outputs: &mut [&mut Vec<u8>], ) -> Result<ResidentSequenceTiming, BackendError>

Source§

fn dispatch_resident_repeated_sequence_read_ranges_into( &self, prefix_steps: &[ResidentDispatchStep<'_>], repeated_steps: &[ResidentDispatchStep<'_>], repeat_count: u32, read_ranges: &[ResidentReadRange<'_>], outputs: &mut [&mut Vec<u8>], ) -> Result<(), BackendError>

Dispatch a resident prefix, repeat a resident sub-sequence, and read selected resident byte ranges into caller-owned storage. Read more
Source§

fn compile_native( &self, _program: &Program, _config: &DispatchConfig, ) -> Result<Option<Arc<dyn CompiledPipeline>>, BackendError>

Optional pre-compilation hook for the pipeline-mode API. Read more
Source§

fn compile_native_shared( &self, program: Arc<Program>, config: &DispatchConfig, ) -> Result<Option<Arc<dyn CompiledPipeline>>, BackendError>

Optional pre-compilation hook for callers that already own a shared program allocation. Read more
Source§

fn pipeline_cache_snapshot(&self) -> Option<PipelineCacheSnapshot>

Optional compiled-pipeline cache counters for compile telemetry. Read more
Source§

fn backend_metric_snapshot(&self) -> Vec<(&'static str, u64)>

Optional backend-specific numeric telemetry for release evidence. Read more
Source§

fn dispatch_async( &self, program: &Program, inputs: &[Vec<u8>], config: &DispatchConfig, ) -> Result<Box<dyn PendingDispatch>, BackendError>

Non-blocking dispatch primitive. Read more
Source§

fn dispatch_borrowed_async( &self, program: &Program, inputs: &[&[u8]], config: &DispatchConfig, ) -> Result<Box<dyn PendingDispatch>, BackendError>

Non-blocking dispatch with borrowed input buffers. Read more
Source§

fn supports_subgroup_ops(&self) -> bool

Whether this backend’s lowering path emits subgroup / wave intrinsics AND the current adapter exposes them. Read more
Source§

fn supports_f16(&self) -> bool

Whether this backend lowers IEEE 754 binary16 (DataType::F16) natively rather than emulating through f32. Read more
Source§

fn supports_bf16(&self) -> bool

Whether this backend lowers bfloat16 (DataType::BF16) natively. Read more
Source§

fn supports_tensor_cores(&self) -> bool

Whether this backend emits tensor-core / matrix-engine intrinsics for supported tensor shapes. Read more
Source§

fn supports_async_compute(&self) -> bool

Whether this backend overlaps copies and compute via independent queues or async engines. Read more
Source§

fn supports_indirect_dispatch(&self) -> bool

Whether this backend supports indirect dispatch (Node::IndirectDispatch). Read more
Source§

fn supports_speculation(&self) -> bool

Whether this backend supports speculative dispatch - a fused prefilter + confirmer kernel with commit-gated output and a counter tail read back by the host. Read more
Source§

fn supports_persistent_thread_dispatch(&self) -> bool

Whether this backend supports device-side persistent-thread dispatch (a long-running kernel that polls a work queue). Read more
Source§

fn supports_grid_sync(&self) -> bool

Whether this backend can satisfy Node::Barrier { ordering: MemoryOrdering::GridSync } inside a single dispatch - i.e. every thread in the entire grid waits at the barrier and every prior write is globally visible afterwards. Backends that lack a native grid barrier (workgroup-only fences) must return false; registration-based dispatch may lower a GridSync barrier to a host-orchestrated kernel split only when VyreBackend::allows_host_grid_sync_split also returns true. Read more
Source§

fn cooperative_grid_sync_fits( &self, _program: &Program, _inputs: &[&[u8]], _config: &DispatchConfig, ) -> Result<bool, BackendError>

Whether a native cooperative grid-sync launch of program with these inputs and config can be made fully resident on this device. Read more
Source§

fn allows_host_grid_sync_split(&self) -> bool

Whether the shared registry wrapper may emulate whole-grid synchronization for this backend by splitting one program into multiple host-dispatched kernels. Read more
Source§

fn supports_resident_dispatch(&self) -> bool

Whether this backend implements the resident half of the contract (allocate_resident / upload_resident / dispatch_resident_timed / dispatch_resident_repeated_sequence_read_ranges_into / download_resident_* / free_resident) well enough to run a device-resident dispatch sequence. Read more
Source§

fn is_distributed(&self) -> bool

Whether this backend partitions a program across more than one physical device / node. Read more
Source§

fn supports_distributed_collectives(&self) -> bool

Whether this backend lowers distributed collective communication nodes (AllReduce, AllGather, ReduceScatter, Broadcast). Read more
Source§

fn max_compute_invocations_per_workgroup(&self) -> u32

Maximum total invocations allowed in a single workgroup. Read more
Source§

fn subgroup_size(&self) -> Option<u32>

Native subgroup size for the backing device when the backend knows it. Returning None tells the dispatch planner the backend can’t report a subgroup width - the planner falls back to max_workgroup_size for its sizing heuristic. Read more
Source§

fn max_storage_buffer_bytes(&self) -> u64

Maximum size in bytes of a single storage buffer the backend accepts. 0 means the backend has not reported a limit, not “unlimited”. Read more
Source§

fn device_profile(&self) -> DeviceProfile

Unified backend-neutral device profile. Read more
Source§

fn prepare(&self) -> Result<(), BackendError>

Pre-dispatch warmup. Called before the first dispatch on a new program so the backend can warm caches, compile ahead-of-time, or acquire a device handle without paying that cost on the hot path. Read more
Source§

fn flush(&self) -> Result<(), BackendError>

Flush any queued work to the device and wait for it to complete. Read more
Source§

fn shutdown(&self) -> Result<(), BackendError>

Release device resources held by this backend. After shutdown returns the backend is in an unspecified state and may not be used for further dispatches. Read more
Source§

fn device_lost(&self) -> bool

Probe whether the underlying device has been lost since the last successful dispatch. Read more
Source§

fn try_recover(&self) -> Result<(), BackendError>

Attempt to recover from device loss by reacquiring the underlying device and invalidating pipeline caches. Read more
Source§

fn allocate_device_buffer( &self, _byte_len: usize, ) -> Result<Box<dyn DeviceBuffer>, BackendError>

Allocate a backend-owned device buffer of byte_len bytes. Read more
Source§

fn upload_device_buffer( &self, _buffer: &mut (dyn DeviceBuffer + 'static), _bytes: &[u8], ) -> Result<(), BackendError>

Upload host bytes into a previously-allocated device buffer. Read more
Source§

fn download_device_buffer( &self, _buffer: &(dyn DeviceBuffer + 'static), ) -> Result<Vec<u8>, BackendError>

Download bytes from a device buffer back to a host Vec<u8>. Read more
Source§

fn free_device_buffer( &self, _buffer: Box<dyn DeviceBuffer>, ) -> Result<(), BackendError>

Free a device buffer previously returned by Self::allocate_device_buffer. Explicit-free is required because the substrate does not assume reference-counted backend handles; consumers are responsible for calling this when done. Read more
Source§

fn dispatch_with_device_buffers( &self, _program: &Program, _inputs: &[&(dyn DeviceBuffer + 'static)], _outputs: &mut [&mut (dyn DeviceBuffer + 'static)], _config: &DispatchConfig, ) -> Result<(), BackendError>

Dispatch a Program with backend-owned device buffers as inputs and outputs. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Backend for T
where T: VyreBackend + ?Sized,

Source§

fn id(&self) -> &'static str

Stable backend identifier.
Source§

fn version(&self) -> &'static str

Backend implementation version.
Source§

fn supported_ops(&self) -> &HashSet<Arc<str>>

Operation ids this backend can execute without further lowering.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypedDispatchExt for T
where T: VyreBackend + ?Sized,

Source§

fn dispatch_bytes( &self, program: &Program, inputs: &[&[u8]], config: &DispatchConfig, ) -> Result<Vec<Vec<u8>>, BackendError>

Dispatch borrowed byte slices. Read more
Source§

fn dispatch_pod<T>( &self, program: &Program, inputs: &[&[T]], config: &DispatchConfig, ) -> Result<Vec<Vec<T>>, BackendError>
where T: Pod,

Dispatch borrowed typed POD inputs and decode each output as T. Read more
Source§

fn dispatch_pod_into<T>( &self, program: &Program, inputs: &[&[T]], config: &DispatchConfig, raw_outputs: &mut Vec<Vec<u8>>, typed_outputs: &mut Vec<Vec<T>>, ) -> Result<(), BackendError>
where T: Pod,

Dispatch borrowed typed POD inputs and decode each output as T into caller-owned storage. Read more
Source§

fn dispatch_u32( &self, program: &Program, inputs: &[&[u32]], config: &DispatchConfig, ) -> Result<Vec<Vec<u32>>, BackendError>

Dispatch borrowed u32 inputs and decode each output as u32. Read more
Source§

fn dispatch_u32_into( &self, program: &Program, inputs: &[&[u32]], config: &DispatchConfig, raw_outputs: &mut Vec<Vec<u8>>, typed_outputs: &mut Vec<Vec<u32>>, ) -> Result<(), BackendError>

Dispatch borrowed u32 inputs and decode outputs into caller-owned typed storage. Read more
Source§

fn dispatch_f32( &self, program: &Program, inputs: &[&[f32]], config: &DispatchConfig, ) -> Result<Vec<Vec<f32>>, BackendError>

Dispatch borrowed f32 inputs and decode each output as f32. Read more
Source§

fn dispatch_f32_into( &self, program: &Program, inputs: &[&[f32]], config: &DispatchConfig, raw_outputs: &mut Vec<Vec<u8>>, typed_outputs: &mut Vec<Vec<f32>>, ) -> Result<(), BackendError>

Dispatch borrowed f32 inputs and decode outputs into caller-owned typed storage. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more