pbrt/src/gpu/mod.rs
2026-02-18 19:53:13 +00:00

21 lines
478 B
Rust

pub mod context;
pub use context::{
GPU_STATE, GpuContext, GpuState, gpu_init, gpu_state, gpu_state_or_panic, gpu_thread_init,
};
pub mod wavefront;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum GpuError {
#[error("CUDA driver error: {0}")]
Driver(#[from] cudarc::driver::DriverError),
#[error("No GPU context initialized")]
NoContext,
}
pub fn gpu_unwrap() -> &'static GpuContext {
context::GPU_STATE.get().expect("GPU not initialized")
}