forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gloo.BUILD
86 lines (82 loc) · 2.46 KB
/
gloo.BUILD
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
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@//tools/rules:cu.bzl", "cu_library")
load("@//third_party:substitution.bzl", "template_rule")
load("@//tools/config:defs.bzl", "if_cuda")
template_rule(
name = "gloo_config_cmake_macros",
src = "gloo/config.h.in",
out = "gloo/config.h",
substitutions = {
"@GLOO_VERSION_MAJOR@": "0",
"@GLOO_VERSION_MINOR@": "5",
"@GLOO_VERSION_PATCH@": "0",
"cmakedefine01 GLOO_USE_CUDA": "define GLOO_USE_CUDA 1",
"cmakedefine01 GLOO_USE_NCCL": "define GLOO_USE_NCCL 0",
"cmakedefine01 GLOO_USE_ROCM": "define GLOO_USE_ROCM 0",
"cmakedefine01 GLOO_USE_RCCL": "define GLOO_USE_RCCL 0",
"cmakedefine01 GLOO_USE_REDIS": "define GLOO_USE_REDIS 0",
"cmakedefine01 GLOO_USE_IBVERBS": "define GLOO_USE_IBVERBS 0",
"cmakedefine01 GLOO_USE_MPI": "define GLOO_USE_MPI 0",
"cmakedefine01 GLOO_USE_AVX": "define GLOO_USE_AVX 0",
"cmakedefine01 GLOO_USE_LIBUV": "define GLOO_USE_LIBUV 0",
"cmakedefine01 GLOO_HAVE_TRANSPORT_TCP": "define GLOO_HAVE_TRANSPORT_TCP 1",
"cmakedefine01 GLOO_HAVE_TRANSPORT_IBVERBS": "define GLOO_HAVE_TRANSPORT_IBVERBS 0",
"cmakedefine01 GLOO_HAVE_TRANSPORT_UV": "define GLOO_HAVE_TRANSPORT_UV 0",
},
)
cc_library(
name = "gloo_headers",
hdrs = glob(
[
"gloo/*.h",
"gloo/common/*.h",
"gloo/rendezvous/*.h",
"gloo/transport/*.h",
"gloo/transport/tcp/*.h",
],
exclude = [
"gloo/rendezvous/redis_store.h",
],
) + ["gloo/config.h"],
includes = [
".",
],
)
cu_library(
name = "gloo_cuda",
srcs = [
"gloo/cuda.cu",
"gloo/cuda_private.cu",
],
visibility = ["//visibility:public"],
deps = [
":gloo_headers",
],
alwayslink = True,
)
cc_library(
name = "gloo",
srcs = glob(
[
"gloo/*.cc",
"gloo/common/*.cc",
"gloo/rendezvous/*.cc",
"gloo/transport/*.cc",
"gloo/transport/tcp/*.cc",
],
exclude = [
"gloo/cuda*.cc",
"gloo/common/win.cc",
"gloo/rendezvous/redis_store.cc",
]
) + if_cuda(glob(["gloo/cuda*.cc"])),
copts = [
"-std=gnu++11",
"-std=c++11",
],
visibility = ["//visibility:public"],
deps = [":gloo_headers"] + if_cuda(
[":gloo_cuda"],
[],
),
)