guix_mirror_bot pushed a commit to branch next-master
in repository guix.
commit 24fd9360d04718a585a4185d2e7eaae95693fc44
Author: Ludovic Courtès <[email protected]>
AuthorDate: Thu Jan 15 14:45:01 2026 +0100
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 <[email protected]>
---
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 cdfbaad7b7..e082f23dc0 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 <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))