Skip to content

Commit e5be25a

Browse files
authored
adds cliloader options to capture enqeues or kernels (#346)
1 parent bfc11cc commit e5be25a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

cliloader/cliloader.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,30 @@ static bool parseArguments(int argc, char *argv[])
504504
{
505505
checkSetEnv("CLI_LeakChecking", "1");
506506
}
507+
else if( !strcmp(argv[i], "--capture-enqueue") )
508+
{
509+
++i;
510+
if( i < argc )
511+
{
512+
checkSetEnv("CLI_CaptureReplay", "1");
513+
checkSetEnv("CLI_InitializeBuffers", "1");
514+
checkSetEnv("CLI_AppendBuildOptions", "-cl-kernel-arg-info");
515+
checkSetEnv("CLI_CaptureReplayMinEnqueue", argv[i]);
516+
checkSetEnv("CLI_CaptureReplayMaxEnqueue", argv[i]);
517+
}
518+
}
519+
else if( !strcmp(argv[i], "--capture-kernel") )
520+
{
521+
++i;
522+
if( i < argc )
523+
{
524+
checkSetEnv("CLI_CaptureReplay", "1");
525+
checkSetEnv("CLI_InitializeBuffers", "1");
526+
checkSetEnv("CLI_AppendBuildOptions", "-cl-kernel-arg-info");
527+
checkSetEnv("CLI_CaptureReplayKernelName", argv[i]);
528+
checkSetEnv("CLI_CaptureReplayNumKernelEnqueuesCapture", "1");
529+
}
530+
}
507531
else if( !strcmp(argv[i], "-f") || !strcmp(argv[i], "--output-to-file") )
508532
{
509533
checkSetEnv("CLI_LogToFile", "1");
@@ -595,6 +619,8 @@ static bool parseArguments(int argc, char *argv[])
595619
" --mdapi-tbs Report Time-Based MDAPI Metrics (Intel GPU Only)\n"
596620
" --mdapi-group <NAME> Choose MDAPI Metrics to Collect (Intel GPU Only)\n"
597621
" --host-timing [-h] Report Host API Execution Time\n"
622+
" --capture-enqueue <NUMBER> Capture the Specified Kernel Enqueue\n"
623+
" --capture-kernel <NAME> Capture the Specified Kernel Name\n"
598624
" --leak-checking [-l] Track and Report OpenCL Leaks\n"
599625
" --output-to-file [-f] Log and Report to Files vs. stderr\n"
600626
" --dump-dir <DIR> Specify the dump directory for log and report files,\n"

0 commit comments

Comments
 (0)