Get Started

  • 2020
  • 11/09/2021
  • Public Content

Example: Profile a DPC++ Application on Linux*

Use
VTune
Profiler
with a sample
matrix_multiply
DPC++ (Data Parallel C++) application to quickly get familiar with the product and statistics collected for GPU-bound applications.

Prerequisites

Build the Matrix Application

Download the
matrix_multiply_vtune
code sample package for Intel oneAPI toolkits
. This contains the sample which you can use to build and profile a DPC++ application.
To profile a DPC++ application, make sure to compile the code using the
-gline-tables-only
and
-fdebug-info-for-profiling
Intel oneAPI DPC++ Compiler options.
To compile this sample application, do the following:
  1. Go to the sample directory.
    cd <sample_dir/VtuneProfiler/matrix_multiply>
  2. The
    multiply.cpp
    file in the
    src
    folder contains several DPC++ versions of matrix multiplication. Select a version by editing the corresponding
    #define MULTIPLY
    line in
    multiply.h
    .
  3. Build the app using the existing Makefile:
    cmake . make
    This should generate a
    matrix.dpcpp
    executable.
    To delete the program, type:
    make clean
    This removes the executable and object files that were created by the
    make
    command.

Run GPU Analysis

Run a GPU analysis on the Matrix sample.
  1. Launch VTune Profiler with the
    vtune-gui
    command.
  2. Click
    New Project
    from the Welcome page.
  3. Specify a name and location for your sample project and click
    Create Project
    .
  4. In the
    WHAT
    pane, browse to the
    matrix.dpcpp
    file.
  5. In the
    HOW
    pane, click the Browse button and select
    GPU Compute/Media Hotspots
    analysis from the
    Accelerators
    group in the Analysis Tree.
    GPU Compute/Media Hotspot Analysis
  6. Click the
    Start
    button at the bottom to launch the analysis with the pre-selected options.
VTune
Profiler
collects data and displays analysis results in the
GPU Compute/Media Hotspots
viewpoint. In the
Summary
window, see statistics on CPU and GPU resource usage to understand if your application is GPU-bound. Switch to the
Graphics
window to see basic CPU and GPU metrics representing code execution over time.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.