This topic only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture).
Use the functions described in this section to determine:
the number of coprocessors in a system
the coprocessor on which a program is running
Use the header file offload.h to define the interfaces for these functions and their usage. Include it with
In a system with multiple coprocessors, you need to specify the
target-number argument when using the
offload pragma to reliably use data persistence. When you use
free_if to implement data persistence on the coprocessor, but do not specify
target-number, the compiler runtime randomly chooses a coprocessor, so the chosen coprocessor could be one on which the data is not available.
Determining the Number of Coprocessors in a System
To determine the number of coprocessors in the system, use the function
The function returns an integer equal to the number of coprocessors installed and working in the system. If none are installed and working, the return value is 0.
Determining the Coprocessor on Which a Program is Running
To determine the coprocessor that is executing the program, use the function
The function returns an integer equal to the number of the coprocessor executing the program, where 0 is the first card. If the program is executing on the CPU, the return value is -1.