[smoke-dev] Add HipDevCov and OmpDevCov device-coverage drain tests#2311
Merged
Conversation
Add two smoke-dev tests that validate device-side PGO/coverage drainage via the in-tree HSA-introspection drain (upstream LLVM #203056), independent of the HIP host-shadow drain. HipDevCov: builds a device-only kernel as an executable so the device link pulls in the amdgcn profile runtime, extracts its code object (mod.co) via llvm-objdump --offloading, then hipModuleLoad()s it from a program where that kernel has no host shadow. The kernel's counters can only reach the merged profile through the HSA drain; the test asserts both the host-shadow kernel and the module-only kernel are present. OmpDevCov: OpenMP target offload has no host-shadow drain, so a -fprofile-generate -> llvm-profdata merge -> -fprofile-use round trip that consumes a device function's counters exercises the HSA drain exclusively. Both honor $AOMP/$AOMP_GPU, use the smoke-dev Makefile harness, and skip cleanly on toolchains that do not yet ship the device profile runtime / drain. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the ls|head pipeline used to find the extracted device code object with a nullglob array, satisfying aomp-lint shellcheck. Co-authored-by: Cursor <cursoragent@cursor.com>
ronlieb
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two
test/smoke-devtests that validate device-side PGO/coverage drainage via the in-tree HSA-introspection drain (upstream LLVM #203056), independent of the HIP host-shadow drain.mod.co) viallvm-objdump --offloading, thenhipModuleLoad()s it from a program where that kernel has no host shadow. Its counters can only reach the merged profile through the HSA drain. The test asserts both the host-shadow kernel and the module-only kernel are present (and intentionally does not unload the module, since the HSA drain runs at process exit on still-loaded code objects).-fprofile-generate→llvm-profdata merge→-fprofile-useround trip that consumes a device function's counters exercises the HSA drain exclusively.Both tests honor
$AOMP/$AOMP_GPU, use the existing smoke-devMakefile.defs/Makefile.rulesharness, set a 300s timeout, and skip cleanly on toolchains that do not yet ship the device profile runtime / HSA drain (so they won't red-fail CI before the drain lands in the bundled LLVM).Test plan
make check→TEST_STATUS=0for both dirs on a gfx90a (MI210) box, using a toolchain containing the OpenMP runtime + device profile RT + HSA drain.host_kernel(host-shadow) andmod_kernel(HSA-only;gfx90a.hsa0.*.profrawproduced).amdgcn-amd-amdhsa.*.profrawdrained via HSA; FileCheck findsclassify/__omp_offloading_;-fprofile-userebuild consumes cleanly and runs.Made with Cursor