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

Observing differences with 1D real FFTs in OneAPI 2023 icc

Mike6723
Novice
1,550 Views

I'm seeing differences in results when running the following test with OneAPI icc in 2023 versus previous releases.  I'm compiling with the following command on RHEL 9.1 with OneAPI 2023, 

icc mkltest.c -L$MKLROOT/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl

and seeing results:

bash-5.1$ a.out
0.000000
0.000000

Whereas the results when building and running with earlier versions of OneAPI on a supported RHEL OS is

bash-4.2$ a.out
0.000000
2.000000

 

Any ideas?

 

Here's the test program, mkltest.c

#include <stdio.h>
#include "mkl_dfti.h"
void mkltest();
​
int main() {
    mkltest();
    return(0);
}
​
​
void mkltest()
{
  int n = 2;
  float seq[2]={1.0, -1.0};
  float result[2];
  long Status;
  DFTI_DESCRIPTOR_HANDLE *Desc_Handle = NULL;
​
  Desc_Handle = (DFTI_DESCRIPTOR_HANDLE*) malloc (sizeof(DFTI_DESCRIPTOR_HANDLE));
​
  Status = DftiCreateDescriptor(Desc_Handle, DFTI_SINGLE, DFTI_REAL, 1, n);
​
  Status = DftiSetValue(*Desc_Handle, DFTI_PACKED_FORMAT, DFTI_PACK_FORMAT);
  Status = DftiSetValue(*Desc_Handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
  Status = DftiCommitDescriptor(*Desc_Handle);
  if (!DftiErrorClass(Status, DFTI_NO_ERROR) ) {
     printf("MKL error 1. \n");
  }
​
  Status = DftiComputeForward (*Desc_Handle, seq, result);
  if (!DftiErrorClass(Status, DFTI_NO_ERROR) ) {
     printf("MKL error 2. \n");
  }
​
  printf("%f\n%f\n", result[0], result[1]);
​
}

 

7 Replies
ShanmukhS_Intel
Moderator
1,496 Views

Hi Mike,


Thanks for posting in Intel Communities and sharing the information.


We are able to reproduce your issue on our end. We are working on your issue internally. We will get back to you soon with an update.


Best Regards,

Shanmukh.SS


ShanmukhS_Intel
Moderator
1,404 Views

Hi Mike,

 

Could you please add the below snippet before the commit and let us know if you still face any differences?

 

New default DFTI_CONJUGATE_EVEN_STORAGE is now DFTI_COMPLEX_COMPLEX. Hence you could incorporate this change in your current code and you could let us know is issue persists.

 

Status = DftiSetValue(*Desc_Handle, DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_REAL);

 

We could see the expected results after the above code updation.

 

MKL Version: Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications

u80864@s001-n007:~/shan/mkl$ ./a.out

0.000000

2.000000

 

Best Regards,

Shanmukh.SS

0 Kudos
Mike6723
Novice
1,342 Views

Hi Shanmukh,
Inserting that line resolves the issue we were seeing when updating to OneAPI 2023. Thank you.

Do you know if this change in OneAPI 2023 was a bug/regression and we should expect the need for this line to go away in a future release of OneAPI?

Thank you,
--Mike

 

0 Kudos
ShanmukhS_Intel
Moderator
1,278 Views

Hi Mike,


>>Do you know if this change in OneAPI 2023 was a bug/regression and we should expect the need for this line to go away in a future release of OneAPI?

We would like to inform you that It's not a bug and a required configuration parameter starting from oneMKL2023.0 which was updated in oneMKL2023.0. New default DFTI_CONJUGATE_EVEN_STORAGE is now DFTI_COMPLEX_COMPLEX


Best Regards,

Shanmukh.SS


0 Kudos
Mike6723
Novice
1,258 Views

Thank you for the details.

--Mike

0 Kudos
ShanmukhS_Intel
Moderator
1,239 Views

Hi Mike,


Thanks for the confirmation!


If this resolves your issue, please accept this as a solution. It would help other users with similar issues


Best Regards,

Shanmukh.SS


0 Kudos
ShanmukhS_Intel
Moderator
1,173 Views

Hi Mike,


It’s great to know that the issue has been resolved, in case you run into any other issues please feel free to create a new thread.


Best Regards,

Shanmukh.SS


0 Kudos
Reply