Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
7234 Discussions

Do the MKL FFT Handler creation uses malloc??

shiva_rama_krishna_b
1,157 Views

Hi,

When we want to use MKL FFT we create a handler for that. So do this handler creation involves malloc system call? If not which method is used to allocate memory.

 

Thanks

sivaramakrishna

0 Kudos
4 Replies
Evgueni_P_Intel
Employee
1,157 Views

MKL calls the i_malloc callback function which has the same interface as malloc and can be overridden by the user.

0 Kudos
shiva_rama_krishna_b
1,157 Views

Thank you Evgueni Petrov.

what happens If more than one thread calls creation of handler of its own. do they run sequncially or parallel?.

Thanks

sivaramakrishna

0 Kudos
Evgueni_P_Intel
Employee
1,157 Views

MKL does not serialize execution of DftiCreateDescriptor in different application threads.

0 Kudos
shiva_rama_krishna_b
1,157 Views

Hi Evgueni Petrov,

I was trying call FFT by multiple threads at a time. code snippet looks like below. I noticed  [MKLSERVICE]@lock function in vtune profiler. when i pulled the handler creation outside the loop, i did not find [MKLSERVICE]@lock in vtune profiler. This is actually making me to believe that MKL is doing some locking while allocating handler.

#pragma omp parallel num_threads(236)
for(i = 0; i < 236; i++)
{
                          .
                          .
                          .
                       some functions..
                          .
                          .

                      create handler one for each 'i'.
                      Call FFT using 'i'.

}

Thanks

sivaramakrishna

0 Kudos
Reply