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

Conditional Numerical Reproducibility Control

The CNR mode of Intel® oneAPI Math Kernel Library (oneMKL) ensures bitwise reproducible results from run to run of Intel® oneAPI Math Kernel Library (oneMKL) functions on a fixed number of threads for a specific Intel instruction set architecture (ISA) under the following conditions:

  • Calls to Intel® oneAPI Math Kernel Library (oneMKL) occur in a single executable
  • The number of computational threads used by the library does not change in the run

Intel® oneAPI Math Kernel Library (oneMKL) offers both functions and environment variables to support conditional numerical reproducibility. See theIntel® oneAPI Math Kernel Library (oneMKL) Developer Guide for more information on bitwise reproducible results of computations and for details about the environment variables.

The support functions enable you to configure the CNR mode and also provide information on the current and optimal CNR branch on your system. Usage Examples for CNR Support Functions illustrate usage of these functions.

IMPORTANT:

Call the functions that define the behavior of CNR before any of the math library functions that they control.

Intel® oneAPI Math Kernel Library (oneMKL) provides named constants for use as input and output parameters of the functions instead of integer values. SeeNamed Constants for CNR Control for a list of the named constants.

Although you can configure the CNR mode using either the support functions or the environment variables, the functions offer more flexible configuration and control than the environment variables. Settings specified by the functions take precedence over the settings specified by the environment variables.

Use Intel® oneAPI Math Kernel Library (oneMKL) in the CNR mode only in case a need for bitwise reproducible results is critical. Otherwise, run Intel® oneAPI Math Kernel Library (oneMKL) as usual to avoid performance degradation.

While you can supply unaligned input and output data to Intel® oneAPI Math Kernel Library (oneMKL) functions running in the CNR mode, use of aligned data is recommended. Refer toReproducibility Conditions for more details.

Product and Performance Information

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

Notice revision #20201201