Skip to content

Commit a7afaa7

Browse files
facaiyseanpmorgan
authored andcommitted
set up GPU environment (#294)
* BLD: compile gpu kernel for image_projective_transform_op_gpu * BUG: minor fix * TST: use gpu * BLD: fix code style * CLN: move gpu dir to external dir * CLN: configure ABI flag * CLN: leave TODO in configure.sh * CLN: create cuda_libs target * CLN: fork use_gpu * CLN: fix code style * CLN: remove -c opt and use CUDA_HOME * CLN: rename external => build_deps * CLN: add requirements_gpu.txt * TST: disable failed test cases on GPU * CLN: tracked by compile issue
1 parent f2a2e2e commit a7afaa7

22 files changed

+3877
-39
lines changed

WORKSPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("//tf_dependency:tf_configure.bzl", "tf_configure")
2+
load("//build_deps/gpu:cuda_configure.bzl", "cuda_configure")
23

34
tf_configure(
45
name = "local_config_tf",
56
)
7+
cuda_configure(name = "local_config_cuda")

build_deps/gpu/BUILD

Whitespace-only changes.

build_deps/gpu/crosstool/BUILD

Whitespace-only changes.

build_deps/gpu/crosstool/BUILD.tpl

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
licenses(["restricted"])
2+
3+
package(default_visibility = ["//visibility:public"])
4+
5+
toolchain(
6+
name = "toolchain-linux-x86_64",
7+
exec_compatible_with = [
8+
"@bazel_tools//platforms:linux",
9+
"@bazel_tools//platforms:x86_64",
10+
],
11+
target_compatible_with = [
12+
"@bazel_tools//platforms:linux",
13+
"@bazel_tools//platforms:x86_64",
14+
],
15+
toolchain = ":cc-compiler-local",
16+
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
17+
)
18+
19+
cc_toolchain_suite(
20+
name = "toolchain",
21+
toolchains = {
22+
"local|compiler": ":cc-compiler-local",
23+
"darwin|compiler": ":cc-compiler-darwin",
24+
"x64_windows|msvc-cl": ":cc-compiler-windows",
25+
"x64_windows": ":cc-compiler-windows",
26+
"arm": ":cc-compiler-local",
27+
"k8": ":cc-compiler-local",
28+
"piii": ":cc-compiler-local",
29+
"ppc": ":cc-compiler-local",
30+
"darwin": ":cc-compiler-darwin",
31+
},
32+
)
33+
34+
cc_toolchain(
35+
name = "cc-compiler-local",
36+
all_files = "%{linker_files}",
37+
compiler_files = ":empty",
38+
cpu = "local",
39+
dwp_files = ":empty",
40+
dynamic_runtime_libs = [":empty"],
41+
linker_files = "%{linker_files}",
42+
objcopy_files = ":empty",
43+
static_runtime_libs = [":empty"],
44+
strip_files = ":empty",
45+
# To support linker flags that need to go to the start of command line
46+
# we need the toolchain to support parameter files. Parameter files are
47+
# last on the command line and contain all shared libraries to link, so all
48+
# regular options will be left of them.
49+
supports_param_files = 1,
50+
toolchain_identifier = "local_linux",
51+
)
52+
53+
cc_toolchain(
54+
name = "cc-compiler-darwin",
55+
all_files = "%{linker_files}",
56+
compiler_files = ":empty",
57+
cpu = "darwin",
58+
dwp_files = ":empty",
59+
dynamic_runtime_libs = [":empty"],
60+
linker_files = "%{linker_files}",
61+
objcopy_files = ":empty",
62+
static_runtime_libs = [":empty"],
63+
strip_files = ":empty",
64+
supports_param_files = 0,
65+
toolchain_identifier = "local_darwin",
66+
)
67+
68+
cc_toolchain(
69+
name = "cc-compiler-windows",
70+
all_files = "%{win_linker_files}",
71+
compiler_files = ":empty",
72+
cpu = "x64_windows",
73+
dwp_files = ":empty",
74+
dynamic_runtime_libs = [":empty"],
75+
linker_files = "%{win_linker_files}",
76+
objcopy_files = ":empty",
77+
static_runtime_libs = [":empty"],
78+
strip_files = ":empty",
79+
supports_param_files = 1,
80+
toolchain_identifier = "local_windows",
81+
)
82+
83+
filegroup(
84+
name = "empty",
85+
srcs = [],
86+
)
87+
88+
filegroup(
89+
name = "crosstool_wrapper_driver_is_not_gcc",
90+
srcs = ["clang/bin/crosstool_wrapper_driver_is_not_gcc"],
91+
)
92+
93+
filegroup(
94+
name = "windows_msvc_wrapper_files",
95+
srcs = glob(["windows/msvc_*"]),
96+
)

0 commit comments

Comments
 (0)