1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! GPU (CUDA) acceleration primitives for OxiProj — feature `gpu`.
//!
//! This module is the shared foundation that the higher-level OxiProj crates
//! (`oxiproj-transformations`, `oxiproj`) build their GPU kernels on. It is
//! powered by the Pure-Rust `oxicuda` stack, which loads `libcuda.so` at
//! runtime: there is **no** build-time CUDA Toolkit dependency, and when no CUDA
//! device is present every public entry point degrades to a CPU fallback in the
//! calling crate (gated by [`cuda_available`]).
//!
//! # What lives here
//!
//! * [`cuda_available`] / [`device_name`] — runtime device probe (cached per
//! thread) used as the GPU/CPU dispatch guard.
//! * [`with_kernel`] — compile-once / cache PTX, then run a closure with the
//! ready [`Kernel`] and the thread's [`Stream`].
//! * [`launch_1d`] — launch an element-wise kernel over `n` threads and
//! synchronise.
//! * [`ptx_math`] — the PTX assembly toolkit (target detection, `f64`
//! immediates, Horner polynomials, and the f64 transcendental device-function
//! library).
//!
//! The crate's GPU types from `oxicuda` ([`DeviceBuffer`], [`Kernel`],
//! [`Stream`], [`CudaError`], [`CudaResult`]) are re-exported so that downstream
//! crates can author kernels through a single `oxiproj_core::gpu::…` path without
//! taking their own direct dependency on `oxicuda`.
//!
//! # Safety
//!
//! All `unsafe` (driver FFI, device-memory handling) is encapsulated inside
//! `oxicuda`; this crate — and everything built on this module — remains
//! `#![forbid(unsafe_code)]`.
pub use ;
pub use ;
// Re-export the oxicuda surface kernel authors need so downstream OxiProj crates
// have a single dependency path and need not depend on `oxicuda` directly.
pub use ;