pub struct CpuRefBackend;Expand description
Dispatch backend backed by vyre_reference::reference_eval.
Trait Implementations§
Source§impl Clone for CpuRefBackend
impl Clone for CpuRefBackend
Source§fn clone(&self) -> CpuRefBackend
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CpuRefBackend
Source§impl Debug for CpuRefBackend
impl Debug for CpuRefBackend
Source§impl Default for CpuRefBackend
impl Default for CpuRefBackend
Source§fn default() -> CpuRefBackend
fn default() -> CpuRefBackend
Returns the “default value” for a type. Read more
impl Sealed for CpuRefBackend
Source§impl VyreBackend for CpuRefBackend
impl VyreBackend for CpuRefBackend
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
Stable backend identifier used for logging, certificates, and adapter selection. Read more
Source§fn version(&self) -> &'static str
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>
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>
fn supported_ops(&self) -> &HashSet<OpId>
Operation ids this backend can execute without further lowering.
Source§fn max_workgroup_size(&self) -> [u32; 3]
fn max_workgroup_size(&self) -> [u32; 3]
Maximum supported workgroup size per axis
[x, y, z]. Read moreSource§fn max_compute_workgroups_per_dimension(&self) -> u32
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fn free_resident(&self, _resource: Resource) -> Result<(), BackendError>
Free a backend-resident resource previously returned by
VyreBackend::allocate_resident. Read moreSource§fn dispatch_resident_timed(
&self,
_program: &Program,
_resources: &[Resource],
_config: &DispatchConfig,
) -> Result<TimedDispatchResult, BackendError>
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>
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>
fn dispatch_resident_sequence_read_ranges_timed_into( &self, steps: &[ResidentDispatchStep<'_>], read_ranges: &[ResidentReadRange<'_>], outputs: &mut [&mut Vec<u8>], ) -> Result<ResidentSequenceTiming, BackendError>
Timed variant of
VyreBackend::dispatch_resident_sequence_read_ranges_into. Read moreSource§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>
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>
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
Optional pre-compilation hook for callers that already own a shared
program allocation. Read more
Source§fn pipeline_cache_snapshot(&self) -> Option<PipelineCacheSnapshot>
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)>
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>
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>
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
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
fn supports_f16(&self) -> bool
Whether this backend lowers IEEE 754 binary16 (
DataType::F16)
natively rather than emulating through f32. Read moreSource§fn supports_bf16(&self) -> bool
fn supports_bf16(&self) -> bool
Whether this backend lowers bfloat16 (
DataType::BF16) natively. Read moreSource§fn supports_tensor_cores(&self) -> bool
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
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
fn supports_indirect_dispatch(&self) -> bool
Whether this backend supports indirect dispatch
(
Node::IndirectDispatch). Read moreSource§fn supports_speculation(&self) -> bool
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
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
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 moreSource§fn cooperative_grid_sync_fits(
&self,
_program: &Program,
_inputs: &[&[u8]],
_config: &DispatchConfig,
) -> Result<bool, BackendError>
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 moreSource§fn allows_host_grid_sync_split(&self) -> bool
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
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 moreSource§fn is_distributed(&self) -> bool
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
fn supports_distributed_collectives(&self) -> bool
Whether this backend lowers distributed collective communication
nodes (
AllReduce, AllGather, ReduceScatter, Broadcast). Read moreSource§fn max_compute_invocations_per_workgroup(&self) -> u32
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>
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 moreSource§fn max_storage_buffer_bytes(&self) -> u64
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 moreSource§fn device_profile(&self) -> DeviceProfile
fn device_profile(&self) -> DeviceProfile
Unified backend-neutral device profile. Read more
Source§fn prepare(&self) -> Result<(), BackendError>
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>
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>
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 moreSource§fn device_lost(&self) -> bool
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>
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>
fn allocate_device_buffer( &self, _byte_len: usize, ) -> Result<Box<dyn DeviceBuffer>, BackendError>
Allocate a backend-owned device buffer of
byte_len bytes. Read moreSource§fn upload_device_buffer(
&self,
_buffer: &mut (dyn DeviceBuffer + 'static),
_bytes: &[u8],
) -> Result<(), BackendError>
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>
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 moreSource§fn free_device_buffer(
&self,
_buffer: Box<dyn DeviceBuffer>,
) -> Result<(), BackendError>
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 moreSource§fn dispatch_with_device_buffers(
&self,
_program: &Program,
_inputs: &[&(dyn DeviceBuffer + 'static)],
_outputs: &mut [&mut (dyn DeviceBuffer + 'static)],
_config: &DispatchConfig,
) -> Result<(), BackendError>
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§
impl Freeze for CpuRefBackend
impl RefUnwindSafe for CpuRefBackend
impl Send for CpuRefBackend
impl Sync for CpuRefBackend
impl Unpin for CpuRefBackend
impl UnsafeUnpin for CpuRefBackend
impl UnwindSafe for CpuRefBackend
Blanket Implementations§
Source§impl<T> Backend for Twhere
T: VyreBackend + ?Sized,
impl<T> Backend for Twhere
T: VyreBackend + ?Sized,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> TypedDispatchExt for Twhere
T: VyreBackend + ?Sized,
impl<T> TypedDispatchExt for Twhere
T: VyreBackend + ?Sized,
Source§fn dispatch_bytes(
&self,
program: &Program,
inputs: &[&[u8]],
config: &DispatchConfig,
) -> Result<Vec<Vec<u8>>, BackendError>
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,
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 moreSource§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,
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 moreSource§fn dispatch_u32(
&self,
program: &Program,
inputs: &[&[u32]],
config: &DispatchConfig,
) -> Result<Vec<Vec<u32>>, BackendError>
fn dispatch_u32( &self, program: &Program, inputs: &[&[u32]], config: &DispatchConfig, ) -> Result<Vec<Vec<u32>>, BackendError>
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>
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