Intel® Math Kernel Library 2019 Developer Reference - C

mkl_finalize

Terminates Intel MKL execution environment and frees resources allocated by the library.

Syntax

void mkl_finalize(void);

Include Files

Description

This function frees resources allocated by Intel MKL. Once this function is called, the application can no longer call Intel MKL 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 MKL. 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:

Note

Intel MKL shared libraries automatically perform finalization when they are unloaded. If an application is statically linked to Intel MKL, the operating system frees all resources allocated by Intel MKL during termination of the process associated with the application.