Expand description
GPU kernel implementations for batch special-function evaluation.
This module houses compute-shader sources and host-side dispatch stubs for two GPU backends:
| Sub-module | Backend | Feature flag | Default |
|---|---|---|---|
wgsl | WebGPU (WGSL shaders) | gpu via scirs2-core/gpu | off |
cuda | CUDA / ROCm | cuda_kernels | off |
Both backends currently provide stub implementations that return
“not available” errors. The actual dispatch logic lives in
crate::gpu_dispatch which calls these stubs under
DispatchTarget::Gpu and falls back to the CPU rayon path automatically.
§Pure Rust policy
The cuda_kernels feature is off by default. CUDA depends on C dynamic
libraries (libcuda.so, libcudart.so) which violate the Pure Rust
Policy unless feature-gated. WebGPU is Pure Rust (via wgpu) but the
host-side integration with scirs2-core/gpu is not yet stabilised.
Modules§
- cuda
- CUDA/ROCm kernel dispatch stubs for batch special-function evaluation.
- wgsl
- WGSL compute-shader kernels for WebGPU-backed dispatch of batch special functions.
Enums§
- Cuda
Dispatch Error - Error type for CUDA/ROCm dispatch.
- Wgsl
Dispatch Error - Error type for WGSL/WebGPU dispatch.
Constants§
- BESSEL_
J0_ PTX_ STUB - Inline PTX stub for batch Bessel J₀ evaluation.
- BESSEL_
J0_ WGSL - WGSL compute shader for batch Bessel J₀ evaluation.
- ERFC_
WGSL - WGSL compute shader for batch
erfcevaluation. - ERFINV_
WGSL - WGSL compute shader for batch inverse-erf evaluation.
- ERF_
PTX_ STUB - Inline PTX stub for batch
erfevaluation. - ERF_
WGSL - WGSL compute shader for batch
erfevaluation. - GAMMA_
PTX_ STUB - Inline PTX stub for batch Gamma evaluation on CUDA devices.
- GAMMA_
WGSL - WGSL compute shader for batch Gamma evaluation (Lanczos g=7 approximation).
- LGAMMA_
WGSL - WGSL compute shader for batch log-gamma evaluation.
Functions§
- bessel_
j0_ batch_ cuda - Attempt batch Bessel J₀ evaluation on a CUDA device.
- bessel_
j0_ batch_ wgpu - Stub: returns
WgslDispatchError::GpuNotAvailablewhenwgpu_kernelsis off. - erf_
batch_ cuda - Attempt batch
erfevaluation on a CUDA device. - erf_
batch_ wgpu - Stub: returns
WgslDispatchError::GpuNotAvailablewhenwgpu_kernelsis off. - erfc_
batch_ wgpu - Stub: returns
WgslDispatchError::GpuNotAvailablewhenwgpu_kernelsis off. - erfinv_
batch_ wgpu - Stub: returns
WgslDispatchError::GpuNotAvailablewhenwgpu_kernelsis off. - gamma_
batch_ cuda - Attempt batch Gamma evaluation on a CUDA device.
- gamma_
batch_ wgpu - Stub: returns
WgslDispatchError::GpuNotAvailablewhenwgpu_kernelsis off. - lgamma_
batch_ wgpu - Stub: returns
WgslDispatchError::GpuNotAvailablewhenwgpu_kernelsis off.