vyre
GPU compute intermediate representation with a proven standard operation library.
What this crate does
vyre is the compiler stack for GPU compute. Construct ir::Program values with
the IR builder, compose operations from the standard library, validate and lower
the result to WGSL, and dispatch the shader on a GPU backend.
Install
Quick example
The snippet below builds a small program, validates it, lowers it to WGSL, and
dispatches it on the GPU via wgpu. It also requires bytemuck and wgpu in
Cargo.toml.
use *;
use ;
use DeviceExt;
let program = new;
assert!;
let wgsl = lower.unwrap;
let = cached_device.unwrap;
let pipeline = compile_compute_pipeline.unwrap;
let a = device.create_buffer_init;
let b = device.create_buffer_init;
let out = device.create_buffer;
let bg = device.create_bind_group;
let mut enc = device.create_command_encoder;
queue.submit;
Buffer readback and a complete runnable version are in
examples/02_xor_gpu_dispatch.rs.
Why vyre
- Composable primitives (Cat A): any algorithm is a composition of simpler ops with zero-cost lowering.
- Hardware intrinsics (Cat C): ops declare GPU instruction backing per-target; swap hardware, swap intrinsics.
- Forbidden patterns (Cat B): no typetag, no trait-object routing, no runtime plugin magic. Closed-enum semantics throughout.
Conformance
Pair vyre with vyre-conform for a binary verdict on backend correctness.
certify(&backend) returns Ok(cert) or Err(violation).
The book
Documentation and tutorials live in core/docs/. Read them locally or build the
mdbook when a rendered site is available.
License
MIT OR Apache-2.0.