Skip to main content

Module numerics_device

Module numerics_device 

Source
Expand description

Shared device-side probit numerics for NVRTC kernels.

PROBIT_NUMERICS_CU is prepended to every NVRTC kernel source that needs stable probit/normal-CDF arithmetic. Keeping one copy here means a numerics fix is a one-line change instead of a coordination problem across multiple kernel source strings.

Covered device functions (all __device__ __forceinline__, double precision):

  • erfcx_nonnegative(x) — scaled complementary error function for x ≥ 0
  • log_ndtr(x) — log Φ(x), numerically stable in the deep left tail
  • log_ndtr_and_mills(x, *log_cdf, *lambda) — joint (log Φ(x), φ(x)/Φ(x))

Constants§

PROBIT_NUMERICS_CU
Device-side probit numerics injected at the top of every NVRTC kernel that needs them. Prepend this string to a kernel-specific body before passing to cudarc::nvrtc::compile_ptx or PtxModuleCache::get_or_compile.