Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

FFT library and allocatable arrays

John_Kornak
Beginner
400 Views
Hi,

I would appreciate any help I can get with the following:

I would like to be able to perform 2D fft on allocatable arrays, but the problem is that I need to have them as 1-D arrays for the Intel Math Kernel FFT library. The solution given in the manual is to use the equivalence statement but that doesn't work for dynamic arrays. I can think of 2 very clunky solutions:

1) Convert matrices to 1-D before DFT and then back to 2D (but I guess this has considerable overhead?)
2) Index all arrays as 1-D. (likely to lead to a lot of bugs)

I would appreciate any more elegant and efficient solution that I can get!

I am using ifort 11.1 on an iMac with an intel Core i7 processor and running Snow Leopard version 10.6.5. I am embarrased to say that I am not sure how to figure out what version of the math kernel I have but I installed the latest version around a month ago.

Thanks

John
0 Kudos
3 Replies
Dmitry_B_Intel
Employee
400 Views
Hi John,

This issue can be worked around as follows:
[fortran]real input(:,:)
complex output(:,:)
allocate(input(M,N), output(M/2+1,N))
...
s = DftiComputeForward(desc, input(:,1), output(:,1))
[/fortran]

This technique assumes that compiler will simply pass pointers to the i/o arrays to the compute funcion. This may not work with array sections, like input(1:100:2,1).

MKL version can be printed with this example (see also examples/servicefuncsf in your MKL installation)
[fortran]program mklversion
  character*(200) :: MKLGetVersionString
  external MKLGetVersionString
  print *, trim(MKLGetVersionString())
end program mklversion
[/fortran]

Thanks
Dima
0 Kudos
Todd_R_Intel
Employee
400 Views
Here are two more ways that you can find out the version of Intel MKL you're using:
  1. If you know the compiler version and update number then you can use the table in our knowledgebase with corresponding library versions. There are now two tables actually: one for the compiler pro line (which it sounds you're currently using) and one for the new Intel Composer XE 2011 products.
  2. In the doc directory open the mklsupport* file.
Todd
0 Kudos
John_Kornak
Beginner
400 Views
Sorry for the delay reporting back. It took me a while to get back to this project.

Thank you very much Dmitry and Todd. Your solutions worked perfectly for me.

Cheers

John
0 Kudos
Reply