ruda
Unified entry point for Ruda GPU kernels and compute backends. Select CUDA, HIP, or WGPU through Cargo features. The portable host runtime lives in ruda-runtime and remains available through ruda::runtime.
Interfaces
runtime::clientandruntime::server: submit work and implement compute services.runtime::storage,memory_management, andallocator: manage backend allocations.runtime::backend,compiler, andkernel: implement runtime and compiled-kernel contracts.dslandprelude: kernel DSL and launch interfaces, enabled by any GPU backend.cuda,hip, andwgpu: the selected driver's public API.
Usage
Cargo package: ruda. Rust import: ruda.
For AMD HIP or a cross-vendor WGPU backend, choose one of:
CUDA requires a compatible NVIDIA driver and CUDA Toolkit; HIP requires a compatible AMD GPU and ROCm/HIP environment; WGPU requires a compatible GPU and graphics driver. Cargo adds the dependency; it does not install these drivers.
Use ruda::cuda::{CudaDevice, CudaRuntime}, ruda::hip::{AmdDevice, HipRuntime}, or ruda::wgpu::{WgpuDevice, WgpuRuntime} with ruda::prelude::*.
From the source workspace, run the same vector-add kernel with the selected backend:
When enabling multiple backends, select one explicitly for the example:
Features
Default features: runtime-default.
| Feature | Purpose |
|---|---|
cuda |
NVIDIA CUDA backend, exposed as ruda::cuda. |
hip |
AMD ROCm/HIP backend, exposed as ruda::hip. |
wgpu |
Cross-vendor WGPU backend, exposed as ruda::wgpu. |
direct-ptx |
Enable CUDA and its direct PTX compiler; select it with RUDA_CUDA_COMPILER=ptx. |
kernel |
Expose the kernel DSL and prelude without selecting a GPU backend. |
runtime |
Expose the runtime modules. |
runtime-std |
Enable host configuration and standard-library integration. |
runtime-storage-bytes |
Enable byte-backed storage support. |
runtime-tracing |
Enable runtime tracing. |