libmatern: Fast and Accurate Matérn Covariance Evaluation on SIMD CPUs and CUDA GPUs
Efficient and accurate evaluation of the Matérn covariance function is essential for computationally demanding spatial statistics and Gaussian-process applications. We present libmatern, a numerical library that substantially accelerates Matérn covariance evaluation on SIMD CPUs and CUDA GPUs while maintaining competitive or improved numerical accuracy. On synthetic benchmarks, our single-threaded AVX-512 implementation is 6.6× faster than the fastest tested external CPU implementation for a random mixture of 2²⁵ evaluations, and 3.9× to 21× (median 7.5×) faster across eight test datasets. On the tested GPU, our CUDA implementation achieves kernel-level speedups of 1.7× to 6.8× (median 2.3×) over the fastest tested external implementations, with an end-to-end median speedup of 1.1× when host–device transfers are included. These performance gains are accompanied by competitive or improved numerical accuracy across the investigated parameter regimes. As a novelty of our approach we rigorously incorporate the Matérn prefactor directly into numerical formulations for the modified Bessel function Kν, reducing intermediate floating-point range restrictions and improving accuracy on nearly all tested datasets even without SIMD execution. Architecture-dependent algorithm selection and hardware-specific optimisation provide additional performance gains. The results demonstrate that mathematical reformulation and hardware-specific optimisation provide complementary benefits for accurate and efficient Matérn covariance evaluation.
Authors
- Martin Schlather (ORCID: https://orcid.org/0000-0002-6919-7249)
- Daniel Mann (ORCID: https://orcid.org/0009-0005-6089-0011)
- Matthis Ehrhardt
Institutions
- University of Mannheim (DE)
Publication Details
- Journal
- Journal of Reproducible Statistics
- Published
- 2026-11-24
- DOI
- https://doi.org/10.68365/jrepstat.2026.13
- Primary Topic
- Parallel Computing and Optimization Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00