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

DftiComputeForward vs dzfft1dc

melbinmathew1
Beginner
650 Views
Hi,

I have the old code of MKL which was using the dzfft1dc for forward transform and zdfft1dc for backward transform. Now i want to use the new MKL having the DftiComputeForward and DftiComputeBackward as the previous MKL library was not supporting 64-bit. I tried doing it but the ouput is having a huge varition from the older version.

This is the usage in the old code for forward transform:
double *x, *wsave;

const long n=1<<11;
x = new double[n+2];
wsave = new double[2*n+4];
ZeroMemory(x, (n+2)*sizeof(double));
CopyMemory(x, vIn,vIn.size()*sizeof(double));
dzfft1dc(x, n, 0, wsave);
dzfft1dc(x, n, 1, wsave);

This is the usage in the old code forBackward transform:

zdfft1dc(x, n, 0, wsave);
zdfft1dc(x, n, 1, wsave);

With the new code i tried like this for Forward transform:
----------------------------------------------------------------

DFTI_DESCRIPTOR_HANDLE handle;

long ret = DftiCreateDescriptor(&handle,

(DFTI_CONFIG_VALUE)DFTI_DOUBLE , (DFTI_CONFIG_VALUE)DFTI_REAL , 1, length);

long setval1 = DftiSetValue(handle, (DFTI_CONFIG_PARAM)DFTI_PLACEMENT, (DFTI_CONFIG_VALUE)DFTI_INPLACE);

long setval2 = DftiSetValue(handle, (DFTI_CONFIG_PARAM)DFTI_PACKED_FORMAT, (DFTI_CONFIG_VALUE)DFTI_PACK_FORMAT);

long comval = DftiCommitDescriptor(handle);

long retfor = DftiComputeForward(handle,vIn);

long retfree = DftiFreeDescriptor(&handle);

With the new code i tried like this for backward transform:
-------------------------------------------------------------------

DFTI_DESCRIPTOR_HANDLE handlebak;

long retbak = DftiCreateDescriptor(&handlebak,

(DFTI_CONFIG_VALUE)DFTI_DOUBLE , (DFTI_CONFIG_VALUE)DFTI_REAL , 1, length);

long transform_size = length;

double scale_factor = 1.0 / transform_size;

int setval = DftiSetValue(handlebak, (DFTI_CONFIG_PARAM)DFTI_BACKWARD_SCALE, scale_factor);

long setvalbak1 = DftiSetValue(handlebak, (DFTI_CONFIG_PARAM)DFTI_PLACEMENT, (DFTI_CONFIG_VALUE)DFTI_NOT_INPLACE);

long setvalbak2 = DftiSetValue(handlebak, (DFTI_CONFIG_PARAM)DFTI_PACKED_FORMAT, (DFTI_CONFIG_VALUE)DFTI_PACK_FORMAT);

long comvalbak = DftiCommitDescriptor(handlebak);

long retbakr = DftiComputeBackward(handlebak,vIn,vOut);

long retfreebak = DftiFreeDescriptor(&handlebak);


What i wanted to know is the setting which i doin the old code and the new code are same or not?
Like the settings which i do using the DftiSetValue is proper or not when we compare the old code and the new code.

Thanks,
Melbin

0 Kudos
3 Replies
Evgueni_P_Intel
Employee
650 Views
Hi
0 Kudos
melbinmathew1
Beginner
650 Views
Hi,

Thanks for the reply.

I tried compliling and running both versions n 32-bit itself and compared the values just to see if what i am doing is correct or not.

What i wanted to know is in the older verion(dzfft1dc) we had to give the array size as n+2. Is it the same in the new version also?

Is there any site where it gives the actual comparison between the old and the new ones?

Thanks & Regards,
Melbin
0 Kudos
Evgueni_P_Intel
Employee
650 Views

Hi

0 Kudos
Reply