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

Vector instruction set in static linking MKL

SRM
Novice
472 Views

I am planning to compile and distribute a Fortran software that uses MKL routines. Now, as far as I can tell, MKL makes use of vectorization (with SIMD instructions e.g. SSE, AVX, AVX2, AVX512 etc). If I use dynamic linking to MKL, then I would have to distribute the dynamic libraries (DLL) with the software, and I assume that at runtime the libraries check for the instruction sets available and choose the best one.

 

But I haven't been able to find anything about what happens when I am linking to MKL statically. When linking statically, the code from MKL libraries are put into the final executable file. So does that mean the final executable can use all of the instruction sets? If I statically link to MKL on a PC that has AVX2 instructions available, will the linked program run on a PC that only has SSE instructions? I want to make sure that the compiled program runs on all systems, but at the same takes advantage of modern SIMD instructions when it can. I am working on Windows btw.

0 Kudos
1 Solution
VidyalathaB_Intel
Moderator
438 Views

Hi Shoubhik,

 

Thanks for reaching out to us.

 

>>will the linked program run on a PC that only has SSE instructions?

 

As per the documentation, by default, Intel® oneAPI Math Kernel Library automatically queries and then dispatches the code path supported on your Intel® processor to the optimal instruction set architecture (ISA), so it might not be an issue. 

Reference link:

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/support-functions/miscellaneous/mkl-enable-instructions.html

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/managing-behavior-of-onemkl-with-env-vars/instruction-set-specific-dispatch-on-intel-archs.html

Also, you can check the system requirements of oneMKL library to check what are the supported hardware platforms

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/oneapi-math-kernel-library-system-requirements.html

 

Please get back to us if you face any issues.

 

Regards,

Vidya.

 

View solution in original post

2 Replies
VidyalathaB_Intel
Moderator
439 Views

Hi Shoubhik,

 

Thanks for reaching out to us.

 

>>will the linked program run on a PC that only has SSE instructions?

 

As per the documentation, by default, Intel® oneAPI Math Kernel Library automatically queries and then dispatches the code path supported on your Intel® processor to the optimal instruction set architecture (ISA), so it might not be an issue. 

Reference link:

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/support-functions/miscellaneous/mkl-enable-instructions.html

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/managing-behavior-of-onemkl-with-env-vars/instruction-set-specific-dispatch-on-intel-archs.html

Also, you can check the system requirements of oneMKL library to check what are the supported hardware platforms

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/oneapi-math-kernel-library-system-requirements.html

 

Please get back to us if you face any issues.

 

Regards,

Vidya.

 

VidyalathaB_Intel
Moderator
405 Views

Hi Shoubhik,


Thanks for accepting our solution.

As the issue is resolved, we are closing this thread. Please post a new question if you need any additional assistance from Intel as this thread will no longer be monitored.


Have a Nice Day!


Regards,

Vidya.


0 Kudos
Reply