Files
cmake/Modules
Jacob Lambert 64a4a0c9a8 HIP: Detect default architecture from the AMDGPU subarch triple
Otherwise, `project(LANGUAGES HIP)` fails to configure on a machine
with no AMD GPU when using Clang 22 or newer:

  Failed to find a default HIP architecture.

The default architecture is determined by running `rocm_agent_enumerator`,
which returns nothing when no GPU is present, and then by matching
` -target-cpu ([a-z0-9]+) ` in the compiler's cc1 output.  Clang stopped
passing `-target-cpu` for AMDGPU in LLVM/Clang commit bf9fe776748c
(clang/AMDGPU: Stop passing redundant -target-cpu to cc1, 2026-08-31);
the processor is now carried in the triple's subarch field.  Neither
path matches, so configuration fails.

Fall back to reading the subarch out of the triple, e.g.,
`amdgpu9.06-amd-amdhsa` for `gfx906`.  Keep the `-target-cpu` branch for
older compilers.  Generic targets spell the subarch with fewer
components, e.g., `amdgpu10.3--` for `gfx10-3-generic`.  Those are not
matched, so they still reach the existing error rather than producing an
invalid architecture name.
2026-09-03 12:05:25 -04:00
..
2026-08-27 10:50:27 -04:00
2025-05-26 02:55:17 +02:00
2025-09-23 21:40:58 +02:00
2025-12-11 09:42:58 -05:00
2025-08-04 21:26:12 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-08-04 21:26:12 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-08-04 21:26:12 +02:00
2025-08-04 21:26:12 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-12-11 09:42:58 -05:00
2026-01-12 16:02:29 -05:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-08-04 21:26:12 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2026-03-07 09:01:48 -05:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00
2026-05-26 17:53:42 -04:00
2025-09-23 21:40:58 +02:00
2025-09-23 21:40:58 +02:00

See the "Find Modules" section of the cmake-developer(7) manual page.

For more information about how to contribute modules to CMake, see this page:
https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/dev/Module-Maintainers