Skip to content

Commit 1415338

Browse files
authored
Change from powf to sqrtf
See Issue jonkhler#41 . The FFT coefficients of certain frequencies were inaccurate due to numeric/rounding errors in powf(s, 0.5).
1 parent 82c8bf2 commit 1415338

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

s2cnn/soft/s2_fft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _setup_s2_fft(b, nl, weighted):
150150
def _setup_s2fft_cuda_kernel(b, nspec, nbatch, device=0):
151151
kernel = Template('''
152152
#define COMPUTE_LM(s) \
153-
int l = powf(s, 0.5); \
153+
int l = sqrtf(s); \
154154
int m = (s - l * l) - l;
155155
156156
#define MOD(i, n) (((i) + (n)) % (n))

0 commit comments

Comments
 (0)