- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MKL experts
I hope someone can help me understand the setting of DFTI_NUMBER_OF_TRANSFORMS
For example if I have a loop that implements an FFT of the same dimensions on each iteration:
StatusSmall = DftiCreateDescriptor(FFTid, DFTI_SINGLE, DFTI_COMPLEX, 2, lgth)
StatusSmall = DftiCommitDescriptor(FFTid)
DO lps=1,10
StatusBig = DftiComputeForward(FFTid, DFTarray)
DFTarray = SomeFunction(DFTarray)
END DO
Do I set DFTI_NUMBER_OF_TRANSFORMS to 1 or 10?
If not 10, then for what kind of situation do you need to set DFTI_NUMBER_OF_TRANSFORMS to a number other than 1?
Thanks
John
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi John,
With DFTI_NUMBER_OF_TRANSFORMS = N function DftiComputeForward will do N transforms in a single call. The idea can be illustrated on basis of your example as follows:
Thanks
Dima
With DFTI_NUMBER_OF_TRANSFORMS = N function DftiComputeForward will do N transforms in a single call. The idea can be illustrated on basis of your example as follows:
[fortran]complex :: multple_dftarray(lgth(1),lgth(2),10) ... DftiSetValue(fftid,DFTI_NUMBER_OF_TRANSFORMS,10) DftiSetValue(fftid,DFTI_INPUT_DISTANCE, lgth(1)*lgth(2) ) ... statusbig = DftiComputeForward(fftid, multiple_dftarray) ! does 10 two-d transforms do lps = 1, 10 dft_array = somefunction( multiple_dftarray(:,:,lps) ) enddo [/fortran]
Thanks
Dima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Dima,
One follow up question. Is this multiple dft process more efficient than doing the 10 two-d transforms separately or does it just provide for more compact syntax?
Cheers
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi John,
If you do a bunch of small transforms, where function call overhead comprises a noticeable part of the transform time, doing the bunch in a single call is more efficient. For large transforms doing the transforms separately may be more efficient, because each of the separate transforms will be done in parallel, whereas the bunch of transform will be often parallelized in a transform per thread fashion.
Thanks
Dima
If you do a bunch of small transforms, where function call overhead comprises a noticeable part of the transform time, doing the bunch in a single call is more efficient. For large transforms doing the transforms separately may be more efficient, because each of the separate transforms will be done in parallel, whereas the bunch of transform will be often parallelized in a transform per thread fashion.
Thanks
Dima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Dima,
That makes a lot of sense :)
Do you have a rough intuition of what would be small enough for the function call overhead to become significant?
Thanks
John
That makes a lot of sense :)
Do you have a rough intuition of what would be small enough for the function call overhead to become significant?
Thanks
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi John,
For example, if the data for one transform fits into L1 cache (32Kb) then threading overhead will likely overweight speedup due to parallelization. The data includesprecomputed trigonometric tables used toperfrom the FFT.
Thanks
Dima
For example, if the data for one transform fits into L1 cache (32Kb) then threading overhead will likely overweight speedup due to parallelization. The data includesprecomputed trigonometric tables used toperfrom the FFT.
Thanks
Dima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks again Dima,
I really appreciate your help.
Best
John
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page