silvic_gpu/lib.rs
1//! Metal and CUDA backends for silvic.
2//!
3//! The kernels are written once (`kernels/kernels.kern`) against a small macro vocabulary that
4//! `kernels/prelude_metal.h` and `kernels/prelude_cuda.h` define for Metal Shading Language and CUDA C++, and are
5//! compiled at run time (Metal `newLibraryWithSource`, NVRTC). [`GpuBackend`] implements `silvic_core::Backend` once
6//! over the [`GpuDevice`] primitives, so the Metal and CUDA backends differ only in their device layer.
7
8mod backend;
9#[cfg(feature = "cuda")]
10pub mod cuda;
11mod device;
12#[cfg(all(feature = "metal", target_os = "macos"))]
13pub mod metal;
14mod params;
15
16pub use backend::GpuBackend;
17pub use device::{Arg, GpuDevice};
18pub use params::kernel_source;