]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite/rocm.exp: Use system GPU(s) to detect features
authorShahab Vahedi <shahab.vahedi@amd.com>
Wed, 12 Feb 2025 14:58:15 +0000 (15:58 +0100)
committerShahab Vahedi <shahab.vahedi@amd.com>
Fri, 21 Feb 2025 17:53:17 +0000 (18:53 +0100)
commit4d44cba2f7a05d082876b2ec730f7f763095f306
treeca3fdf73ef0ef9686f8a456087c14be2cb8573ad
parent2b0a62b17f9f66e9bb08a7dc69a5c636c1f618c4
gdb/testsuite/rocm.exp: Use system GPU(s) to detect features

gdb/testsuite/rocm.exp: Use system GPU(s) to detect features

Background
----------
This patch revisits the purpose of hcc_amdgpu_targets{} in
order to address the separation of concerns between:

- GPU targets passed to the compiler.  This kind of target
  is passed as an argument to flags like "--offload-arch=...",
  "--targets=...", etc.

- GPU targets as in available GPU devices on the system.  This
  is crucial for finding which capabilities are available,
  and therefore which tests should be executed or skipped.

Code change
-----------
- A new "find_amdgpu_devices{}" procedure is added.  It is
  responsible for listing the GPU devices that are available
  on the system.

- "hcc_amdgpu_targets{}" is rewritten to use the newly added
  "find_amdgpu_devices{}" when there's no environment variable
  (HCC_AMDGPU_TARGET) set.

- The output of "hcc_amdgpu_targets{}" is now only used in
  places that set the target for the building toolchains.

- The output of "find_amdgpu_devices{}" is used anywhere that
  needs to evaluate the GPU features.

Approved-By: Lancelot Six <lancelot.six@amd.com> (amdgpu)
Change-Id: Ib11021dbe674aa40192737ede78284a1bc531513
gdb/testsuite/lib/rocm.exp