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

status = DftiSetValue( pHandle, DFTI_PACKED_FORMAT, DFTI_CCS_FORMAT);

Erich_Zwyssig
Beginner
527 Views
Hello all

Am I right in assuming that the good ault dzfft1d used the CCS format (by default) and the new Dfti procedures use Pack (by default)?

Therefore
- status = DftiSetValue( pHandle, DFTI_PACKED_FORMAT, DFTI_CCS_FORMAT);
should get me the same DFT output in Dfti as in dzfft1d?

Do I set the CCS format before or after DftiCommitDescriptor?

I tried before but cannot see a change in the DFT output.

Any advice?

Thanks for your help

Erich
0 Kudos
9 Replies
Dmitry_B_Intel
Employee
527 Views

Erich,

For 1D real-to-complex transform, DFTI assumes CCS storage as the default, the same as dzfft1d did. That is probably why you don't see a change in the output when you correctly set it before DftiCommitDescriptor.

Thanks
Dima

0 Kudos
Erich_Zwyssig
Beginner
527 Views
Hi Dima

Thank you for your reply.

> DFTI assumes CCS storage as the default

If that is the case, then I'd expect to see 0's in the data, i.e. in position '(0).im', but I don't.

Any idea what's wrong?


Thanks for your help

Erich
0 Kudos
Dmitry_B_Intel
Employee
527 Views
Erich,
This looks like a weird bug. Could you share how do the transform,what floating point precision, what language, what MKL version do you use, what platform, what is compile/link line?
Dima
0 Kudos
Erich_Zwyssig
Beginner
527 Views
Hi Dima

MKL 10.2.2.025
Linux 2.6.18-164.15.1.el5.inf.1PAE #1 SMP Tue Apr 27 10:03:58 BST 2010 i686 i686 i386 GNU/Linux
C++


then

MKL_LONG status;
status = DftiCreateDescriptor( &pHandle, DFTI_DOUBLE, DFTI_COMPLEX, 1, L);
status = DftiSetValue( pHandle, DFTI_PACKED_FORMAT, DFTI_CCS_FORMAT);
status = DftiCommitDescriptor( pHandle);


later

status = DftiComputeForward( pHandle, x_fft );


for compile and link I got a makefile. Are you interested in anything special? I'd rather not share the complete file, sorry.


Thanks for your help

Erich



0 Kudos
barragan_villanueva_
Valued Contributor I
527 Views
Hi Erich,

For real-to-complex transform you need to use

status = DftiCreateDescriptor( &pHandle, DFTI_DOUBLE, DFTI_REAL, 1, L);

Please take a look at $MKLROOT/examples/dftc/source/real_1d_ccs_double_ex*.c for more details.

Also, CCS format is by default for such transforms.
0 Kudos
Erich_Zwyssig
Beginner
527 Views
Hi Victor

Thanks for your help.

Question, what does the order of FFT, iFFT, setting the DFTI_BACKWARD_SCALE factor and
committing need to be?

status = DftiSetValue( pHandle, DFTI_BACKWARD_SCALE, Scale);
status = DftiCommitDescriptor( pHandle);


Can I set all values, then commit, i.e.
- create
- set #1 (format)
- set #2 (backward scale)
- commit

- run loads of FFTs
- run loads of iFFTs

or do
- set (backward scale)
- commit
need to be done after the FFT, right before the iFFT?

Thanks for your help


Kind regards

Erich
0 Kudos
barragan_villanueva_
Valued Contributor I
527 Views
Hi Erich,

The most correct way is

- create
- set all values you want (no commits are needed during settings)
- commit at last

and use FFTs or iFFTs.

But if you want to change some value again than commit will be required.
0 Kudos
Erich_Zwyssig
Beginner
527 Views
Hi Victor

Thanks for your reply.

It all seems to work fine now.

One final question. Would you expect to get the exact same values from mkl_crfft1d and DftiComputeBackward if Scale = 1.0/(double)n; is used?


Kind regards

Erich
0 Kudos
barragan_villanueva_
Valued Contributor I
527 Views

Erich

All DFTI transforms are not normalized and therefore you can use/(or not) scaling if needed.
For example,for 1D with using scaling=1/n you will get approximately the same (not exacltly the same) results after forwardplus backward transforms.

0 Kudos
Reply