Community
cancel
Showing results for 
Search instead for 
Did you mean: 
amcelroy
Beginner
77 Views

IPP FFT and OpenMP

Hello everyone,

I would like to combine OpenMP and the FFT code and had a quick question. I havea for loop that is executing an FFT routine multiple times, but when it gets to the actual FFT routine, I have only allocated 1 memory space (see code) which all threads need to share, which is non-ideal.

IppsFFTSpec_R_32f* spec;

ippsFFTInitAlloc_R_32f(&spec, x, IPP_FFT_DIV_FWD_BY_N, ippAlgHintFast);

omp_set_num_threads(2);

#pragma

omp parallel for

for(int counter = 0; counter < 10000; counter++)

{

//I would like to allocate and copy the spec table so that the loops are independant

ippsFFTFwd_RToPerm_32f((float*)ptrFFTVector, (float*)ptrFFTVector, spec, 0);

}

The question is, how can I allocate and copy the spec space into another, loop independant local variable. In the IPP, there is a command to initialize an FFT table, a command to allocate memoryand initialize a table, but no command to allocate and copy a table. How can I do this?

Thanks in advance,

Austin

0 Kudos
2 Replies
Vladimir_Dudnik
Employee
77 Views

Hi Austin,

our experts said that you not necessary need to copy FFT spec for each thread. By IPP conventions, Spec is read-only data. So all threads can share the same Spec

Regards,
Vladimir

you7878
Beginner
77 Views

Hello Experts
How about speed? Will it slow down calculations? Maybe it is more comfortable to have separate copy of FFT table for each thread? Even if I am using architecture with shared memory - Quad Core.
Thanks
Reply