Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Berk
Beginner
96 Views

Custom Dynamic-link Library Builder and MKL_DIRECT_CALL

Jump to solution

I'd like to set the MKL_DIRECT_CALL flag for the custom MKL dll that we are using from a C application and hopefully speed up the matrix operations. Will it be enough to set the flag for the C application alone? What about the makefile for the custom MKL dll? 

0 Kudos
1 Solution
Ying_H_Intel
Employee
96 Views

Hi Berk, 

We did the investigation. you can

1)  include dgemm_direct and dgemm_direct_  in  user_example_list. (user_def_file.def)  to create custom.dll

2) then  you can just call dgemm() and add –DMKL_DIRECT_CALL with include "mkl.h". 

Best Regards,
Ying 

View solution in original post

4 Replies
Ying_H_Intel
Employee
96 Views

Hi, 

Are you reading the article, 

https://software.intel.com/en-us/articles/improve-intel-mkl-performance-for-small-problems-the-use-o...

Right? 

MKL_DIRECT_CALL flag is pre-processor macros to be defined to instruct Intel MKL to pick the fast path for small matrices.  It was using during  compile phase,  so it should be ok for you to add such option

 on Linux system, simply add -DMKL_DIRECT_CALL or -DMKL_DIRECT_CALL_SEQ. On Windows, the syntax is /DMKL_DIRECT_CALL or /DMKL_DIRECT_CALL_SEQ.

in your makefile  (same as /Qstd=c99 ) both for c application and custom MKL Dll. 

Best Regards,

Ying 

 

Berk
Beginner
96 Views

Hi Ying,

 

Thanks for your reply. Yes I've read the article before posting, and my question was if using MKL by not directly linking with it but via a custom made MKL dll changed anything or not. I especially wanted to know if I needed to declare the flag when building the custom MKL dll, and if so, where & how. It looks trivial to define & use the flag in our main C project that calls the custom MKL dll for matrix operations. I am not sure how to do the same for the custom MKL dll itself, though...

Berk

Ying_H_Intel
Employee
97 Views

Hi Berk, 

We did the investigation. you can

1)  include dgemm_direct and dgemm_direct_  in  user_example_list. (user_def_file.def)  to create custom.dll

2) then  you can just call dgemm() and add –DMKL_DIRECT_CALL with include "mkl.h". 

Best Regards,
Ying 

View solution in original post

Berk
Beginner
96 Views

Hi Ying,

 

Thanks for your reply. One final question: Does this flag affect PARDISO at all? If so, how can I set it on my custom dll exposing PARDISO calls to my application?

Thanks again for you help.

Berk

Reply