From 86984d7c6281c62e23b6f521d72ae44a5b84c002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 15 Jan 2026 14:45:01 +0100 Subject: [PATCH] =?UTF-8?q?gnu:=20clang-rocm:=20Add=20=E2=80=98compiler-am?= =?UTF-8?q?d-gpu-targets=E2=80=99=20property.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/llvm.scm (%clang-rocm-supported-gpu-targets): New variable. (make-clang-rocm): Add ‘compiler-amd-gpu-targets’ property. Change-Id: I5ec21935db0deeb09483a65e63b7fda786d28d8f Signed-off-by: Ludovic Courtès --- gnu/packages/llvm.scm | 89 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index cdfbaad7b7a..e082f23dc02 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1292,6 +1292,89 @@ Library.") ;; toplevel variables cannot be called from one file to another. (define %rocm-llvm-version "7.1.0") +(define %clang-rocm-supported-gpu-targets + ;; List of supported GPU targets for the current version of clang-rocm. + ;; This list can be obtained by running: + ;; + ;; guix shell clang-rocm -- \ + ;; clang --target=amdgcn-amd-amdhsa -mcpu=help -nogpulib + ;; + ;; See also . + ;; Update this list when upgrading clang-rocm. + '("bonaire" + "carrizo" + "fiji" + "generic" + "generic-hsa" + "gfx10-1-generic" + "gfx10-3-generic" + "gfx1010" + "gfx1011" + "gfx1012" + "gfx1013" + "gfx1030" + "gfx1031" + "gfx1032" + "gfx1033" + "gfx1034" + "gfx1035" + "gfx1036" + "gfx11-generic" + "gfx1100" + "gfx1101" + "gfx1102" + "gfx1103" + "gfx1150" + "gfx1151" + "gfx1152" + "gfx1153" + "gfx12-generic" + "gfx1200" + "gfx1201" + "gfx600" + "gfx601" + "gfx602" + "gfx700" + "gfx701" + "gfx702" + "gfx703" + "gfx704" + "gfx705" + "gfx801" + "gfx802" + "gfx803" + "gfx805" + "gfx810" + "gfx9-4-generic" + "gfx9-generic" + "gfx900" + "gfx902" + "gfx904" + "gfx906" + "gfx908" + "gfx909" + "gfx90a" + "gfx90c" + "gfx940" + "gfx941" + "gfx942" + "gfx950" + "hainan" + "hawaii" + "iceland" + "kabini" + "kaveri" + "mullins" + "oland" + "pitcairn" + "polaris10" + "polaris11" + "stoney" + "tahiti" + "tonga" + "tongapro" + "verde")) + (define (make-llvm-rocm llvm-base) (package (inherit llvm-base) @@ -1402,7 +1485,11 @@ This AMD fork includes AMD-specific additions.")))) #:test-target "check-clang" args))) (replace 'add-tools-extra (lambda _ - (copy-recursively "../clang-tools-extra" "tools/extra"))))))))) + (copy-recursively "../clang-tools-extra" "tools/extra"))))))) + + (properties + `((compiler-amd-gpu-targets . ,%clang-rocm-supported-gpu-targets) + ,@(package-properties clang-base))))) (define-public clang-rocm (make-clang-rocm clang-20))