Abstract We present cunuSHT https://github.com/Sebastian-Belkner/cunuSHT, a general-purpose Python package that wraps a highly efficient CUDA implementation of the nonuniform spin-0 spherical harmonic transform. The method is applicable to arbitrary pixelization schemes, including schemes constructed from equally-spaced iso-latitude rings as well as completely nonuniform ones. The algorithm has an asymptotic scaling of $\mathcal {O}{(\ell _{\rm max}^3)}$ for maximum multipole ℓmax and can be made to achieve machine precision accuracy, considering band-limited transforms for which $N\approx \ell _{\rm max}^2$ (where N is the number of pixels in the map). While cunuSHT is developed for applications in cosmology in mind, it is applicable to various other interpolation problems on the sphere. We outperform the fastest available CPU algorithm at problem sizes ℓmax ∼ 4 · 102 and larger. The speed-up increases with the problem size and reaches a factor of up to 5 for problems with a nonuniform pixelization and ℓmax > 4 · 103 when comparing a single modern GPU to a modern 32-core CPU. This performance is achieved by utilizing the double Fourier sphere method in combination with the nonuniform fast Fourier transform and by avoiding transfers between the host and device. For scenarios without GPU availability, cunuSHT wraps existing CPU libraries. cunuSHT is publicly available and includes tests, documentation, and demonstrations.
Read full abstract