guix_mirror_bot pushed a commit to branch master
in repository guix.

commit ffe09631d80f8799126d5dcb43488593de666cee
Author: David Elsing <[email protected]>
AuthorDate: Tue Feb 3 21:33:21 2026 +0100

    gnu: Add hipsparse.
    
    * gnu/packages/rocm-libs.scm (hipsparse): New variable.
    
    Signed-off-by: Ludovic Courtès <[email protected]>
---
 gnu/packages/rocm-libs.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/rocm-libs.scm b/gnu/packages/rocm-libs.scm
index cbabda2da4..1b0334d33e 100644
--- a/gnu/packages/rocm-libs.scm
+++ b/gnu/packages/rocm-libs.scm
@@ -525,3 +525,40 @@ for developing performant GPU-accelerated code on the AMD 
ROCm platform.")
     (description "This package exposes a sparse BLAS interface for ROCm.  It
 is implemented in the HIP programming language.")
     (license (list license:expat license:bsd-3))))
+
+(define-public hipsparse
+  (package
+    (name "hipsparse")
+    (version %rocm-version)
+    (source (rocm-library-source "hipsparse"))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:tests? #f ; requires GPU
+      #:build-type "Release"
+      #:configure-flags
+      #~(list
+         "-DCMAKE_CXX_COMPILER=hipcc"
+         #$(string-append "-DGPU_TARGETS=" (current-amd-gpu-targets-string)))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'set-example-fpie
+            (lambda _
+              (substitute* "clients/samples/CMakeLists.txt"
+                (("add_executable.*EXAMPLE_TARGET.*" all)
+                 (string-append
+                  all "target_compile_options(${EXAMPLE_TARGET}"
+                  " PRIVATE -fpie)\n"))))))))
+    (inputs
+     (list googletest
+           gfortran
+           rocm-hip-runtime
+           rocsparse))
+    (native-inputs (list rocm-cmake rocm-toolchain))
+    (properties `((amd-gpu-targets . ,%default-amd-gpu-targets)))
+    (home-page %rocm-libraries-url)
+    (synopsis "Sparse linear algebra library with multiple supported
+backends")
+    (description "This package contains a wrapper library for sparse linear
+algebra on GPUs, in particular via rocSPARSE for AMD GPUs.")
+    (license license:expat)))

Reply via email to