Use the Intel® 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.
- Make sure you have Microsoft* Visual Studio (v2017 or newer) installed on your system.
- Install Intel VTune Profiler from the Intel® oneAPI Base Toolkit (Beta) or the Intel® System Bring-up Toolkit (Beta).
- Set up environment variables. Execute the vars.bat script located in the <vtune-install-dir>\env directory.
- Ensure that the Intel oneAPI DPC++ Compiler (installed with the Intel oneAPI Base toolkit) is integrated into Microsoft Visual Studio.
- Set up your system for GPU analysis.
For information on installing Intel VTune Profiler in the Microsoft* Visual Studio environment, see VTune Profiler User Guide.
Build the Matrix App
Download the code sample package for Intel oneAPI toolkits. This contains the matrix_multiply sample which you can use to build and profile a DPC++ application.
- Open Microsoft* Visual Studio.
- Click File > Open > Project/Solution. Find the matrix_multiply folder and select matrix_multiply.sln.
- Build this configuration (Project > Build).
- Run the program (Debug > Start Without Debugging).
To choose a DPC++ or threaded version of the sample, use preprocessor definitions.
- Go to Project Properties > DPC++ > Preprocessor > Preprocessor Definition.
- Define DPCPP or USE_THR.
Run GPU Analysis
Run a GPU analysis on the Matrix sample.
From the Visual Studio toolbar, click the Configure Analysis button.
The Configure Analysis window opens. By default, it inherits your VS project settings and specifies the matrix_multiply.exe as an application to profile.
- In the Configure Analysis window, click the Browse button in the HOW pane.
- Under Platform Analysis, select the GPU Compute/Media Hotspots analysis type.
Click the Start button to launch the analysis with the predefined 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.