Add cuda-clang configuration.
PiperOrigin-RevId: 277523803 Change-Id: If10e88ffd7ee5594cb871990d73ef90b1b4c590e
This commit is contained in:
parent
aff087ab42
commit
0bf19b639d
@ -237,6 +237,8 @@ tensorflow/third_party/toolchains/preconfig/ubuntu14.04/tensorrt5/build_defs.bzl
|
||||
tensorflow/third_party/toolchains/preconfig/ubuntu16.04/clang/BUILD
|
||||
tensorflow/third_party/toolchains/preconfig/ubuntu16.04/clang/cc_toolchain_config.bzl
|
||||
tensorflow/third_party/toolchains/preconfig/ubuntu16.04/clang/dummy_toolchain.bzl
|
||||
tensorflow/third_party/toolchains/preconfig/ubuntu16.04/clang_manylinux2010-cuda10.0/BUILD
|
||||
tensorflow/third_party/toolchains/preconfig/ubuntu16.04/clang_manylinux2010-cuda10.0/cc_toolchain_config.bzl
|
||||
tensorflow/third_party/toolchains/preconfig/ubuntu16.04/cuda10.0-cudnn7/cuda/BUILD
|
||||
tensorflow/third_party/toolchains/preconfig/ubuntu16.04/cuda10.0-cudnn7/cuda/build_defs.bzl
|
||||
tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc5-rocm/BUILD
|
||||
|
165
third_party/toolchains/preconfig/ubuntu16.04/clang_manylinux2010-cuda10.0/BUILD
vendored
Executable file
165
third_party/toolchains/preconfig/ubuntu16.04/clang_manylinux2010-cuda10.0/BUILD
vendored
Executable file
@ -0,0 +1,165 @@
|
||||
# This file is expanded from a template by cuda_configure.bzl
|
||||
# Update cuda_configure.bzl#verify_build_defines when adding new variables.
|
||||
|
||||
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
|
||||
|
||||
licenses(["restricted"])
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
toolchain(
|
||||
name = "toolchain-linux-x86_64",
|
||||
exec_compatible_with = [
|
||||
"@bazel_tools//platforms:linux",
|
||||
"@bazel_tools//platforms:x86_64",
|
||||
],
|
||||
target_compatible_with = [
|
||||
"@bazel_tools//platforms:linux",
|
||||
"@bazel_tools//platforms:x86_64",
|
||||
],
|
||||
toolchain = ":cc-compiler-local",
|
||||
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
|
||||
)
|
||||
|
||||
cc_toolchain_suite(
|
||||
name = "toolchain",
|
||||
toolchains = {
|
||||
"local|compiler": ":cc-compiler-local",
|
||||
"darwin|compiler": ":cc-compiler-darwin",
|
||||
"x64_windows|msvc-cl": ":cc-compiler-windows",
|
||||
"x64_windows": ":cc-compiler-windows",
|
||||
"arm": ":cc-compiler-local",
|
||||
"aarch64": ":cc-compiler-local",
|
||||
"k8": ":cc-compiler-local",
|
||||
"piii": ":cc-compiler-local",
|
||||
"ppc": ":cc-compiler-local",
|
||||
"darwin": ":cc-compiler-darwin",
|
||||
},
|
||||
)
|
||||
|
||||
cc_toolchain(
|
||||
name = "cc-compiler-local",
|
||||
all_files = ":empty",
|
||||
compiler_files = ":empty",
|
||||
dwp_files = ":empty",
|
||||
linker_files = ":empty",
|
||||
objcopy_files = ":empty",
|
||||
strip_files = ":empty",
|
||||
# To support linker flags that need to go to the start of command line
|
||||
# we need the toolchain to support parameter files. Parameter files are
|
||||
# last on the command line and contain all shared libraries to link, so all
|
||||
# regular options will be left of them.
|
||||
supports_param_files = 1,
|
||||
toolchain_config = ":cc-compiler-local-config",
|
||||
toolchain_identifier = "local_linux",
|
||||
)
|
||||
|
||||
cc_toolchain_config(
|
||||
name = "cc-compiler-local-config",
|
||||
builtin_include_directories = [
|
||||
"/dt7/usr/include/c++/7",
|
||||
"/dt7/usr/include/c++/7/x86_64-pc-linux-gnu",
|
||||
"/dt7/usr/include/c++/7/backward",
|
||||
"/clang_r373795/lib/clang/10.0.0/include",
|
||||
"/dt7/usr/include/x86_64-linux-gnu",
|
||||
"/dt7/usr/include",
|
||||
],
|
||||
builtin_sysroot = "/dt7",
|
||||
cpu = "local",
|
||||
cuda_path = "/usr/local/cuda-10.0",
|
||||
extra_no_canonical_prefixes_flags = [],
|
||||
host_compiler_path = "/clang_r373795/bin/clang",
|
||||
host_compiler_prefix = "/usr/bin",
|
||||
host_compiler_warnings = [
|
||||
# Some parts of the codebase set -Werror and hit this warning, so
|
||||
# switch it off for now.
|
||||
"-Wno-invalid-partial-specialization",
|
||||
],
|
||||
host_unfiltered_compile_flags = [],
|
||||
linker_bin_path = "/usr/bin",
|
||||
)
|
||||
|
||||
cc_toolchain(
|
||||
name = "cc-compiler-darwin",
|
||||
all_files = ":empty",
|
||||
compiler_files = ":empty",
|
||||
dwp_files = ":empty",
|
||||
linker_files = ":empty",
|
||||
objcopy_files = ":empty",
|
||||
strip_files = ":empty",
|
||||
supports_param_files = 0,
|
||||
toolchain_config = ":cc-compiler-local-darwin",
|
||||
toolchain_identifier = "local_darwin",
|
||||
)
|
||||
|
||||
cc_toolchain_config(
|
||||
name = "cc-compiler-local-darwin",
|
||||
builtin_include_directories = [
|
||||
"/dt7/usr/include/c++/7",
|
||||
"/dt7/usr/include/c++/7/x86_64-pc-linux-gnu",
|
||||
"/dt7/usr/include/c++/7/backward",
|
||||
"/clang_r373795/lib/clang/10.0.0/include",
|
||||
"/dt7/usr/include/x86_64-linux-gnu",
|
||||
"/dt7/usr/include",
|
||||
],
|
||||
cpu = "darwin",
|
||||
extra_no_canonical_prefixes_flags = [],
|
||||
host_compiler_path = "/clang_r373795/bin/clang",
|
||||
host_compiler_prefix = "/usr/bin",
|
||||
host_compiler_warnings = [
|
||||
# Some parts of the codebase set -Werror and hit this warning, so
|
||||
# switch it off for now.
|
||||
"-Wno-invalid-partial-specialization",
|
||||
],
|
||||
host_unfiltered_compile_flags = [],
|
||||
linker_bin_path = "/usr/bin",
|
||||
)
|
||||
|
||||
cc_toolchain(
|
||||
name = "cc-compiler-windows",
|
||||
all_files = ":empty",
|
||||
compiler_files = ":empty",
|
||||
dwp_files = ":empty",
|
||||
linker_files = ":empty",
|
||||
objcopy_files = ":empty",
|
||||
strip_files = ":empty",
|
||||
supports_param_files = 1,
|
||||
toolchain_config = ":cc-compiler-windows-config",
|
||||
toolchain_identifier = "local_windows",
|
||||
)
|
||||
|
||||
cc_toolchain_config(
|
||||
name = "cc-compiler-windows-config",
|
||||
builtin_include_directories = [
|
||||
"/dt7/usr/include/c++/7",
|
||||
"/dt7/usr/include/c++/7/x86_64-pc-linux-gnu",
|
||||
"/dt7/usr/include/c++/7/backward",
|
||||
"/clang_r373795/lib/clang/10.0.0/include",
|
||||
"/dt7/usr/include/x86_64-linux-gnu",
|
||||
"/dt7/usr/include",
|
||||
],
|
||||
cpu = "x64_windows",
|
||||
msvc_cl_path = "msvc_not_used",
|
||||
msvc_env_include = "msvc_not_used",
|
||||
msvc_env_lib = "msvc_not_used",
|
||||
msvc_env_path = "msvc_not_used",
|
||||
msvc_env_tmp = "msvc_not_used",
|
||||
msvc_lib_path = "msvc_not_used",
|
||||
msvc_link_path = "msvc_not_used",
|
||||
msvc_ml_path = "msvc_not_used",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "empty",
|
||||
srcs = [],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "crosstool_wrapper_driver_is_not_gcc",
|
||||
srcs = ["clang/bin/crosstool_wrapper_driver_is_not_gcc"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "windows_msvc_wrapper_files",
|
||||
srcs = glob(["windows/msvc_*"]),
|
||||
)
|
1516
third_party/toolchains/preconfig/ubuntu16.04/clang_manylinux2010-cuda10.0/cc_toolchain_config.bzl
vendored
Executable file
1516
third_party/toolchains/preconfig/ubuntu16.04/clang_manylinux2010-cuda10.0/cc_toolchain_config.bzl
vendored
Executable file
File diff suppressed because it is too large
Load Diff
@ -12,9 +12,21 @@ def if_cuda(if_true, if_false = []):
|
||||
"//conditions:default": if_false,
|
||||
})
|
||||
|
||||
def if_cuda_clang(if_true, if_false = []):
|
||||
"""Shorthand for select()'ing on wheteher we're building with cuda-clang.
|
||||
|
||||
Returns a select statement which evaluates to if_true if we're building
|
||||
with cuda-clang. Otherwise, the select statement evaluates to if_false.
|
||||
|
||||
"""
|
||||
return select({
|
||||
"@local_config_cuda//cuda:using_clang": if_true,
|
||||
"//conditions:default": if_false,
|
||||
})
|
||||
|
||||
def cuda_default_copts():
|
||||
"""Default options for all CUDA compilations."""
|
||||
return if_cuda(["-x", "cuda", "-DGOOGLE_CUDA=1"] + [])
|
||||
return if_cuda(["-x", "cuda", "-DGOOGLE_CUDA=1"]) + if_cuda_clang(["--cuda-gpu-arch=sm_30", "--cuda-gpu-arch=sm_60"])
|
||||
|
||||
def cuda_is_configured():
|
||||
"""Returns true if CUDA was enabled during the configure process."""
|
||||
|
Loading…
Reference in New Issue
Block a user