- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There appears to be no support for including MKL in a native code dll. While I can build the application, I get a access violation at mkl_serv_allocate when attempting to create a descriptor for fft processing.
How can we Use the MKL in the native code part of a WPF application. Are there any patches to allow this to happen, or if it should be possible, is there an example application, or recommended set of link options to to make this work correctly.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Sara,
Could you please provide more details?
What's your platform? How do you declare and call fft functions from managed code?
BTW: MKL provides a tool:
You can also find link option if run MKL java examples. In such a case custom dll is built too.
Thanks,
-Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, Sara,
Your information is too laconic to make a conclusion.
I have not found any problem to call DftiCreateDescriptor from managed C++.
Here is my test:
type test1.cpp
#using
using namespace System;
using namespace System::Runtime::InteropServices;
//#include
typedef void *DFTI_DESCRIPTOR_HANDLE;
[DllImport("mkl.dll")]
extern "C" int DftiCreateDescriptor( DFTI_DESCRIPTOR_HANDLE desc,
int precision, int domain, int dimention, int length);
int main() {
DFTI_DESCRIPTOR_HANDLE handle;
int size = 1 << 20;
int status = DftiCreateDescriptor( &handle,
35,//DFTI_SINGLE, /* DFTI_PRECISION */
33,//DFTI_REAL, /* DFTI_FORWARD_DOMAIN */
1, /* Dimension */
size /* Length */
);
Console::WriteLine(status);
//printf("status=%d, handle=0x%08xn",status,handle);
}
Let's see what I do on my win32 platform.
set MKLROOT=wrkmkl10.1
First of all I build custom dll library (see User Guide ch.5)
cd %MKLROOT%toolsbuilder
Here is the list of required functions:
echo DftiCreateDescriptor > dfti_list
nmake ia32 export=dfti_list name=mkl BUF_LIB=
...skipped...
Creating library mkl.lib and object mkl.exp
Let's go to the work directory
cd wrkcpp
Add paths to the custom dll and MKLDLLsto the 'path' env viriable:
set path=%MKLROOT%toolsbuilder;%MKLROOT%ia32bin;%path%
Compile:
cl /clr test1.cpp
Execute:
test1.exe
Results:
0
Or
status=0, handle=0x00944540
Could you please give me a test and steps to reproduce the failure?
Thanks,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, Sara,
Now I see. You substitute the internal MKL function with yours one. Then you say:
I am sure this is not MKL problem but this is a problem of your function.
I think this is wrong way to override undocumented functions.
Let's discuss your original problem. As I understand the problem is linking error. Do you use the MKL builder tool (User Guide ch.5) to build the dll? See also my example.
Thanks,
Vladimir
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page