Intel® Math Kernel Library 2018 Developer Reference - C

mkl_mic_set_workdivision

For computations in the Automatic Offload mode, sets the fraction of the work for the specified coprocessor or host CPU to do.

Syntax

int mkl_mic_set_workdivision (MKL_MIC_TARGET_TYPE target_type, int target_number, double wd);

Include Files

Input Parameters

Name

Type

Description

target_type

MKL_MIC_TARGET_TYPE

Type of the target device. Use one of the following values:

  • MKL_TARGET_HOST - host CPU

  • MKL_TARGET_MIC - Intel Xeon Phi coprocessor, default

target_number

int

The device to set the fraction of work for. Takes the following values:

  • 0. Specifies execution on a specific coprocessor. The coprocessor is determined by target_number modulo the number of Intel Xeon Phi coprocessors on the system as returned by mkl_mic_get_device_count(). For example: for a system with 4 Intel Xeon Phi coprocessors, target_number = 6 determines the coprocessor number 2.

  • <0. Reserved.

If target_type = MKL_TARGET_HOST, the function ignores the target_number parameter, which may have any value.

wd

double

The fractional amount of the work that the specified device should do, where 0.0 wd 1.0.

Specifying MKL_MIC_AUTO_WORKDIVISION for wd indicates that Intel MKL should determine the amount of the work for the specified device.

Description

If you are using Intel MKL in Automatic Offload mode, the mkl_mic_set_workdivision function specifies how much work each Intel Xeon Phi coprocessor or the host CPU should do. This function takes precedence over the MKL_HOST_WORKDIVISION, MKL_MIC_WORKDIVISION, and MKL_MIC_<number>_WORKDIVISION environment variables (see the Intel MKL Developer Guide for details).

Note

  • Intel MKL interprets the fraction of work set by the mkl_mic_set_workdivision function as guidance toward dividing work between coprocessors, but the library may choose a different work division if necessary.

  • Intel MKL resolves the collision that arises if the sum of all the work-division fractions does not equal one.

  • For LAPACK routines, setting the fraction of work to any value other than 0.0 enables the specified processor for Automatic Offload mode. However Intel MKL LAPACK does not use the value specified to divide the workload. For example, setting the fraction to 0.5 has the same effect as setting the fraction to 1.0.

Return Values

Name

Type

Description

ierr

int

Result status:

= 0  Indicates that the fraction is successfully set.

< 0  Indicates a failure to set the fraction.

See Also