Intel® Math Kernel Library 2018 Developer Reference - C
Sets the maximum amount of Intel Xeon Phi coprocessor memory reserved for the Automatic Offload computations.
int mkl_mic_set_max_memory (MKL_MIC_TARGET_TYPE target_type, int target_number, size_t mem_size);
Name |
Type |
Description |
---|---|---|
target_type |
MKL_MIC_TARGET_TYPE |
Type of the target device. Use the value of |
target_number |
int |
The coprocessor number for which the maximum memory used for Automatic Offload computations is set. Takes the following values:
|
mem_size |
size_t |
For the target_number device, the amount of memory in kilobytes to reserve for Automatic Offload computations. Intel MKL attempts to not exceed the specified memory size for Automatic Offload computations. |
The mkl_mic_set_max_memory function enables you to limit coprocessor memory used by the Automatic Offload computations. Intel MKL reserves the specified memory on Intel Xeon Phi coprocessors. This can improve the performance of Automatic Offload computations by reducing the cost of buffer initialization and data transfer. The specified memory is reserved for the calling process, and the threads of a process share the specified memory. Intel MKL allocates additional memory for each process that performs Automatic Offload computations.
This function takes precedence over the MKL_MIC_MAX_MEMORY and MKL_MIC_<number>_MAX_MEMORY environment variables (see the Intel MKL Developer Guide for details).
Call mkl_mic_set_max_memory before any Intel MKL functions that do Automatic Offload computations.
Use mkl_mic_free_memory to free the coprocessor memory reserved for the Automatic Offload computations.
Name |
Type |
Description |
---|---|---|
ierr |
int |
Result status: = 0 Indicates the coprocessor memory reserved for Automatic Offload is set successfully. < 0 Indicates an error. |