oxiproj-core 0.1.2

Foundation types for OxiProj: coordinates, errors, ellipsoids, datums, and units.
Documentation
//! 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)]`.

mod context;
mod launch;
pub mod ptx_math;
pub mod ptx_transc;

pub use context::{cuda_available, device_name, with_kernel};
pub use launch::{launch_1d, run_inplace_pinned, upload, BLOCK};

// 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 oxicuda::{CudaError, CudaResult, DeviceBuffer, Kernel, Stream};