Developer Reference for Intel® oneAPI Math Kernel Library for C
mkl_finalize
Terminates Intel® oneAPI Math Kernel Library (oneMKL) execution environment and frees resources allocated by the library.
Syntax
voidmkl_finalize ( void );
Include Files
mkl.h
Description
This function frees resources allocated by Intel® oneAPI Math Kernel Library (oneMKL) . Once this function is called, the application can no longer call Intel® oneAPI Math Kernel Library (oneMKL) functions other than mkl_finalize .
In particular, the mkl_finalize function enables you to free resources when a third-party shared library is statically linked to Intel® oneAPI Math Kernel Library (oneMKL) . To avoid resource leaks that may happen when a shared library is loaded and unloaded multiple times, call mkl_finalize each time the library is unloaded. The recommended method to do this depends on the operating system:
On Linux*, place the call into a shared library destructor.
On Windows*, call mkl_finalize from the DLL_PROCESS_DETACH handler of DllMain .