Fix kernel filtering when using rocprofv3 (#615)

When using rocprof v3:
* Use --kernel-include-regex for kernel name filtering
* Use --kernel-iteration-range for kernel dispatch filtering

Update changelog
This commit is contained in:
vedithal-amd authored and GitHub committed 2025-03-18 11:26:45 -04:00
1 förälder 64ccd588de
incheckning 45b8937d5d
2 files changed
+23 -1

No files matched your search

@@ -71,8 +71,25 @@ class rocprof_v3_profiler(RocProfCompute_Base):
trace_option,
"--output-format",
rocprof_out_format,
"--",
]
# Kernel filtering
if self.get_args().kernel:
args.extend(["--kernel-include-regex", "|".join(self.get_args().kernel)])
# Dispatch filtering
dispatch = []
# rocprofv3 dispatch indexing is inclusive and starts from 1
if self.get_args().dispatch:
for dispatch_id in self.get_args().dispatch:
if ":" in dispatch_id:
tokens = dispatch_id.split(":")
# 4:7 -> 5-7
dispatch.append(f"{int(tokens[0]) + 1}-{tokens[1]}")
else:
# 4 -> 5
dispatch.append(f"{int(dispatch_id) + 1}")
if dispatch:
args.extend(["--kernel-iteration-range", f"[{','.join(dispatch)}]"])
args.append("--")
args.extend(app_cmd)
return args