Using the APIs - Using the APIs - 57368

uProf User Guide

Document ID
57368
Release Date
2025-06-09
Revision
5.1 English

Refer the sample program CollectAllCounters.cpp to learn how to use these APIs. The program must be linked with the AMDPowerProfileAPI library while compiling. The power profiling driver must be installed and running.

A sample program CollectAllCounters.cpp that uses these APIs is available in the directory:<AMDuProf-install-dir>/Examples/CollectAllCounters/. To build and execute the sample application, complete the following OS-specific steps:

Windows

A Visual Studio 2022 solution file CollectAllCounters.sln is available in the directory: C:/Program Files/AMD/AMDuProf/Examples/CollectAllCounters/ to build the sample program.

Linux

  1. Command to build:
    $ cd <AMDuProf-install-dir>/Examples/CollectAllCounters
    $ g++ -O -std=c++11 CollectAllCounters.cpp -I<AMDuProf-install-dir>/include -l AMDPowerProfileAPI -L<AMDuProf-install-dir>/lib -Wl,-rpath <AMDuProf-install-dir>/bin -o CollectAllCounters
  2. Command to execute:
    $ export LD_LIBRARY_PATH=<AMDuProf-install-dir>/lib
    $ ./CollectAllCounters