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_enable_instructions

Enables dispatching for new Intel® architectures or restricts the set of Intel® instruction sets available for dispatching. The mkl_enable_instructions function must be called only once, before any other Intel® oneAPI Math Kernel Library (oneMKL) functions.

Syntax

int mkl_enable_instructions (int isa);

Input Parameters

Name

Type

Description

isa

int

The latest Intel® instruction-set architecture (ISA) for Intel® oneAPI Math Kernel Library (oneMKL) to dispatch.

MKL_ENABLE_AVX512

Intel® Advanced Vector Extensions 512 (Intel® AVX-512)

MKL_ENABLE_AVX512_E1

Intel® Advanced Vector Extensions 512 (Intel® AVX-512) with support for Intel® Deep Learning Boost (Intel® DL Boost).

MKL_ENABLE_AVX512_E2

Intel® Advanced Vector Extensions 512 (Intel® AVX-512) with support for Intel® Deep Learning Boost (Intel® DL Boost), EVEX-encoded AES, and Carry-Less Multiplication Quadword instructions

MKL_ENABLE_AVX512_E3

Intel® Advanced Vector Extensions 512 (Intel® AVX-512) with support for Intel® Deep Learning Boost (Intel® DL Boost) and bfloat16

MKL_ENABLE_AVX512_E4

Intel® Advanced Vector Extensions 512 (Intel® AVX-512) with support for INT8, BF16, FP16 (limited) instructions, and Intel® Advanced Matrix Extensions (Intel® AMX) with INT8 and BF16

MKL_ENABLE_AVX512_E5

Intel® Advanced Vector Extensions 512 (Intel® AVX-512) with support for INT8, BF16, FP16 (limited) instructions, and Intel® Advanced Matrix Extensions (Intel® AMX) with INT8, BF16, and FP16

NOTE:
Not dispatched by default.

MKL_ENABLE_AVX2

Intel® Advanced Vector Extensions 2 (Intel® AVX2)

MKL_ENABLE_AVX2_E1

Intel® Advanced Vector Extensions 2 (Intel® AVX2) with support for Intel® Deep Learning Boost (Intel® DL Boost)

MKL_ENABLE_SSE4_2

Intel® Streaming SIMD Extensions 4.2 (Intel® SSE4.2)

Description

Intel® oneAPI Math Kernel Library (oneMKL) does run-time processor dispatching to identify appropriate internal code paths to traverse for Intel® oneAPI Math Kernel Library (oneMKL) functions called by the application. The mkl_enable_instructions function controls the behavior of the dispatcher to do either of the following:

  • Enable dispatching for new Intel architectures.

    Intel® oneAPI Math Kernel Library (oneMKL) does not dispatch instruction sets that do not have silicon available at time of the product launch. Callmkl_enable_instructions to enable dispatching the code path for such an ISA in a simulator environment or on hardware that supports this ISA.

  • Restrict the set of Intel instruction sets available for dispatching.

    Call mkl_enable_instructions to restrict dispatching to code paths for earlier ISA. For example, if the hardware supports Intel AVX, a call to mkl_enable_instructions with the MKL_ENABLE_SSE4_2 parameter forces the dispatcher to use the Intel SSE4-2 code path.

If the system does not support the instruction set specified by the isa parameter or if the system is based on a non-Intel architecture, mkl_enable_instructions does nothing and returns zero.

Settings specified by the mkl_enable_instructions function set an upper limit to settings specified by the mkl_cbwr_set function.

You can use the MKL_ENABLE_INSTRUCTIONS environment variable instead of calling mkl_enable_instructions (for more details, see the Intel® oneAPI Math Kernel Library (oneMKL) Developer Guide); however, the settings specified by the function take precedence over the settings specified by the environment variable.

Return Values

Name

Type

Description

irc

int

Function completion status:

1 - Intel® oneAPI Math Kernel Library (oneMKL) dispatches the code path for the specified ISA by default.

0 - The request is rejected. Usually this occurs if mkl_enable_instructions was called:

  • After another Intel® oneAPI Math Kernel Library (oneMKL) function

  • On a non-Intel architecture

  • With an incompatible ISA specified

Product and Performance Information

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.

Notice revision #20201201