tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
miopengemm: init at 5.3.1
Madoura
3 years ago
6cdf1908
6aa9de9f
+133
2 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
miopengemm
default.nix
top-level
all-packages.nix
+129
pkgs/development/libraries/miopengemm/default.nix
···
1
1
+
{ lib
2
2
+
, stdenv
3
3
+
, fetchFromGitHub
4
4
+
, cmake
5
5
+
, rocm-cmake
6
6
+
, rocm-opencl-runtime
7
7
+
, clang
8
8
+
, texlive ? null
9
9
+
, doxygen ? null
10
10
+
, sphinx ? null
11
11
+
, python3Packages ? null
12
12
+
, openblas ? null
13
13
+
, buildDocs ? false
14
14
+
, buildTests ? false
15
15
+
, buildBenchmarks ? false
16
16
+
}:
17
17
+
18
18
+
assert buildDocs -> texlive != null;
19
19
+
assert buildDocs -> doxygen != null;
20
20
+
assert buildDocs -> sphinx != null;
21
21
+
assert buildDocs -> python3Packages != null;
22
22
+
assert buildTests -> openblas != null;
23
23
+
24
24
+
let
25
25
+
latex = lib.optionalAttrs buildDocs (texlive.combine {
26
26
+
inherit (texlive) scheme-small
27
27
+
latexmk
28
28
+
tex-gyre
29
29
+
fncychap
30
30
+
wrapfig
31
31
+
capt-of
32
32
+
framed
33
33
+
needspace
34
34
+
tabulary
35
35
+
varwidth
36
36
+
titlesec;
37
37
+
});
38
38
+
in stdenv.mkDerivation rec {
39
39
+
pname = "miopengemm";
40
40
+
rocmVersion = "5.3.1";
41
41
+
version = rocmVersion;
42
42
+
43
43
+
outputs = [
44
44
+
"out"
45
45
+
] ++ lib.optionals buildDocs [
46
46
+
"docs"
47
47
+
] ++ lib.optionals buildTests [
48
48
+
"test"
49
49
+
] ++ lib.optionals buildBenchmarks [
50
50
+
"benchmark"
51
51
+
];
52
52
+
53
53
+
src = fetchFromGitHub {
54
54
+
owner = "ROCmSoftwarePlatform";
55
55
+
repo = "MIOpenGEMM";
56
56
+
rev = "rocm-${rocmVersion}";
57
57
+
hash = "sha256-AiRzOMYRA/0nbQomyq4oOEwNZdkPYWRA2W6QFlctvFc=";
58
58
+
};
59
59
+
60
60
+
nativeBuildInputs = [
61
61
+
cmake
62
62
+
rocm-cmake
63
63
+
clang
64
64
+
];
65
65
+
66
66
+
buildInputs = [
67
67
+
rocm-opencl-runtime
68
68
+
] ++ lib.optionals buildDocs [
69
69
+
latex
70
70
+
doxygen
71
71
+
sphinx
72
72
+
python3Packages.sphinx_rtd_theme
73
73
+
python3Packages.breathe
74
74
+
] ++ lib.optionals buildTests [
75
75
+
openblas
76
76
+
];
77
77
+
78
78
+
cmakeFlags = [
79
79
+
"-DCMAKE_C_COMPILER=clang"
80
80
+
"-DCMAKE_CXX_COMPILER=clang++"
81
81
+
# Manually define CMAKE_INSTALL_<DIR>
82
82
+
# See: https://github.com/NixOS/nixpkgs/pull/197838
83
83
+
"-DCMAKE_INSTALL_BINDIR=bin"
84
84
+
"-DCMAKE_INSTALL_LIBDIR=lib"
85
85
+
"-DCMAKE_INSTALL_INCLUDEDIR=include"
86
86
+
] ++ lib.optionals buildTests [
87
87
+
"-DOPENBLAS=ON"
88
88
+
] ++ lib.optionals buildBenchmarks [
89
89
+
"-DAPI_BENCH_MIOGEMM=ON"
90
90
+
# Needs https://github.com/CNugteren/CLBlast
91
91
+
# "-DAPI_BENCH_CLBLAST=ON"
92
92
+
# Needs https://github.com/openai/triton
93
93
+
# "-DAPI_BENCH_ISAAC=ON"
94
94
+
];
95
95
+
96
96
+
# Unfortunately, it seems like we have to call make on these manually
97
97
+
postBuild = lib.optionalString buildDocs ''
98
98
+
export HOME=$(mktemp -d)
99
99
+
make doc
100
100
+
'' + lib.optionalString buildTests ''
101
101
+
make check
102
102
+
'' + lib.optionalString buildBenchmarks ''
103
103
+
make examples
104
104
+
'';
105
105
+
106
106
+
postInstall = lib.optionalString buildTests ''
107
107
+
mkdir -p $test/bin
108
108
+
find tests -executable -type f -exec mv {} $test/bin \;
109
109
+
patchelf --set-rpath ${lib.makeLibraryPath buildInputs}:$out/lib $test/bin/*
110
110
+
'' + lib.optionalString buildBenchmarks ''
111
111
+
mkdir -p $benchmark/bin
112
112
+
find examples -executable -type f -exec mv {} $benchmark/bin \;
113
113
+
patchelf --set-rpath ${lib.makeLibraryPath buildInputs}:$out/lib $benchmark/bin/*
114
114
+
'';
115
115
+
116
116
+
postFixup = lib.optionalString buildDocs ''
117
117
+
mkdir -p $docs/share/doc/miopengemm
118
118
+
mv ../doc/html $docs/share/doc/miopengemm
119
119
+
mv ../doc/pdf/miopengemm.pdf $docs/share/doc/miopengemm
120
120
+
'';
121
121
+
122
122
+
meta = with lib; {
123
123
+
description = "OpenCL general matrix multiplication API for ROCm";
124
124
+
homepage = "https://github.com/ROCmSoftwarePlatform/MIOpenGEMM";
125
125
+
license = with licenses; [ mit ];
126
126
+
maintainers = with maintainers; [ Madouura ];
127
127
+
broken = rocmVersion != clang.version;
128
128
+
};
129
129
+
}
+4
pkgs/top-level/all-packages.nix
···
14895
14895
inherit (llvmPackages_rocm) llvm;
14896
14896
};
14897
14897
14898
14898
+
miopengemm = callPackage ../development/libraries/miopengemm {
14899
14899
+
inherit (llvmPackages_rocm) clang;
14900
14900
+
};
14901
14901
+
14898
14902
rtags = callPackage ../development/tools/rtags {
14899
14903
inherit (darwin) apple_sdk;
14900
14904
};