Open Ka-zam opened 9 months ago
I just noticed there's a NaN test as well...
https://github.com/gnuradio/volk/pull/731
Need to update this PR with this as well for AVX512!
@Ka-zam #731 is essential for airspy-fmradion, and I've spent a few weeks solving the NaN issue. Please add the NaN test before completing your implementation.
@Ka-zam #731 is essential for airspy-fmradion, and I've spent a few weeks solving the NaN issue. Please add the NaN test before completing your implementation.
I think it's already in there and should work fine! Wrote a test program and
atan2(0.f, 0.f) == 0.f
for all kernels.
Here's some special values and a sanity check:
magnus@r7950x3d:~/src/kazam/scratch$ ./a.out
y : 1.00 -1.00 1.00 -1.00 nan nan 0.00 -0.00 1.00 -1.00
x : 1.00 1.00 -1.00 -1.00 1.00 nan 0.00 0.00 0.00 0.00
atan2(y, x):
generic : 0.79 -0.79 2.36 -2.36 nan nan 0.00 -0.00 1.57 -1.57
polynomial : 0.79 -0.79 2.36 -2.36 nan nan 0.00 -0.00 1.57 -1.57
a_avx512dq : 0.79 -0.79 2.36 -2.36 0.00 0.00 0.00 0.00 1.57 -1.57
Do we care about the sign of atan2(-0, 0)? What about propagating nan?
Added AVX512 kernels and some minor cleanup.
Using AVX512F yields 40% speedup over the AVX2_FMA implementation on my 7950X3D. Compared to the generic atan2 implementation this is a 65x speedup.