aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/sycl/crosstool
diff options
context:
space:
mode:
authorGravatar Yifei Feng <yifeif@google.com>2017-11-22 00:39:22 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-11-22 00:42:30 -0800
commite70c00950d295c519fd9c7f8b12e13a3c5aaf710 (patch)
treeee1210f8810e0b0fec9346f762e854b371899919 /third_party/sycl/crosstool
parentad7eeec1cc06d7fdba6ee404f03a35fab9cd3e6a (diff)
Automated g4 rollback of changelist 176615107
PiperOrigin-RevId: 176622438
Diffstat (limited to 'third_party/sycl/crosstool')
-rwxr-xr-xthird_party/sycl/crosstool/CROSSTOOL.tpl8
-rw-r--r--third_party/sycl/crosstool/trisycl.tpl73
2 files changed, 4 insertions, 77 deletions
diff --git a/third_party/sycl/crosstool/CROSSTOOL.tpl b/third_party/sycl/crosstool/CROSSTOOL.tpl
index f8e50efcc6..32884d71e7 100755
--- a/third_party/sycl/crosstool/CROSSTOOL.tpl
+++ b/third_party/sycl/crosstool/CROSSTOOL.tpl
@@ -35,10 +35,10 @@ toolchain {
tool_path { name: "compat-ld" path: "/usr/bin/ld" }
tool_path { name: "cpp" path: "/usr/bin/cpp" }
tool_path { name: "dwp" path: "/usr/bin/dwp" }
- tool_path { name: "gcc" path: "%{sycl_impl}" }
+ tool_path { name: "gcc" path: "computecpp" }
# Use "-std=c++11" for nvcc. For consistency, force both the host compiler
# and the device compiler to use "-std=c++11".
- cxx_flag: "%{c++_std}"
+ cxx_flag: "-std=c++11"
linker_flag: "-Wl,-no-as-needed"
linker_flag: "-lstdc++"
linker_flag: "-B/usr/bin/"
@@ -53,7 +53,7 @@ toolchain {
cxx_builtin_include_directory: "/usr/local/include"
cxx_builtin_include_directory: "/usr/include"
- cxx_builtin_include_directory: "%{sycl_include_dir}"
+ cxx_builtin_include_directory: "%{computecpp_toolkit_path}"
cxx_builtin_include_directory: "%{python_lib_path}"
tool_path { name: "gcov" path: "/usr/bin/gcov" }
@@ -214,4 +214,4 @@ toolchain {
compiler_flag: "-O2"
compiler_flag: "-DNDEBUG"
}
-} \ No newline at end of file
+}
diff --git a/third_party/sycl/crosstool/trisycl.tpl b/third_party/sycl/crosstool/trisycl.tpl
deleted file mode 100644
index b470772fbf..0000000000
--- a/third_party/sycl/crosstool/trisycl.tpl
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import sys
-import tempfile
-from subprocess import call
-
-CPU_CXX_COMPILER = ('%{host_cxx_compiler}')
-CPU_C_COMPILER = ('%{host_c_compiler}')
-
-CURRENT_DIR = os.path.dirname(sys.argv[0])
-TRISYCL_INCLUDE_DIR = CURRENT_DIR + '/../sycl/include'
-
-def main():
- compiler_flags = []
-
- remove_flags = ('-Wl,--no-undefined', '-Wno-unused-but-set-variable', '-Wignored-attributes', '-fno-exceptions')
- # remove -fsamotoze-coverage from string with g++
- if 'g++' in CPU_CXX_COMPILER:
- remove_flags += ('-fsanitize-coverage',)
- compiler_flags += ['-fopenmp']
- else:
- compiler_flags += ['-fopenmp=libomp']
-
- compiler_flags += [flag for flag in sys.argv[1:] if not flag.startswith(remove_flags)]
-
-
- output_file_index = compiler_flags.index('-o') + 1
- output_file_name = compiler_flags[output_file_index]
-
- if(output_file_index == 1):
- # we are linking
- return call([CPU_CXX_COMPILER] + compiler_flags +
- ['-Wl,--no-undefined'])
-
- # find what we compile
- compiling_cpp = 0
- if('-c' in compiler_flags):
- compiled_file_index = compiler_flags.index('-c') + 1
- compiled_file_name = compiler_flags[compiled_file_index]
- if(compiled_file_name.endswith(('.cc', '.c++', '.cpp', '.CPP',
- '.C', '.cxx'))):
- compiling_cpp = 1;
-
- debug_flags = ['-DTRISYCL_DEBUG', '-DBOOST_LOG_DYN_LINK', '-DTRISYCL_TRACE_KERNEL', '-lpthread', '-lboost_log', '-g', '-rdynamic']
-
- opt_flags = ['-DNDEBUG', '-DBOOST_DISABLE_ASSERTS', '-O3']
-
- compiler_flags = compiler_flags + ['-DEIGEN_USE_SYCL=1',
- '-DEIGEN_HAS_C99_MATH',
- '-DEIGEN_MAX_ALIGN_BYTES=16',
- '-DTENSORFLOW_USE_SYCL'] + opt_flags
-
- if(compiling_cpp == 1):
- # create a blacklist of folders that will be skipped when compiling
- # with triSYCL
- skip_extensions = [".cu.cc"]
- skip_folders = ["tensorflow/compiler", "tensorflow/docs_src", "tensorflow/tensorboard", "third_party", "external", "hexagon"]
- skip_folders = [(folder + '/') for folder in skip_folders]
- # if compiling external project skip triSYCL
- if any(compiled_file_name.endswith(_ext) for _ext in skip_extensions) or any(_folder in output_file_name for _folder in skip_folders):
- return call([CPU_CXX_COMPILER] + compiler_flags)
-
- host_compiler_flags = ['-xc++', '-Wno-unused-variable',
- '-I', TRISYCL_INCLUDE_DIR] + compiler_flags
- x = call([CPU_CXX_COMPILER] + host_compiler_flags)
- return x
- else:
- # compile for C
- return call([CPU_C_COMPILER] + compiler_flags)
-
-if __name__ == '__main__':
- sys.exit(main())