Overview

A system with the Intel® Xeon Phi™ coprocessor can run your application on both the CPU and the coprocessor. The application starts at the CPU, which is the host with user-defined sections of the source code offloaded to one or more coprocessors, which are the targets.

In this tutorial, you will compile the sample code into an application that runs on both the host and target. The code contains sections that are defined to run on both the host and the target. After running the application, you will then look at the source code to see how you can define sections to run on both the host and the target. Finally, you will compile the same code into an application that runs only on the host.

Note

To complete this tutorial, you must have a system based on Intel® Xeon Phi™ products.

About This Tutorial

This tutorial shows you how to compile the source code into an application that runs on both the host and target. The code counts the number of targets and has sections that are defined to run on both the host and target.

Estimated Duration

15-20 minutes.

Learning Objectives

After you complete this tutorial, you should be able to:

  • Write code to detect the quantity of targets in a system.

  • Write code that can run on both the host and target.

  • Compile your code into an application that runs on both the host and target.

  • Compile the same code into an application that runs only on the host.


Submit feedback on this help topic