Skip to main content

sim_lib_compute_wgpu/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Evidence-based `wgpu` tensor compute site discovery.
4//!
5//! This crate discovers physical adapters deterministically, requests a bounded
6//! device profile, records granted limits and features, and exports SIM tensor
7//! sites only for adapters that pass transfer, mapping, and allocation probes.
8
9mod arena;
10mod kernel_elementwise;
11mod kernel_linalg;
12mod kernel_reductions;
13mod kernel_support;
14mod kernel_wgsl;
15mod kernels;
16mod materialization;
17mod pipeline;
18mod probe;
19mod queue;
20mod segments;
21mod site;
22mod storage;
23mod transfer;
24
25pub use arena::{WgpuAllocationId, WgpuArenaAllocation, WgpuArenaSnapshot, WgpuResidentArena};
26pub use materialization::WgpuMaterializationCache;
27pub use pipeline::{
28    WgpuKernelDType, WgpuKernelOp, WgpuPipelineCache, WgpuPipelineCacheSnapshot, WgpuPipelineKey,
29    WgpuPipelineRecord, WgpuTileProfile,
30};
31pub use probe::{
32    AllocationAttempt, ProbeEvidence, ProbePolicy, RequestedWgpuProfile, TransferEvidence,
33    WgpuAdapterEvidence, WgpuAdapterProbe, WgpuCapabilityEvidence, WgpuDiscovery,
34    WgpuDiscoveryError, WgpuLimitEvidence, discover_wgpu_adapters,
35};
36pub use queue::{WgpuQueueLimits, WgpuQueueSnapshot, WgpuSubmissionQueue};
37pub use segments::{WgpuResidentSegment, WgpuSegmentPlan};
38pub use site::{
39    ComputeWgpuLib, WgpuTensorExecutor, compute_wgpu_capability, compute_wgpu_lib_symbol,
40    compute_wgpu_site_symbol, wgpu_executor_symbol,
41};
42pub use storage::WgpuResidentStorage;
43pub use transfer::{WgpuTransferPlan, WgpuTransferSpan};
44
45/// Cookbook recipes for this lib, embedded at build time.
46pub static RECIPES: sim_cookbook::EmbeddedDir =
47    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
48
49#[cfg(test)]
50mod tests;