mkl_free_buffers

Frees memory buffers.

Syntax

FORTRAN:

call mkl_free_buffers

C:

mkl_free_buffers();

Include Files

Description

The mkl_free_buffers function frees the memory allocated by the Intel MKL memory management software. The memory management software allocates new buffers if no free buffers are currently available. Call mkl_free_buffers() to free all memory buffers and to avoid memory leaking on completion of work with the Intel MKL functions, that is, after the last call of an Intel MKL function from your application.

See Intel® MKL User's Guide for details.

Note iconNote

MKL_FreeBuffers is an obsolete name for the mkl_free_buffers function that is referenced in the library for back compatibility purposes but is deprecated and subject to removal in subsequent releases.

mkl_free_buffers Usage with FFT Functions

----------------------------------------------------------------------------------------------

DFTI_DESCRIPTOR_HANDLE hand1;
DFTI_DESCRIPTOR_HANDLE hand2;
void mkl_free_buffers(void);
. . . . . .
/* Using MKL FFT */
Status = DftiCreateDescriptor(&hand1, DFTI_SINGLE, DFTI_COMPLEX, dim, m1);
Status = DftiCommitDescriptor(hand1);
Status = DftiComputeForward(hand1, s_array1);
. . . . . .
Status = DftiCreateDescriptor(&hand2, DFTI_SINGLE, DFTI_COMPLEX, dim, m2);
Status = DftiCommitDescriptor(hand2);
. . . . . .
Status = DftiFreeDescriptor(&hand1);
/* Do not call mkl_free_buffers() here as the hand2 descriptor will be corrupted!  */
. . . . . .
Status = DftiComputeBackward(hand2, s_array2));
Status = DftiFreeDescriptor(&hand2);
/* Here user finishes the MKL FFT usage */
/* Memory leak will be triggered by any memory control tool */
/* Use mkl_free_buffers() to avoid memory leaking */
mkl_free_buffers();

----------------------------------------------------------------------------------------------

If the memory space is sufficient, use mkl_free_buffers after the last call of the MKL functions. Otherwise, a drop in performance can occur due to reallocation of buffers for the subsequent MKL functions.

Warning iconWarning

For FFT calls, do not use mkl_free_buffers between DftiCreateDescriptor(hand) and DftiFreeDescriptor(&hand).


Submit feedback on this help topic