How to use OpenCL* with Intel® VTune™ Amplifier XE 2013 on an Intel® Xeon Phi™ coprocessor

Background

This article explains how to use  VTune(tm) Amplifier XE 2013 in order in collect performance data on an OpenCL* application running on an Intel(R) Xeon Phi(TM) coprocessor.

Overview

Xeon Phi coprocessor driver setup:

  1. cd /opt/intel/vtune_amplifier_xe_2013/bin64/k1om
  2. ./sep_micboot_create.sh
  3. ./sep_micboot_install.sh
  4. ./userapi_micboot_install.sh
    1. This step is necessary for the JIT collection on the Xeon Phi coprocessor. The previous steps enable the sampling collection driver.
  5. service mpss restart
    1. You need to restart the system for the new drivers to be loaded.

OpenCL* application

In order for your OpenCL* kernel code to run on a Xeon Phi coprocessor you need to specify the OpenCL* device as an accelerator type.

err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_ACCELERATOR, 1, &device_id, NULL)

You should then be able to compile your application. Using the Intel compiler:

icc –g –L/opt/intel/opencl/lib64 –lintelocl –lcl_logger

 Running an analysis in the VTune Amplifier XE GUI

  1. Source /opt/intel/vtune_amplifier_xe_2013/amplxe-vars.sh
  2. amplxe-gui &
  3. Create a project File->New->
    1. This will bring up the “Project Properties” dialog.
    2. Specify your OpenCL* binary as the application to launch,
    3. You should also specify some additional search libraries.
      1.  “Search Directories” tab
      2. Search directories for: “All"
        1. /lib/firmware/mic
        2. /opt/intel/composer_xe_2013/lib/mic
  4. Run a Lightweight-hotspots collection
    1. Click on the “New Analysis” button
      1. This will bring up the New Analysis dialog
      2. Scroll down to Knights Corner Platform -> Lightweight hotspots
      3. Click start
  5. Your application will launch and performance data will be collected on the Xeon Phi coprocessor.

 

Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.