summaryrefslogtreecommitdiff
path: root/gnu/packages/benchmark.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2026-03-17 16:56:14 +0100
committerCayetano Santos <csantosb@inventati.org>2026-03-24 14:21:49 +0100
commitc7f144b328c46c58aaebdc661a1c61062008aee7 (patch)
tree6aa5bb65bc2d58f2b214f099a9838c6a43ccfbec /gnu/packages/benchmark.scm
parent34ead5615673c97a64f0930ea75946d18b57364e (diff)
gnu: Add ‘babelstream-hip’.
Based on earlier work by AMD in <https://gitlab.inria.fr/guix-hpc/guix-hpc>. * gnu/packages/benchmarks.scm (babelstream-hip): New variable. Merges guix/guix!7251 Change-Id: I980b1e19385dc5474d82f985da70b0e9bad879fb Signed-off-by: Cayetano Santos <csantosb@inventati.org>
Diffstat (limited to 'gnu/packages/benchmark.scm')
-rw-r--r--gnu/packages/benchmark.scm55
1 files changed, 54 insertions, 1 deletions
diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm
index 4c5913c7076..489f9dd52bb 100644
--- a/gnu/packages/benchmark.scm
+++ b/gnu/packages/benchmark.scm
@@ -5,7 +5,7 @@
;;; Copyright © 2018, 2019, 2025 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
-;;; Copyright © 2019, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2021, 2026 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2020 malte Frank Gerdes <malte.f.gerdes@gmail.com>
;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim@guixotic.coop>
@@ -14,6 +14,7 @@
;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
;;; Copyright © 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2023 Advanced Micro Devices, Inc.
;;;
;;; This file is part of GNU Guix.
;;;
@@ -37,6 +38,7 @@
#:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (guix git-download)
+ #:use-module (guix amd-gpu)
#:use-module (guix search-paths)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
@@ -62,6 +64,7 @@
#:use-module (gnu packages kde-frameworks)
#:use-module (gnu packages linux)
#:use-module (gnu packages lua)
+ #:use-module (gnu packages llvm)
#:use-module (gnu packages maths)
#:use-module (gnu packages mpi)
#:use-module (gnu packages opencl)
@@ -76,6 +79,7 @@
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages qt)
+ #:use-module (gnu packages rocm)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xorg)
@@ -947,3 +951,52 @@ configurable through a set of options.")
"Microbenchmarks suite to evaluate MPI and PGAS (OpenSHMEM, UPC, and
UPC++) libraries for CPUs and GPUs.")
(license license:bsd-3)))
+
+(define-public babelstream-hip
+ (package
+ (name "babelstream-hip")
+ (version "5.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/UoB-HPC/BabelStream.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0xkkxkmyi99qly427gkdijm9vwvmhwkgfm283ay6f83r66f712g4"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:build-type "Release" ;"RelWithDebInfo" is not supported
+ #:tests? #f ;no tests
+ #:configure-flags
+ #~(list (string-append "-DMODEL=hip")
+ (string-append "-DCMAKE_CXX_COMPILER="
+ #$(this-package-input "rocm-hip-runtime")
+ "/bin/hipcc")
+ (string-append "-DCXX_EXTRA_FLAGS=--offload-arch="
+ #$(string-join (current-amd-gpu-targets) ",")))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'avoid-native-optimizations
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ (("-march=native")
+ "-g")))))))
+ (inputs (list rocm-hip-runtime lld-rocm llvm-rocm))
+ (properties
+ `((amd-gpu-targets . ,%default-amd-gpu-targets)
+ (tunable? . #t)))
+ (synopsis "Memory bandwidth benchmark for AMD GPUs")
+ (description
+ "The BabelStream benchmark measures memory transfer rates between main
+memory and GPUs. This benchmark is similar in spirit, and based on, John
+D. McCalpin's STREAM benchmark for CPUs. The version of BabelStream is built
+targeting AMD GPUs using HIP.")
+ (home-page "https://github.com/UoB-HPC/BabelStream.git")
+ (license (license:fsf-free
+ "https://github.com/UoB-HPC/BabelStream/blob/main/LICENSE"
+ "Custom permissive license based on John D. McCalpin's \
+original STREAM benchmark."))))