Skip to content

gdb.rocm: fall back to concrete arch when no generic target exists - #351

Open
lumachad wants to merge 1 commit into
amd-stagingfrom
users/lumachad/amd-staging/generic-fallback
Open

lumachad wants to merge 1 commit into
amd-stagingfrom
users/lumachad/amd-staging/generic-fallback

Conversation

@lumachad

@lumachad lumachad commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Under the rocm-generic board, generic_target_for returns "" for architectures with no compatible generic AMDGPU target (e.g. gfx90a, which falls between the gfx9-generic and gfx9-4-generic buckets).
  • hcc_amdgpu_targets silently dropped such architectures, so no --offload-arch flag was passed at all.
  • Now falls back to using the concrete arch as the offload target and emits a warning so it's clear the generic target isn't actually being exercised for that architecture.

Test plan

  • Added unit tests in gdb.rocm/hcc-amdgpu-targets.exp covering mapped, unmapped (gfx90a), and mixed arch lists under rocm_use_generic_targets.
  • Run gdb.rocm/hcc-amdgpu-targets.exp locally.

🤖 Generated with Claude Code

@lumachad lumachad added the test:generic-gfx-board Runs the gdb.rocm testsuite with the compiler targeting the generic gfx target label Sep 18, 2026
@lumachad lumachad self-assigned this Sep 18, 2026
Comment thread gdb/testsuite/lib/rocm.exp Outdated
Under the rocm-generic board, generic_target_for returns "" for
architectures that have no generic AMDGPU target mapping (e.g.
gfx90a, which falls between the gfx9-generic and gfx9-4-generic
buckets). hcc_amdgpu_targets silently dropped such architectures,
so no --offload-arch flag was passed at all.

Instead, fall back to using the concrete arch as the offload target
and emit a warning so it's clear the generic target isn't actually
being exercised for that architecture.
@lumachad
lumachad force-pushed the users/lumachad/amd-staging/generic-fallback branch from cd13915 to ea5f15f Compare September 18, 2026 12:49
@lumachad
lumachad marked this pull request as ready for review September 18, 2026 12:50
@lumachad
lumachad requested a review from a team as a code owner September 18, 2026 12:50

@lancesix lancesix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:generic-gfx-board Runs the gdb.rocm testsuite with the compiler targeting the generic gfx target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants