aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Luke Iwanski <luke@codeplay.com>2017-06-23 22:44:31 +0100
committerGravatar Benoit Steiner <benoitsteiner@users.noreply.github.com>2017-06-23 14:44:31 -0700
commit90740259edb1ff2a858cac71075a8020cb4a18f8 (patch)
tree3a1de98ef1d3972dd73d0d0a00fbbb5138421875
parent270a3e8886e352ad563a3431963296e3dc6dae06 (diff)
[Build] Reduces build time for SYCL target (#10996)
* [Build] Removes tensorboard from skip list since it has been removed * Improve SYCL config for Tensorflow (#98) Only libtensorflow attempts to link against libComputeCpp.so now, other targets should only utilise the headers. Added more if_sycl statements to BUILD files. * [Build] Fixes typos & linkstatic=1 -> linkstatic=0 * [Build] Cleans SYCL dependency, linkstatic = 0 * [Build] No need to link syclrt tensorflow/BUILD * sycl_runtime is needed in kernels/BUILD due to inclusion
-rw-r--r--tensorflow/core/BUILD7
-rwxr-xr-xthird_party/sycl/crosstool/computecpp.tpl6
-rwxr-xr-xthird_party/sycl/sycl/BUILD.tpl2
3 files changed, 7 insertions, 8 deletions
diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD
index 27544c9961..a23c801bd7 100644
--- a/tensorflow/core/BUILD
+++ b/tensorflow/core/BUILD
@@ -121,7 +121,6 @@ load(
"//third_party/mkl:build_defs.bzl",
"if_mkl",
)
-load("@local_config_sycl//sycl:build_defs.bzl", "if_sycl")
# -----------------------------------------------------------------------------
# Public targets
@@ -820,7 +819,7 @@ cc_library(
":test",
"//tensorflow/core/kernels:constant_op",
"//tensorflow/core/kernels:ops_util",
- "//tensorflow/core/platform/default/build_config:gtest", # + if_sycl([":sycl_runtime"])
+ "//tensorflow/core/platform/default/build_config:gtest",
],
)
@@ -1850,7 +1849,7 @@ cc_library(
"common_runtime/sycl/sycl_device_context.h",
]),
copts = tf_copts(),
- linkstatic = 1,
+ linkstatic = 0,
deps = [
":core_cpu",
":core_cpu_internal",
@@ -1862,7 +1861,7 @@ cc_library(
"//third_party/eigen3",
"@local_config_sycl//sycl:sycl",
],
- alwayslink = 1,
+ alwayslink = 0,
)
# -----------------------------------------------------------------------------
diff --git a/third_party/sycl/crosstool/computecpp.tpl b/third_party/sycl/crosstool/computecpp.tpl
index 94c5e6aaad..8b0a7a7d4a 100755
--- a/third_party/sycl/crosstool/computecpp.tpl
+++ b/third_party/sycl/crosstool/computecpp.tpl
@@ -15,7 +15,7 @@ COMPUTECPP_INCLUDE = COMPUTECPP_ROOT + 'include'
def main():
remove_flags = ('-Wl,--no-undefined', '-Wno-unused-but-set-variable', '-Wignored-attributes')
- # remove -fsamotoze-coverage from string with g++
+ # remove -fsanitize-coverage from string with g++
if 'g++' in CPU_CXX_COMPILER:
remove_flags += ('-fsanitize-coverage',)
compiler_flags = [flag for flag in sys.argv[1:] if not flag.startswith(remove_flags)]
@@ -43,7 +43,7 @@ def main():
# create a blacklist of folders that will be skipped when compiling with ComputeCpp
skip_extensions = [".cu.cc"]
- skip_folders = ["tensorflow/compiler", "tensorflow/docs_src", "tensorflow/tensorboard", "third_party", "external", "hexagon"]
+ skip_folders = ["tensorflow/compiler", "tensorflow/docs_src", "third_party", "external", "hexagon"]
skip_folders = [(folder + '/') for folder in skip_folders]
# if compiling external project skip computecpp
if any(compiled_file_name.endswith(_ext) for _ext in skip_extensions) or any(_folder in output_file_name for _folder in skip_folders):
@@ -79,7 +79,7 @@ def main():
'-Xclang', '-cl-denorms-are-zero', '-Xclang', '-cl-fp32-correctly-rounded-divide-sqrt']
# disable flags enabling SIMD instructions
computecpp_device_compiler_flags += [flag for flag in compiler_flags if \
- not any(x in flag.lower() for x in ('-fsanitize', '=native', '=core2', 'msse', 'vectorize', 'mavx', 'mmmx', 'm3dnow', 'fma'))]
+ not any(x in flag.lower() for x in ('-fsanitize', '-fno-canonical-system-headers', '=native', '=core2', 'msse', 'vectorize', 'mavx', 'mmmx', 'm3dnow', 'fma'))]
x = call([COMPUTECPP_DRIVER] + computecpp_device_compiler_flags)
if x == 0:
diff --git a/third_party/sycl/sycl/BUILD.tpl b/third_party/sycl/sycl/BUILD.tpl
index c66a9f007d..6cad190630 100755
--- a/third_party/sycl/sycl/BUILD.tpl
+++ b/third_party/sycl/sycl/BUILD.tpl
@@ -33,7 +33,7 @@ cc_library(
sycl_library_path("ComputeCpp")
],
includes = ["include/"],
- linkstatic = 1,
+ linkstatic = 0,
)
cc_library(