Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

mkl_set_memory_limit

On Linux, sets the limit of memory that Intel® oneAPI Math Kernel Library (oneMKL) can allocate for a specified type of memory.

Syntax

int mkl_set_memory_limit (int mem_type, size_t limit);

Include Files

  • mkl.h

Input Parameters

Name

Type

Description

mem_type

int

Type of memory to limit. Possible values:

MKL_MEM_MCDRAM - Multi-Channel Dynamic Random Access Memory (MCDRAM).

limit

size_t

Memory limit in megabytes.

Description

This function sets the limit for the amount of memory that Intel® oneAPI Math Kernel Library (oneMKL) can allocate for the specified memory type. The limit bounds both internal allocations (inside Intel® oneAPI Math Kernel Library (oneMKL) computation routines) and external allocations (in a call tomkl_malloc, mkl_calloc, or mkl_realloc). By default no limit is set for memory allocation.

Call mkl_set_memory_limitat most once, prior to calling any other Intel® oneAPI Math Kernel Library (oneMKL) function in your application except mkl_set_interface_layer and mkl_set_threading_layer.

NOTE:
  • Allocation in MCDRAM requires libmemkind and libjemalloc dynamic libraries which are a part of Intel® Manycore Platform Software Package (Intel® MPSP) for Linux*.
  • The mkl_set_memory_limit function takes precedence over the MKL_FAST_MEMORY_LIMIT environment variable.

Return Values

Type

Description

int

Status of the function completion:

  • 1 - the limit is set

  • 0 - the limit is not set