gdb/testsuite: add HIP graph-launch kernel debugging test#197
Open
spatrang wants to merge 1 commit into
Open
Conversation
Add gdb.rocm/hip-graph-launch test covering debugging of kernels dispatched via hipGraphLaunch (stream-captured graph, replayed).
e542624 to
d32f447
Compare
Contributor
Author
|
Rebased onto latest amd-staging to pick up the record-full.c build fix and re-trigger CI. |
lancesix
reviewed
Jul 10, 2026
lancesix
left a comment
Collaborator
There was a problem hiding this comment.
Just minor comments for now, will get a deeper review at a later time.
| #include <stdlib.h> | ||
| #include <hip/hip_runtime.h> | ||
|
|
||
| #define CHECK(cmd) \ |
Collaborator
There was a problem hiding this comment.
You should be able to #include "rocm-test-utils.h", and have the CHECK macro from there.
| int | ||
| main () | ||
| { | ||
| const unsigned int num_elems = 1; |
Collaborator
There was a problem hiding this comment.
could even be constexpr.
| } | ||
|
|
||
| # The C source uses "#define NUM_REPLAYS 3". Keep this in sync. | ||
| set num_replays 3 |
Collaborator
There was a problem hiding this comment.
If we really want to have them in sync, you could build with -DNUM_REPLAYS=$num_replays. This way, things would always be in sync.
See example of doing this in gdb.rocm/nonstop-mode.exp for example.
If we want to be able to build the cpp on its own (without running dejagnu), we can have
#ifndef NUM_REPLAYS
#define NUM_REPLAYS 3
#endif
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 a new
gdb.rocmdejagnu test,hip-graph-launch, covering debugging ofkernels dispatched through a HIP graph (
hipGraphLaunch) rather than a plainkernel<<<>>>()launch. The program captures two kernels (add_onethentimes_three) from a stream into a single graph, instantiates it, and replaysit 3 times; each replay computes
out = (out + 1) * 3(0 -> 3 -> 12 -> 39).The test exercises the graph-specific debugger behavior:
info dispatchesreports the active dispatch and associates it with the kernel.Test plan
Validated 22/22 assertions under both GCC and LLVM host compilers on gfx942
(MI300X), against:
JIRA
AIROCGDB-580