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

what's my best choice on real-to-real FFT?

Chang_Lei
Beginner
485 Views

Hi everyone, I'm recently using r-2-r cosine FFT in my poisson solver. AndI wasconfused abouthow to chose fromTT routines, DFT routines and FFTw wrappers in MKL.
My detailed needs are:

1. Forward and backward staggered cosine transform
2. Multiple invoking of above FFT, which means I have many arrays of samelenth to transfer.
3. I want to use multi threads (8+ threads) to compute these transfers.

could someone give me instruction about which one is my best choice and what's the need of system environment(for example, the version of MKL).

Thanks.
Changlei

0 Kudos
1 Solution
Victor_Gladkikh
New Contributor I
485 Views
Hi Changlei

In you case, generalway of using TTis:

"
// Init transform
call ?_init_trig_transfor(...)
// Commit parameters and create DFTI handle
call ?_commit_trig_transfor(a(:,i)..)

// Do a set of forward transform
do i=1,n
call?_forward_trig_transform(a(:,i)...)
enddo

....
// Do a set of backward transform
do i=1,n
call ?_backward_trig_transform(a(:,i)...)
enddo

// Free
callfree_trig_transform(...)
"

Victor

View solution in original post

0 Kudos
6 Replies
Chang_Lei
Beginner
485 Views
for example, Description of ipar(10) in TT routines tells me:
"ipar(10) specifies the number of OpenMP threads to run TT routines in the OpenMP
environment of the Poisson Library. The default value is 1. You are highly
recommended not to alter this value. See also Caveat on Parameter
Modifications."
Does this mean I will take great risk to use TT routines with multi_threads?
0 Kudos
Victor_Gladkikh
New Contributor I
485 Views
Youcould use multi-threaded version of MKL TT routine without any risk,but I recommend use number of threads = 1for small transform.
0 Kudos
Chang_Lei
Beginner
485 Views
Thanks for your suggestion.
Here I have another question, if I have multiarrays (a(1:m,1:n)to transfor. These arrays is a two dimensional matrix. I have to do backward transforms when all forward transforms have been done. Can I invoke the TT routines in this way?
"call ?_init_trig_transfor(...)
do i=1,n
call ?_commit_trig_transfor(a(:,i)..)
call?_forward_trig_transform(a(:,i)...)
enddo
....
do i=1,n
call ?_backward_trig_transform(a(:,i)...)
enddo


or could I call the commit routine onlyonce?
If TT routines support multi-array transform, there will no this question.
0 Kudos
Victor_Gladkikh
New Contributor I
486 Views
Hi Changlei

In you case, generalway of using TTis:

"
// Init transform
call ?_init_trig_transfor(...)
// Commit parameters and create DFTI handle
call ?_commit_trig_transfor(a(:,i)..)

// Do a set of forward transform
do i=1,n
call?_forward_trig_transform(a(:,i)...)
enddo

....
// Do a set of backward transform
do i=1,n
call ?_backward_trig_transform(a(:,i)...)
enddo

// Free
callfree_trig_transform(...)
"

Victor

0 Kudos
Chang_Lei
Beginner
485 Views
Hi Victor, Thanks. That's exactly what I need.
When Commit parameters, using:
"
// Commit parameters and create DFTI handle
call ?_commit_trig_transfor(a(:,i)..)
"
You mean I can commit it using any column of matrix a? I'll try that.
Best regards!
0 Kudos
Victor_Gladkikh
New Contributor I
485 Views
Hi Chang,

Yes you canuse in ?_commit_trig_transfor routine any columns of the matrix a.

Best regards,
Victor
0 Kudos
Reply