2 releases
| 0.3.2 | Sep 11, 2025 |
|---|---|
| 0.3.0 | Sep 10, 2025 |
#1025 in Math
28 downloads per month
40KB
907 lines
GPU Foundations: device array abstraction and CPU-backed baseline ops.
scir-gpu
Overview
- GPU foundations for SciR. Provides a minimal
DeviceArray<T>abstraction, CPU baselines, and optional CUDA paths behind thecudafeature.
Features
- cuda: enables CUDA Driver API usage with embedded PTX kernels for f32 elementwise add/mul and batched FIR.
Requirements (CUDA)
- NVIDIA GPU with recent driver installed (libcuda present on host).
- On Linux, ensure
libcuda.sois visible to the container or process; on Windows,nvcuda.dllis required.
Quick start
- CPU tests:
cargo test -p scir-gpu - CUDA tests:
cargo test -p scir-gpu --features cuda
APIs
DeviceArray<T>: shaped arrays withdeviceanddtype. CPU-backed storage today.- Elementwise:
add_scalar_auto,mul_scalar_auto,add_auto(f32) dispatch to CUDA when available. - FIR:
fir1d_batched_f32_auto(x, taps, device)chooses CUDA or CPU and falls back to CPU if CUDA is unavailable.
Dependencies
~1.5MB
~28K SLoC