gnu: clang-rocm: Add ‘compiler-amd-gpu-targets’ property.

* 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 <ludo@gnu.org>
This commit is contained in:
Ludovic Courtès 2026-01-15 14:45:01 +01:00 committed by Andreas Enge
parent feefe833ee
commit 86984d7c62
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3

View file

@ -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 <https://llvm.org/docs/AMDGPUUsage.html#amdgpu-processor-table>.
;; 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))