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
- 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 - Command to
execute:
$ export LD_LIBRARY_PATH=<AMDuProf-install-dir>/lib $ ./CollectAllCounters