You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have done very little testing with 2D or higher ranking transforms. But most of problems are related with alignment, as intrinsics used require strict 128 bit align.
Double datatype casting is used here to simplify following _mm_shuffle_pd instrinsics. We could have used _mm_load_ps (or _mm_loadu_ps) and then cast using _mm_castps_pd to _m128d datatype,
It looks like the problem is due to the "half spectrum" thing, which causes you to have N/2 + 1 coefficients. The constant coefficient is the one causing the +1 I believe. This is why the w is 64+1 = 65, and the transpose failing on this misaligned data. Note that I did not investigate this, but this is just what pops into my head, with my knowledge of fourier transforms.
I think you have found the problem. At the moment I don't have the time to fix it. One option is that you use 2D complex transform with imaginary part set to zero, so all input value are real numbers. It is slower but at least it works.
Nice! 😄 Well, speed is a very important aspect of my application. So for now, I will use the complex transform. Once fixed, I might change it back to the real_to_complex_2d transform. However, if you believe the fix is fairly easy and can outline it, I might consider trying to fix this (with PR off course).
Activity
mcourteaux commentedon Jul 11, 2017
I also get a segfault when trying to use the:
plan, no matter how big I allocate these buffers.
mcourteaux commentedon Jul 11, 2017
I modified the test.c file to use the plan
ffts_init_2d_real.linkotec commentedon Jul 11, 2017
Try replacing _mm_store_ps with _mm_storeu_ps as there is no guarantee that the memory is correctly aligned.
mcourteaux commentedon Jul 11, 2017
Check the pointers:
in=0x0000000101900800, out=0x0000000101b00000. Looks fairly aligned to me. Are you sure your comment still holds?mcourteaux commentedon Jul 11, 2017
However, I tried what you said, and now it crashes here:
The value of
wseems to be257(which looks like 2^8+1), and looks indeed something that screws with the alignment required.mcourteaux commentedon Jul 11, 2017
Also, the hardcoded
doubledatatype cast for a "single-precision" compiled library looks odd. I am a complete newbie to this library tho.linkotec commentedon Jul 11, 2017
I have done very little testing with 2D or higher ranking transforms. But most of problems are related with alignment, as intrinsics used require strict 128 bit align.
Double datatype casting is used here to simplify following _mm_shuffle_pd instrinsics. We could have used _mm_load_ps (or _mm_loadu_ps) and then cast using _mm_castps_pd to _m128d datatype,
You could test with my benchFFTS, https://github.com/linkotec/benchFFTS. It supports tests for 2D, for example "bench_ffts -s ocb512x128"
mcourteaux commentedon Jul 12, 2017
Some thing of course: (note the
orbvsocb)LLDB gives the same as previously:
mcourteaux commentedon Jul 12, 2017
It looks like the problem is due to the "half spectrum" thing, which causes you to have N/2 + 1 coefficients. The constant coefficient is the one causing the +1 I believe. This is why the
wis64+1 = 65, and thetransposefailing on this misaligned data. Note that I did not investigate this, but this is just what pops into my head, with my knowledge of fourier transforms.jtojanen commentedon Jul 12, 2017
I think you have found the problem. At the moment I don't have the time to fix it. One option is that you use 2D complex transform with imaginary part set to zero, so all input value are real numbers. It is slower but at least it works.
mcourteaux commentedon Jul 12, 2017
Nice! 😄 Well, speed is a very important aspect of my application. So for now, I will use the complex transform. Once fixed, I might change it back to the
real_to_complex_2dtransform. However, if you believe the fix is fairly easy and can outline it, I might consider trying to fix this (with PR off course).emmenlau commentedon Mar 9, 2022
Hi, did anyone work on this? I'd like to use the 2d real transform too, would be great if it works...