1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
|
;;; Copyright © 2023 Advanced Micro Devices, Inc.
;;;
;;; 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 (amd packages rocm-libs)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix git-download)
#:use-module (guix download)
#:use-module (guix licenses)
#:use-module (guix build utils)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages linux)
#:use-module (gnu packages libevent)
#:use-module (gnu packages gcc)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages autotools)
#:use-module (gnu packages debug)
#:use-module (gnu packages pciutils)
#:use-module (gnu packages pretty-print)
#:use-module (gnu packages version-control)
#:use-module (gnu packages sqlite)
#:use-module (amd packages rocm-origin)
#:use-module (amd packages rocm-base)
#:use-module (amd packages rocm-hip)
#:use-module (amd packages rocm-tools)
#:use-module (amd packages python-cppheaderparser)
#:use-module (gnu packages mpi)
#:use-module (gnu packages fabric-management))
; rocdbg-api
(define (make-rocdbg-api rocm-comgr hipamd)
(package
(name "rocdbg-api")
(version (package-version hipamd))
(source
(rocm-origin "rocdbgapi" version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DPCI_IDS_PATH="
#$(this-package-input "hwdata")))))
(inputs (list libbacktrace hwdata rocm-comgr hipamd))
(synopsis "ROCm debugger API.")
(description
"The AMD Debugger API is a library that provides all the support necessary for a debugger
and other tools to perform low level control of the execution and inspection of execution state
of AMD's commercially available GPU architectures.")
(home-page "https://github.com/ROCm/ROCdbgapi")
(license expat)))
(define-public rocdbg-api
(make-rocdbg-api llvm-comgr hipamd))
; rocprim
(define (make-rocprim rocm-cmake hipamd)
(package
(name "rocprim")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:build-type "Release"
#:tests? #f ;No tests.
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$(this-package-input "hipamd")
"/bin/hipcc"))))
(inputs (list hipamd))
(native-inputs (list rocm-cmake python-wrapper))
(synopsis
"rocPRIM: a header-only library providing HIP parallel primitives")
(description
"The rocPRIM is a header-only library providing HIP parallel primitives
for developing performant GPU-accelerated code on the AMD ROCm platform.")
(home-page "https://github.com/ROCmSoftwarePlatform/rocPRIM.git")
(license expat)))
(define-public rocprim
(make-rocprim rocm-cmake hipamd))
; hipcub
(define-public (make-hipcub hipamd rocm-cmake rocprim)
(package
(name "hipcub")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
"-DAMDGPU_TARGETS=gfx90a,gfx1030,gfx1100")))
(inputs (list hipamd rocprim))
(native-inputs (list rocm-cmake))
(synopsis "hipCUB is a HIP wrapper for rocPRIM.")
(description
"hipCUB is a thin wrapper library on top of rocPRIM or CUB. You can use it to port a
CUB project into HIP so you can use AMD hardware (and ROCm software).")
(home-page "https://github.com/ROCm/hipCUB")
(license bsd-3)))
(define-public hipcub
(make-hipcub hipamd rocm-cmake rocprim))
; rccl
(define-public (make-rccl hipamd rocm-cmake rocm-smi hipify)
(package
(name "rccl")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DROCM_PATH="
#$(this-package-input "hipamd"))
(string-append "-DCMAKE_CXX_COMPILER="
#$(this-package-input "hipamd")
"/bin/hipcc")
"-DAMDGPU_TARGETS=gfx90a,gfx1030,gfx1100")
#:phases #~(modify-phases %standard-phases
(add-before 'configure 'parallel-jobs
(lambda _
(substitute* "CMakeLists.txt"
(("target_compile_options\\(rccl PRIVATE -parallel-jobs=.*\\)")
"target_compile_options(rccl PRIVATE -parallel-jobs=1)")
(("target_link_options\\(rccl PRIVATE -parallel-jobs=.*\\)")
"target_link_options(rccl PRIVATE -parallel-jobs=4)")))))))
(inputs (list hipamd rocm-smi))
(native-inputs (list rocm-cmake hipify))
(properties '((max-silent-time . 14400)))
(synopsis "ROCm Communication Collectives Library")
(description
"RCCL (pronounced \"Rickle\") is a stand-alone library of standard collective communication
routines for GPUs, implementing all-reduce, all-gather, reduce, broadcast, reduce-scatter, gather,
scatter, and all-to-all. There is also initial support for direct GPU-to-GPU send and receive operations.
It has been optimized to achieve high bandwidth on platforms using PCIe, xGMI as well as networking using
InfiniBand Verbs or TCP/IP sockets. RCCL supports an arbitrary number of GPUs installed in a single node
or multiple nodes, and can be used in either single- or multi-process (e.g., MPI) applications.")
(home-page "https://github.com/ROCm/rccl")
(license bsd-3)))
(define-public rccl
(make-rccl hipamd rocm-cmake rocm-smi hipify))
; rocthrust
(define (make-rocthrust hipamd rocm-cmake rocprim)
(package
(name "rocthrust")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc"))))
(inputs (list rocprim hipamd))
(native-inputs (list rocm-cmake))
(synopsis "rocThrust is a parallel algorithm library.")
(description
"rocThrust is a parallel algorithm library that has been ported to HIP and ROCm,
which uses the rocPRIM library. The HIP-ported library works on HIP and ROCm software.")
(home-page "https://github.com/ROCm/rocThrust.git")
(license asl2.0)))
(define-public rocthrust
(make-rocthrust hipamd rocm-cmake rocprim))
; rocsparse
(define (make-rocsparse rocm-cmake hipamd rocm-device-libs rocr-runtime
rocprim)
(package
(name "rocsparse")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:configure-flags #~(list "-DAMDGPU_TARGETS=gfx90a;gfx1030,gfx1100"
(string-append "-DCMAKE_CXX_COMPILER="
#$(this-package-input "hipamd")
"/bin/hipcc")
(string-append "-DCMAKE_Fortran_COMPILER="
#$(this-package-native-input
"gfortran") "/bin/gfortran")
"-DBUILD_CLIENTS_SAMPLES:BOOL=OFF" ;build fails otherwise
)))
(native-inputs (list git gfortran rocm-cmake python-wrapper))
(inputs (list hipamd rocm-device-libs rocr-runtime rocprim))
(synopsis "rocSPARSE provides an interface for sparse BLAS operations.")
(description
"rocSPARSE exposes a common interface that provides Basic Linear Algebra Subroutines (BLAS)
for sparse computation. It's implemented on top of AMD ROCm runtime and toolchains. rocSPARSE is created using
the HIP programming language and optimized for AMD's latest discrete GPUs.")
(home-page "https://github.com/ROCm/rocSPARSE.git")
(license expat)))
(define-public rocsparse
(make-rocsparse rocm-cmake hipamd llvm-device-libs rocr-runtime rocprim))
; hipsparse
(define-public (make-hipsparse hipamd rocm-cmake rocsparse)
(package
(name "hipsparse")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
"-DBUILD_CLIENTS_SAMPLES:BOOL=OFF" ;build fails otherwise
"-DAMDGPU_TARGETS=gfx90a,gfx1030,gfx1100")))
(inputs (list hipamd rocsparse))
(native-inputs (list git gfortran rocm-cmake))
(synopsis "A HIP interface to rocSPARSE.")
(description
"hipSPARSE is a SPARSE marshalling library with multiple supported backends.
It sits between your application and a 'worker' SPARSE library, where it marshals inputs to the backend
library and marshals results to your application. hipSPARSE exports an interface that doesn't require the
client to change, regardless of the chosen backend. Currently, hipSPARSE supports rocSPARSE and cuSPARSE
backends.")
(home-page "https://github.com/ROCm/hipSPARSE.git")
(license expat)))
(define-public hipsparse
(make-hipsparse hipamd rocm-cmake rocsparse))
; libfabric built with rocm
(define (make-ofi-rocm rocr-runtime)
(package/inherit libfabric
(name "libfabric-rocm")
(version (string-append (package-version libfabric) ".rocm"
(package-version rocr-runtime)))
(arguments (substitute-keyword-arguments (package-arguments libfabric)
((#:configure-flags flags)
#~(append (list (string-append "--with-rocr="
#$rocr-runtime))
#$flags))))
(inputs (modify-inputs (package-inputs libfabric)
(append rocr-runtime)))))
(define-public ofi-rocm
(make-ofi-rocm rocr-runtime))
; ucx built with rocm
(define (make-ucx-rocm roct-thunk rocr-runtime hipamd)
(package/inherit ucx
(name "ucx-rocm")
(version (string-append (package-version ucx) ".rocm"
(package-version hipamd)))
(arguments (substitute-keyword-arguments (package-arguments ucx)
((#:configure-flags flags)
#~(append (list "--without-cuda" "--without-knem"
"--without-java"
(string-append "--with-rocm="
#$(this-package-input
"rocr-runtime"))
(string-append "--with-hip="
#$(this-package-input
"hipamd")))
#$flags))))
(native-inputs (modify-inputs (package-native-inputs ucx)
(append roct-thunk)))
(inputs (modify-inputs (package-inputs ucx)
(append hipamd)
(append rocr-runtime)))
(properties `((tunable? . #t) ,@(package-properties ucx)))))
(define-public ucx-rocm
(make-ucx-rocm roct-thunk rocr-runtime hipamd))
; openmpi built with ucx-rocm and libfabric-rocm
(define (make-openmpi-rocm ucx ofi hipamd)
(package/inherit openmpi
(name (string-append (package-name openmpi) "-rocm"))
(version (string-append (package-version openmpi) ".rocm"
(package-version hipamd)))
(arguments (substitute-keyword-arguments (package-arguments openmpi)
((#:configure-flags flags)
#~(append (list (string-append "--with-rocm="
#$(this-package-input
"hipamd"))
(string-append "--with-ofi="
#$(this-package-input
"libfabric")))
#$flags))
((#:phases phases
'%standard-phases)
#~(modify-phases #$phases
;; opensm is needed for InfiniBand support.
(add-after 'unpack 'find-opensm-headers
(lambda* (#:key inputs #:allow-other-keys)
(setenv "C_INCLUDE_PATH"
(search-input-directory inputs
"/include/infiniband"))
(setenv "CPLUS_INCLUDE_PATH"
(search-input-directory inputs
"/include/infiniband"))))))))
(inputs (modify-inputs (package-inputs openmpi)
(replace "ucx" ucx)
(replace "libfabric" ofi)
(append hipamd)))))
(define-public openmpi-rocm
(make-openmpi-rocm ucx-rocm ofi-rocm hipamd))
; roctracer
(define (make-roctracer hipamd)
(package
(name "roctracer")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DROCM_PATH="
#$hipamd)
#$(if (version>=? version "5.5.0") ""
"-DCMAKE_CXX_COMPILER=g++"))
#:phases #~(modify-phases %standard-phases
(add-after 'unpack 'update-filesystem
;; only needed from 5.5 onwards
(lambda _
(substitute* (append (find-files "." ".cpp$")
(find-files "." ".h$"))
(("std::experimental::filesystem")
"std::filesystem")
(("<experimental/filesystem>")
"<filesystem>")))))))
(inputs (list numactl hipamd python python-cppheaderparser))
(synopsis "A callback/activity library for performance tracing AMD GPUs.")
(description
"ROCm tracer provides an API to provide functionality for registering
the runtimes API callbacks and asynchronous activity records pool support.")
(home-page "https://github.com/ROCm/roctracer")
(license expat)))
(define-public roctracer
(make-roctracer hipamd))
; rocblas
(define (make-rocblas tensile rocm-cmake hipamd)
(package
(name "rocblas")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:build-type "Release"
#:tests? #f
#:validate-runpath? #f
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
(string-append "-DTensile_CPU_THREADS="
(number->string (parallel-job-count)))
"-DBUILD_WITH_PIP=OFF"
(if (string=? #$version "5.3.3")
"-DCMAKE_TOOLCHAIN_FILE=toolchain-linux.cmake"
"") "-DAMDGPU_TARGETS=gfx1100;gfx1030;gfx90a")
#:phases #~(modify-phases %standard-phases
(add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
;; only needed for version<=5.4
(lambda* (#:key inputs #:allow-other-keys)
(define cplus-include-path
;; Delete glibc/include and gcc/include/c++ from CPLUS_INCLUDE_PATH
;; to allow clang to include the cuda_wrappers first.
(delete (string-append (assoc-ref inputs "libc")
"/include")
(delete (string-append (assoc-ref inputs
"gcc")
"/include/c++")
(string-split (getenv
"CPLUS_INCLUDE_PATH")
#\:))))
(setenv "CPLUS_INCLUDE_PATH"
(string-join cplus-include-path ":")))))))
(native-inputs (list python-wrapper tensile hipamd rocm-cmake))
(properties '((max-silent-time . 14400)))
(synopsis "Next generation BLAS implementation for ROCm platform.")
(description
"rocBLAS is the ROCm Basic Linear Algebra Subprograms (BLAS) library.
rocBLAS is implemented in the HIP programming language and optimized for AMD GPUs.")
(home-page "https://github.com/ROCmSoftwarePlatform/rocBLAS.git")
(license (list expat bsd-3))))
(define-public rocblas
(make-rocblas tensile rocm-cmake hipamd))
; rocsolver
(define (make-rocsolver hipamd rocm-cmake rocblas rocprim)
(package
(name "rocsolver")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
"-DBUILD_WITH_SPARSE=OFF"
"-DAMDGPU_TARGETS=gfx1100;gfx1030;gfx90a")
#:phases #~(modify-phases %standard-phases
(add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
(lambda* (#:key inputs #:allow-other-keys)
(define cplus-include-path
;; Delete glibc/include and gcc/include/c++ from CPLUS_INCLUDE_PATH
;; to allow clang to include the cuda_wrappers first.
(delete (string-append (assoc-ref inputs "libc")
"/include")
(delete (string-append (assoc-ref inputs
"gcc")
"/include/c++")
(string-split (getenv
"CPLUS_INCLUDE_PATH")
#\:))))
(setenv "CPLUS_INCLUDE_PATH"
(string-join cplus-include-path ":")))))))
(inputs (list fmt-8 hipamd rocblas rocprim))
(native-inputs (list python-wrapper rocm-cmake))
(synopsis "rocSOLVER provides LAPACK operations for the ROCm platform.")
(description
"rocSOLVER is a work-in-progress implementation of a subset of LAPACK functionality
on the ROCm platform.")
(home-page "https://github.com/ROCm/rocSOLVER.git")
(license (list bsd-2 bsd-3))))
(define-public rocsolver
(make-rocsolver hipamd rocm-cmake rocblas rocprim))
; hipblas
(define-public (make-hipblas hipamd rocm-cmake rocblas rocsolver)
(package
(name "hipblas")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
"-DAMDGPU_TARGETS=gfx1100;gfx90a;gfx1030")))
(inputs (list gfortran hipamd rocblas rocsolver))
(native-inputs (list rocm-cmake))
(synopsis "hipBLAS is a HIP interface to rocBLAS.")
(description
"hipBLAS is a Basic Linear Algebra Subprograms (BLAS) marshalling library with multiple
supported backends. It sits between your application and a 'worker' BLAS library, where it marshals inputs to
the backend library and marshals results to your application. hipBLAS exports an interface that doesn't
require the client to change, regardless of the chosen backend. Currently, hipBLAS supports rocBLAS and
cuBLAS backends.")
(home-page "https://github.com/ROCm/hipBLAS.git")
(license (list bsd-3 expat))))
(define-public hipblas
(make-hipblas hipamd rocm-cmake rocblas rocsolver))
; rocrand
(define-public (make-rocrand hipamd rocm-cmake)
(package
(name "rocrand")
(version (package-version hipamd))
(source
(rocm-origin name version
#:recursive? #f))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
(string-append
"-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath="
#$output "/lib") "-DBUILD_HIPRAND:BOOL=OFF"
"-DAMDGPU_TARGETS=gfx1100;gfx90a;gfx1030")))
(inputs (list hipamd))
(native-inputs (list git rocm-cmake))
(synopsis "RAND library for HIP programming language.")
(description
"The rocRAND project provides functions that generate pseudorandom and quasirandom numbers.
The rocRAND library is implemented in the HIP programming language and optimized for AMD's latest discrete GPUs.
It is designed to run on top of AMD's ROCm runtime, but it also works on CUDA-enabled GPUs.")
(home-page "https://github.com/ROCm/rocRAND.git")
(license expat)))
(define-public rocrand
(make-rocrand hipamd rocm-cmake))
; hiprand
(define-public (make-hiprand hipamd rocm-cmake rocrand)
(package
(name "hiprand")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
"-DAMDGPU_TARGETS=gfx90a,gfx1100,gfx1030")))
(inputs (list hipamd rocrand))
(native-inputs (list git rocm-cmake))
(synopsis "RAND library for HIP programming language.")
(description
"The rocRAND project provides functions that generate pseudorandom and quasirandom numbers.
The rocRAND library is implemented in the HIP programming language and optimized for AMD's latest discrete GPUs.
It is designed to run on top of AMD's ROCm runtime, but it also works on CUDA-enabled GPUs.")
(home-page "https://github.com/ROCm/rocRAND.git")
(license expat)))
(define-public hiprand
(make-hiprand hipamd rocm-cmake rocrand))
; rocalution
(define-public (make-rocalution hipamd
rocm-cmake
rocsparse
rocblas
rocprim
rocrand)
(package
(name "rocalution")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:build-type "Release"
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
(string-append "-DROCM_PATH="
#$hipamd)
"-DAMDGPU_TARGETS=gfx1030;gfx90a;gfx1100"
"-DSUPPORT_HIP=ON"
"-DBUILD_CLIENTS_SAMPLES=OFF"
"-DBUILD_CLIENTS_TESTS=OFF"
"-DBUILD_CLIENTS_BENCHMARKS=OFF")
#:phases #~(modify-phases %standard-phases
(add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
(lambda* (#:key inputs #:allow-other-keys)
(define cplus-include-path
;; Delete glibc/include and gcc/include/c++ from CPLUS_INCLUDE_PATH
;; to allow clang to include the cuda_wrappers first.
(delete (string-append (assoc-ref inputs "libc")
"/include")
(delete (string-append (assoc-ref inputs
"gcc")
"/include/c++")
(string-split (getenv
"CPLUS_INCLUDE_PATH")
#\:))))
(setenv "CPLUS_INCLUDE_PATH"
(string-join cplus-include-path ":")))))))
(inputs (list hipamd rocsparse rocblas rocprim rocrand))
(native-inputs (list git rocm-cmake))
(synopsis "rocALUTION is a sparse linear algebra library.")
(description
"rocALUTION is a sparse linear algebra library that can be used to explore fine-grained
parallelism on top of the ROCm platform runtime and toolchains. Based on C++ and HIP, rocALUTION provides a
portable, generic, and flexible design that allows seamless integration with other scientific software packages.")
(home-page "https://github.com/ROCm/rocALUTION.git")
(license expat)))
(define-public rocalution
(make-rocalution hipamd
rocm-cmake
rocsparse
rocblas
rocprim
rocrand))
; rocfft
(define (make-rocfft hipamd rocm-cmake)
(package
(name "rocfft")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
;; #:build-type "Release"
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
"-DSQLITE_USE_SYSTEM_PACKAGE:BOOL=ON"
"-DAMDGPU_TARGETS=gfx90a;gfx1030;gfx1100")))
(inputs (list hipamd))
(native-inputs (list rocm-cmake python-wrapper sqlite))
(properties '((max-silent-time . 14400)))
(synopsis "Fast Fourier transforms (FFTs) for ROCm.")
(description
"rocFFT is a software library for computing fast Fourier transforms (FFTs) written in
the HIP programming language. It's part of AMD's software ecosystem based on ROCm. The rocFFT
library can be used with AMD and NVIDIA GPUs.")
(home-page "https://github.com/ROCm/rocFFT")
(license expat)))
(define-public rocfft
(make-rocfft hipamd rocm-cmake))
; hipfft
(define (make-hipfft hipamd rocm-cmake rocfft)
(package
(name "hipfft")
(version (package-version hipamd))
(source
(rocm-origin name version))
(build-system cmake-build-system)
(arguments
(list
#:tests? #f ;No tests.
#:configure-flags #~(list (string-append "-DCMAKE_CXX_COMPILER="
#$hipamd "/bin/hipcc")
(string-append "-DROCM_PATH="
#$hipamd)
"-DAMDGPU_TARGETS=gfx90a;gfx1030;gfx1100")))
(inputs (list hipamd rocfft))
(native-inputs (list git rocm-cmake)) ;python-wrapper
(synopsis "A HIP interface for rocFFT and cuFFT.")
(description
"hipFFT exports an interface that doesn't require the client to change, regardless of the
chosen backend. It sits between your application and the backend FFT library, where it marshals
inputs to the backend and marshals results back to your application.")
(home-page "https://github.com/ROCm/hipFFT")
(license expat)))
(define-public hipfft
(make-hipfft hipamd rocm-cmake rocfft))
|