Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

IPP FFT and OpenMP

amcelroy
Beginner
517 Views

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
517 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

0 Kudos
you7878
Beginner
517 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
0 Kudos
Reply