summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-03-19 12:29:53 +0100
committerCayetano Santos <csantosb@inventati.org>2026-03-24 14:21:49 +0100
commit34ead5615673c97a64f0930ea75946d18b57364e (patch)
treeb5e6a2da4d5574a78997e0355ff56345ecb5a91f /guix
parent5591ac77724f775d2b62f5051321ea3bf34431f3 (diff)
Add (guix amd-gpu).
Moving these definitions to a separate module is necessary to avoid circular references at the top-level among package modules. * gnu/packages/rocm.scm (%default-amd-gpu-targets, current-amd-gpu-targets) (current-amd-gpu-targets-string): Move to… * guix/amd-gpu.scm: … here. New file. * Makefile.am (MODULES): Add it. Merges guix/guix!7251 Change-Id: I60496fb4d81ea0445ec176add7afc388f6790bd3 Signed-off-by: Cayetano Santos <csantosb@inventati.org>
Diffstat (limited to 'guix')
-rw-r--r--guix/amd-gpu.scm44
1 files changed, 44 insertions, 0 deletions
diff --git a/guix/amd-gpu.scm b/guix/amd-gpu.scm
new file mode 100644
index 0000000000..d16fea2a05
--- /dev/null
+++ b/guix/amd-gpu.scm
@@ -0,0 +1,44 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2026 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2026 David Elsing <david.elsing@posteo.net>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix amd-gpu)
+ #:autoload (guix packages) (this-package package-properties)
+ #:export (%default-amd-gpu-targets
+ current-amd-gpu-targets
+ current-amd-gpu-targets-string))
+
+;;; Commentary:
+;;;
+;;; This module provides helpers for packages targeting AMD GPUs.
+;;;
+;;; Code:
+
+(define %default-amd-gpu-targets
+ '("gfx908" "gfx90a" "gfx942" "gfx1030" "gfx1100" "gfx1101" "gfx1200" "gfx1201"))
+
+(define-syntax-rule (current-amd-gpu-targets)
+ "Return the list of AMD GPU targets for this package, as a list of strings."
+ (or (assoc-ref (package-properties this-package) 'amd-gpu-targets)
+ %default-amd-gpu-targets))
+
+(define-syntax-rule (current-amd-gpu-targets-string)
+ "Return the list of AMD GPU targets for this package, as a string separated
+by \";\". This is useful for build options like 'AMDGPU_TARGETS' in many
+CMake-based packages."
+ (string-join (current-amd-gpu-targets) ";"))