Skip to content

Commit

Permalink
Mdapi multi adapter (#394)
Browse files Browse the repository at this point in the history
* update to latest MDAPI headers

* update metric printing to support multiple adapters

* add the ability to enumerate MDAPI adapters from adapter groups

* whitespace fix

* fix typo

* add a bit more debug output

* add a cliloader option to print metric devices and exit

* cleanup and add a command line option for mdapi device index

* final updates and documentation

* disable MD_DEBUG by default again
  • Loading branch information
bashbaug authored Dec 1, 2024
1 parent e10bb36 commit 87e5440
Show file tree
Hide file tree
Showing 9 changed files with 1,728 additions and 913 deletions.
15 changes: 15 additions & 0 deletions cliloader/cliloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ static bool parseArguments(int argc, char *argv[])
printMetrics();
return false;
}
else if (!strcmp(argv[i], "--mdapi-devices"))
{
printMetricDevices();
return false;
}
#if defined(_WIN32)
else if( !strcmp(argv[i], "--no-DLL-load") )
{
Expand Down Expand Up @@ -496,6 +501,14 @@ static bool parseArguments(int argc, char *argv[])
mdapiGroup = argv[i];
}
}
else if( !strcmp(argv[i], "--mdapi-device") )
{
++i;
if( i < argc )
{
checkSetEnv("CLI_DevicePerfCounterAdapterIndex", argv[i]);
}
}
else if( !strcmp(argv[i], "-h") || !strcmp(argv[i], "--host-timing") )
{
checkSetEnv("CLI_HostPerformanceTiming", "1");
Expand Down Expand Up @@ -591,6 +604,7 @@ static bool parseArguments(int argc, char *argv[])
" --debug Enable cliloader Debug Messages\n"
" --controls Print All Controls and Exit\n"
" --metrics Print All MDAPI Metrics and Exit\n"
" --mdapi-devices Print All MDAPI Devices and Exit\n"
#if defined(_WIN32)
" --no-DLL-load Do not load the Intercept DLL into the child process\n"
#else // not Windows
Expand Down Expand Up @@ -618,6 +632,7 @@ static bool parseArguments(int argc, char *argv[])
" --mdapi-ebs Report Event-Based MDAPI Metrics (Intel GPU Only)\n"
" --mdapi-tbs Report Time-Based MDAPI Metrics (Intel GPU Only)\n"
" --mdapi-group <NAME> Choose MDAPI Metrics to Collect (Intel GPU Only)\n"
" --mdapi-device <INDEX> Choose MDAPI Device for Metrics (Intel GPU Only)\n"
" --host-timing [-h] Report Host API Execution Time\n"
" --capture-enqueue <NUMBER> Capture the Specified Kernel Enqueue\n"
" --capture-kernel <NAME> Capture the Specified Kernel Name\n"
Expand Down
Loading

0 comments on commit 87e5440

Please sign in to comment.