File tree Expand file tree Collapse file tree 2 files changed +64
-22
lines changed Expand file tree Collapse file tree 2 files changed +64
-22
lines changed Original file line number Diff line number Diff line change
1
+ package (default_visibility = ["//visibility:public" ])
2
+
3
+ config_setting (
4
+ name = "aarch64" ,
5
+ values = {
6
+ "cpu" : "aarch64" ,
7
+ },
8
+ )
9
+
10
+ cc_library (
11
+ name = "cublas_headers" ,
12
+ hdrs = ["include/cublas.h" ] + glob (["include/cublas+.h" ]),
13
+ includes = ["include/" ],
14
+ visibility = ["//visibility:private" ],
15
+ )
16
+
17
+ cc_import (
18
+ name = "cublas_lib" ,
19
+ shared_library = select ({
20
+ "aarch64" : "lib/aarch64-linux-gnu/libcublas.so.10" ,
21
+ "//conditions:default" : "lib/x86_64-linux-gnu/libcublas.so.10" ,
22
+ }),
23
+ visibility = ["//visibility:private" ],
24
+ )
25
+
26
+ cc_library (
27
+ name = "cublas" ,
28
+ deps = [
29
+ "cublas_headers" ,
30
+ "cublas_lib"
31
+ ],
32
+ visibility = ["//visibility:public" ],
33
+ )
Original file line number Diff line number Diff line change 1
1
package (default_visibility = ["//visibility:public" ])
2
2
3
+ config_setting (
4
+ name = "aarch64" ,
5
+ values = {
6
+ "cpu" : "aarch64" ,
7
+ },
8
+ )
9
+
3
10
cc_library (
4
11
name = "cudart" ,
5
- srcs = glob ([
6
- "lib/**/libcudart.so" ,
7
- ]),
12
+ srcs = select ({
13
+ ":aarch64" : [
14
+ "targets/aarch64-linux-gnu/lib/libcudart.so" ,
15
+ ],
16
+ "//conditions:default" : [
17
+ "targets/x86_64-linux/lib/libcudart.so" ,
18
+ ]
19
+ }),
8
20
hdrs = glob ([
9
21
"include/**/*.h" ,
10
22
"include/**/*.hpp" ,
@@ -15,16 +27,26 @@ cc_library(
15
27
16
28
cc_library (
17
29
name = "nvToolsExt" ,
18
- srcs = glob ([
19
- "lib/**/libnvToolsExt.so.1"
20
- ])
30
+ srcs = select ({
31
+ ":aarch64" : [
32
+ "targets/aarch64-linux-gnu/lib/libnvToolsExt.so.1" ,
33
+ ],
34
+ "//conditions:default" : [
35
+ "targets/x86_64-linux/lib/libnvToolsExt.so.1" ,
36
+ ]
37
+ }),
21
38
)
22
39
23
40
cc_library (
24
41
name = "cuda" ,
25
- srcs = glob ([
26
- "lib/**/*libcuda.so" ,
27
- ]),
42
+ srcs = select ({
43
+ ":aarch64" : glob ([
44
+ "targets/aarch64-linux-gnu/lib/**/lib*.so" ,
45
+ ]),
46
+ "//conditions:default" : glob ([
47
+ "targets/x86_64-linux/lib/**/lib*.so" ,
48
+ ])
49
+ }),
28
50
hdrs = glob ([
29
51
"include/**/*.h" ,
30
52
"include/**/*.hpp" ,
@@ -34,16 +56,3 @@ cc_library(
34
56
linkopts = ["-Wl,-rpath,lib/" ],
35
57
)
36
58
37
- cc_library (
38
- name = "cublas" ,
39
- srcs = glob ([
40
- "lib/**/*libcublas.so" ,
41
- ]),
42
- hdrs = glob ([
43
- "include/**/*cublas*.h" ,
44
- "include/**/*.hpp" ,
45
- "include/**/*.inl" ,
46
- ]),
47
- includes = ["include/" ],
48
- linkopts = ["-Wl,-rpath,lib/" ],
49
- )
You can’t perform that action at this time.
0 commit comments