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

MKL FFT on Iris Xe Graphics

stemsc
Beginner
917 Views

Hi all.

I'm using MKL (ver. 2019.4.245) programmatically to calculate FFT : by linking static .lib (mkl_core.lib, mkl_intel_lp64.lib, mkl_intel_thread.lib) into a VS 2019 C++  project.

All worked fine comparing results with the FFT by Matlab on all PC with Intel processor (11th generation family) and Intel Graphics UHD Family.

Problem : running the same project on PC with Intel Iris Graphics Family, results are wrong: some output values are NaN (!) and only some values (the first) of original matrix columns are well processed.

So that I moved to use last MKL : Intel oneAPI 2022.01 supposing new version supporting those Iris, but obtaining the same results as previous version of MKL.

 

The C/C++ code is very simple:

---------------------------------------------------------------------------------------------------------------------

void FourierTransform(_MKL_Complex8* l_pMklInputOutputData, // input vectors
int p_iNumberOfRow, // num rows
int p_iNumberOfCol) // num columns
{
DFTI_DESCRIPTOR* l_pMklDftDescriptor=NULL;
DftiCreateDescriptor(&l_pMklDftDescriptor, DFTI_SINGLE, DFTI_COMPLEX, 1, (MKL_LONG)p_iNumberOfRow);
float l_fRangeScaleFactor = (float)(1.0);
DftiSetValue(l_pMklDftDescriptor, DFTI_FORWARD_SCALE, l_fRangeScaleFactor);
DftiCommitDescriptor(l_pMklDftDescriptor);

for(l_iCol = 0; l_iCol< p_iNumberOfCol;l_iCol++)
{
_MKL_Complex8* l_pMklData = &l_pMklInputOutputData[l_iCol*p_iNumberOfRow];

// calculate FFT
l_ulResult = DftiComputeForward(l_pMklRangeDftDescriptor, l_pMklData, l_pMklData);
}
}

 

... where l_pMklInputOutputData is the input vector of complex data to manage, previously allocated and filled by FourierTransform caller.

Exiting from this method, the same vector will contain results of FFT by DftiComputeForward one column at time. 

On all PC with Intel CPU the results are the same except on Hw with Intel Iris *** Graphics.

---------------------------------------------------------------------------------------------------------------------

 

The question is : is FFT by MKL available on Intel Iris Graphics family too? If yes, what's the reason of those malformed output of FFT by the same project (MKL statically linked) on Intel Iris Graphics family with respect of all pc with different Intel Graphics card?

Thanks in advance for the support and kindly responses.

0 Kudos
3 Replies
stemsc
Beginner
872 Views

Update:

Found working workaround is to separate input from output vector of FFT, so that :

 

It works by changing :

l_ulResult = DftiComputeForward(l_pMklRangeDftDescriptor, l_pMklData, l_pMklData);

to :

l_ulResult = DftiComputeForward(l_pMklRangeDftDescriptor, l_pMklData, l_pOutData);

(where l_pOutData is a temporarely vector previously allocated like l_pMklData)

 

That's change is needed only on PC with Intel Iris Graphics.

 

Maybe multithreading and parallel computation done by DftiComputeForward is safe only if input and output vectors are differents? Maybe concurrency problems are present into DftiComputeForward implementation running on PC with Intel Iris Gparhics?

0 Kudos
ShanmukhS_Intel
Moderator
861 Views

Hi,

 

Thanks for posting on Intel Communities.

 

Glad to know that your issue is resolved and sharing the workaround with us.

 

If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.

 

Best Regards,

Shanmukh.SS

 

 

0 Kudos
stemsc
Beginner
856 Views

Thanks for your reply, but ....

My solution is proposed only as a workaround.

 

I'm asking to Intel why that MKL API for FFT doesn't work on Intel Iris Graphics:

  • is there an hidden advice to avoid using the same vector as input/output, advice not available on MKL specifications? or
  • is a know bug of MKL FFT working on Intel Iris Graphics? or
  • some particular configuration of MKL linking is required to use it on Intel Iris Graphics ?

 

My workaround don't fix an incorrect call of DftiComputeForward, because any MKL specification disables capability to use the same vector as input/output.

Thanks

 

 

0 Kudos
Reply