Skip to content

Commit 87e5440

Browse files
authored
Mdapi multi adapter (intel#394)
* 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
1 parent e10bb36 commit 87e5440

File tree

9 files changed

+1728
-913
lines changed

9 files changed

+1728
-913
lines changed

cliloader/cliloader.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ static bool parseArguments(int argc, char *argv[])
381381
printMetrics();
382382
return false;
383383
}
384+
else if (!strcmp(argv[i], "--mdapi-devices"))
385+
{
386+
printMetricDevices();
387+
return false;
388+
}
384389
#if defined(_WIN32)
385390
else if( !strcmp(argv[i], "--no-DLL-load") )
386391
{
@@ -496,6 +501,14 @@ static bool parseArguments(int argc, char *argv[])
496501
mdapiGroup = argv[i];
497502
}
498503
}
504+
else if( !strcmp(argv[i], "--mdapi-device") )
505+
{
506+
++i;
507+
if( i < argc )
508+
{
509+
checkSetEnv("CLI_DevicePerfCounterAdapterIndex", argv[i]);
510+
}
511+
}
499512
else if( !strcmp(argv[i], "-h") || !strcmp(argv[i], "--host-timing") )
500513
{
501514
checkSetEnv("CLI_HostPerformanceTiming", "1");
@@ -591,6 +604,7 @@ static bool parseArguments(int argc, char *argv[])
591604
" --debug Enable cliloader Debug Messages\n"
592605
" --controls Print All Controls and Exit\n"
593606
" --metrics Print All MDAPI Metrics and Exit\n"
607+
" --mdapi-devices Print All MDAPI Devices and Exit\n"
594608
#if defined(_WIN32)
595609
" --no-DLL-load Do not load the Intercept DLL into the child process\n"
596610
#else // not Windows
@@ -618,6 +632,7 @@ static bool parseArguments(int argc, char *argv[])
618632
" --mdapi-ebs Report Event-Based MDAPI Metrics (Intel GPU Only)\n"
619633
" --mdapi-tbs Report Time-Based MDAPI Metrics (Intel GPU Only)\n"
620634
" --mdapi-group <NAME> Choose MDAPI Metrics to Collect (Intel GPU Only)\n"
635+
" --mdapi-device <INDEX> Choose MDAPI Device for Metrics (Intel GPU Only)\n"
621636
" --host-timing [-h] Report Host API Execution Time\n"
622637
" --capture-enqueue <NUMBER> Capture the Specified Kernel Enqueue\n"
623638
" --capture-kernel <NAME> Capture the Specified Kernel Name\n"

0 commit comments

Comments
 (0)