-
Couldn't load subscription status.
- Fork 55
Description
Hi, I am measuring the speed of cross-correlation in the frequency domain and I am comparing different packages, ( my code in Julia 1.3.1, some C++ code and some Python code ).
This is the code for generating the in-place plans, in case its useful.
corr_size = (IA, IA); # input/output size
corr_matrix = zeros( Float64, corr_size ); # output array
padi = rand( Complex{Float64}, corr_size ); # input array 1
pads = rand( Complex{Float64}, corr_size ); # input array 2
plan = FFTW.plan_fft!( padi, flags=FFTW.MEASURE );
iplan = FFTW.plan_ifft!( padi, flags=FFTW.MEASURE );
After performing the evaluations for different values of IA I realized that Julia matches the speed of calling libfftw3 from C++, except for non-prime sizes, like 17, 19, 23. Curiously, Julia takes twice the time as C++, which suggests to me that maybe the code behind FFTW.jl has some internal overhead in these cases.
I decided to do show( plan ); in Julia and the respective fftw_print_plan in C++ and confirmed that the plans generated from Julia are identical as the ones from C++. This is what a plan looks like for IA = 10:
FFTW in-place forward plan for 10×10 array of Complex{Float64}
(dft-rank>=2/1
(dft-direct-10-x10 "n1fv_10_avx2")
(dft-direct-10-x10 "n1fv_10_avx2"))
For IA = 17:
FFTW in-place forward plan for 17×17 array of Complex{Float64}
(dft-rank>=2/1
(dft-vrank>=1-x17/1
(dft-generic-17))
(dft-vrank>=1-x17/1
(dft-generic-17)))
The plan looks different and seems to be dividing the Fourier Transform into two elements. ...two elements in the plan description, double the execution time... maybe this is hinting to something, but I don't have the knowledge to follow it.
This is basically all info I have gathered.
I can also say that I am running the code on linux, and FFTW_jl has chosen "x86_64-linux-gnu.jl" as its preferred platform. I tried linking my C++ script to the libfftw3.so in .julia/Artifacts and C++ didn't show this delay. Therefore, either I linked it wrong, or it's not a problem of the library.