This is a CUDA kernel repository that provides spherical harmonics, which outputs the identical results as Boost package:
boost::math::spherical_harmonic_r(n, m, theta, phi);
boost::math::spherical_harmonic_i(n, m, theta, phi);
Reference
https://github.com/NVIDIA/torch-harmonics
Schaeffer, N.; Efficient spherical harmonic transforms aimed at pseudospectral numerical simulations, G3: Geochemistry, Geophysics, Geosystems.