19 lines
446 B
Rust
19 lines
446 B
Rust
mod context;
|
|
|
|
pub use context::{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_CONTEXT.get().expect("GPU not initialized")
|
|
}
|