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

Problems linking with Intel MKL to create a FFT dll

ionomolo
Beginner
534 Views

I have used Intel MKL to calculate the one-dimensional complex FFT from a set of data with no problems.

The program has a main function and a FFT function and both work. Now i have linked the FFT function as a dll to call it from C# and it hangs due to trying to read from a null pointer just at DftiCreateDescriptor(...).

MKL_Complex16* Dades = new MKL_Complex16;

MKL_LONG N2 = n;

DFTI_DESCRIPTOR_HANDLE my_desc1_handle;

long status;

for (int m=0;m

{

Dades.real = DadesReals;

Dades.imag = DadesCompl;

}

DftiCreateDescriptor( &my_desc1_handle, DFTI_DOUBLE,DFTI_COMPLEX, 1, N2);

status = DftiCommitDescriptor( my_desc1_handle );

status = DftiComputeForward(my_desc1_handle, Dades);

status = DftiFreeDescriptor(&my_desc1_handle);

for (int m=0;m

{

DadesReals = Dades.real;

DadesCompl = Dades.imag;

}

delete[] Dades;

I'm totally amazed at seeing the same code working when linked as executable and not working when linked as dll. I have tried both threaded and sequential layers.

0 Kudos
3 Replies
Vladimir_Lunev
New Contributor I
534 Views
Hi!
What is a link line to create your FFT DLL?
Thanks,
-Vladimir
0 Kudos
chu__xl
Beginner
534 Views

Hi, ionomolo

 I meet a same issue with you.  Do you solve this issue? Would you give me some suggestions?

Thanks!

Chu 

 

0 Kudos
Gennady_F_Intel
Moderator
534 Views

Chu,

I'd recommend you to look at this KB artcile:  https://software.intel.com/en-us/articles/using-intel-mkl-in-your-c-program

and check with MKL Linker Adviser how to properly link with Intel MKL - https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor

0 Kudos
Reply