Expand description
GpuAccelerator trait and hardware acceleration abstraction.
This module defines the unified GpuAccelerator trait that provides a
hardware-agnostic interface for GPU compute operations. Concrete backends
(Vulkan/WGPU and CPU SIMD) implement the trait so callers never need to
branch on the active backend.
§Design
GpuAccelerator (trait)
├── WgpuAccelerator ── uses wgpu (Vulkan / Metal / DX12 / WebGPU)
└── CpuAccelerator ── uses rayon SIMD fallback (always available)§Quick Start
use oximedia_gpu::accelerator::{AcceleratorBuilder, GpuAccelerator};
let acc = AcceleratorBuilder::new().build()?;
let name = acc.name();
println!("Using backend: {name}");
let rgb = vec![0u8; 1920 * 1080 * 4];
let mut yuv = vec![0u8; 1920 * 1080 * 4];
acc.rgb_to_yuv(&rgb, &mut yuv, 1920, 1080)?;Structs§
- Accelerator
Builder - Ergonomic builder for creating a
GpuAccelerator. - CpuAccelerator
- Pure-CPU accelerator backed by rayon parallel iterators.
- Wgpu
Accelerator - GPU-backed accelerator using wgpu (Vulkan / Metal / DX12 / WebGPU).
Traits§
- GpuAccelerator
- Unified interface for hardware-accelerated media operations.