Intel® Math Kernel Library 2018 Developer Reference - C

mkl_mic_get_cpuinfo

Retrieves the number of cores, hardware threads, and frequency for the specified coprocessor or host CPU.

Syntax

int mkl_mic_get_cpuinfo (MKL_MIC_TARGET_TYPE target_type, int target_number, int* ncores, int* nthreads, double* freq);

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 retrieve the information 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.

Output Parameters

Name

Type

Description

ncores

int*

The number of physical cores on the target device.

nthreads

int*

The number of hardware threads on the target device.

freq

double*

The frequency in Hz of the target device.

Description

Use this function to retrieve the number of cores, hardware threads, and frequency for the host CPU or an Intel Xeon Phi coprocessor.

Return Values

Name

Type

Description

ierr

int

Result status:

= 0  Indicates that the information for the target device is successfully returned.

< 0  Indicates a failure to return the information.

See Also