| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | (define-module (gnu packages rocm-apps)
|
| 20 | #:use-module (guix gexp)
|
| 21 | #:use-module (guix build-system cmake)
|
| 22 | #:use-module (guix git-download)
|
| 23 | #:use-module (guix packages)
|
| 24 | #:use-module ((guix licenses) #:prefix license:)
|
| 25 | #:use-module (gnu packages)
|
| 26 | #:use-module (gnu packages llvm)
|
| 27 | #:use-module (gnu packages mpi)
|
| 28 | #:use-module (gnu packages rocm)
|
| 29 | #:use-module (gnu packages rocm-libs)
|
| 30 | #:use-module (gnu packages version-control))
|
| 31 |
|
| 32 | (define-public rochpl
|
| 33 | (package
|
| 34 | (name "rochpl")
|
| 35 | (version "7.0.2")
|
| 36 | (home-page "https://github.com/ROCm/rocHPL")
|
| 37 | (source
|
| 38 | (origin
|
| 39 | (method git-fetch)
|
| 40 | (uri (git-reference
|
| 41 | (url home-page)
|
| 42 | (commit (string-append "v" version))))
|
| 43 | (file-name (git-file-name name version))
|
| 44 | (sha256
|
| 45 | (base32 "0i3aqd2jnd4ivcpqli75kr9019fcraylxxv9laixmyx9gfxv20f0"))
|
| 46 | (patches (search-patches "rochpl-supported-distros.patch"))))
|
| 47 | (build-system cmake-build-system)
|
| 48 | (arguments
|
| 49 | (list
|
| 50 | #:configure-flags
|
| 51 | #~(list (string-append "-DGPU_TARGETS="
|
| 52 | #$(current-amd-gpu-targets-string))
|
| 53 |
|
| 54 | |
| 55 | |
| 56 | "-DROCM_FOUND=ON"
|
| 57 |
|
| 58 | (string-append "-DHIP_ROOT_DIR="
|
| 59 | #$(this-package-native-input "rocm-toolchain"))
|
| 60 | (string-append "-DROCM_PATH="
|
| 61 | #$(this-package-input "rocm-hip-runtime"))
|
| 62 | (string-append "-DHPL_MPI_DIR="
|
| 63 | #$(this-package-input "openmpi-rocm")))
|
| 64 | #:tests? #f |
| 65 | #:phases
|
| 66 | #~(modify-phases %standard-phases
|
| 67 | (add-after 'unpack 'avoid-native-optimizations
|
| 68 | (lambda _
|
| 69 | (substitute* "CMakeLists.txt"
|
| 70 | (("-march=native")
|
| 71 | ""))))
|
| 72 | (add-after 'unpack 'set-default-data-file-name
|
| 73 | (lambda _
|
| 74 | |
| 75 | (substitute* (find-files "scripts" "\\.in")
|
| 76 | (("filename=HPL\\.dat")
|
| 77 | (string-append "filename=" #$output
|
| 78 | "/share/rochpl/HPL.dat")))))
|
| 79 | (add-after 'install 'move-files-where-they-belong
|
| 80 | (lambda _
|
| 81 | |
| 82 | (let ((datadir (string-append #$output "/share/rochpl")))
|
| 83 | (for-each (lambda (program)
|
| 84 | (rename-file
|
| 85 | (string-append #$output "/" program)
|
| 86 | (string-append #$output "/bin/"
|
| 87 | program)))
|
| 88 | '("mpirun_rochpl" "run_rochpl"))
|
| 89 |
|
| 90 | (mkdir-p datadir)
|
| 91 | (rename-file (string-append #$output "/HPL.dat")
|
| 92 | (string-append datadir "/HPL.dat"))))))))
|
| 93 | (native-inputs
|
| 94 | (list rocm-toolchain rocm-cmake git-minimal/pinned))
|
| 95 | (inputs
|
| 96 | (list rocm-hip-runtime
|
| 97 | rocblas
|
| 98 | libomp-rocm
|
| 99 | openmpi-rocm))
|
| 100 | (synopsis "Linear algebra benchmark for AMD GPUs")
|
| 101 | (description
|
| 102 | "rocHPL is a benchmark based on the @acronym{HPL, high-performance
|
| 103 | LINPACK} benchmark, a reference linear-algebra benchmark, implemented on top
|
| 104 | of AMD's Radeon Open Compute (ROCm) platform. rocHPL is created using the HIP
|
| 105 | programming language and optimized for AMD's discrete GPUs.")
|
| 106 | (properties
|
| 107 | `((amd-gpu-targets . ,%default-amd-gpu-targets)
|
| 108 | (tunable? . #t)))
|
| 109 | (license (list license:bsd-4 license:bsd-3))))
|
| 110 |
|