parent
9132586162
commit
815d49bb58
@ -82,6 +82,7 @@ tensorflow/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_
|
||||
tensorflow/third_party/gpus/crosstool/CROSSTOOL.tpl
|
||||
tensorflow/third_party/gpus/crosstool/CROSSTOOL_hipcc.tpl
|
||||
tensorflow/third_party/gpus/crosstool/LICENSE
|
||||
tensorflow/third_party/gpus/crosstool/remote.BUILD.tpl
|
||||
tensorflow/third_party/gpus/crosstool/windows/msvc_wrapper_for_nvcc.py.tpl
|
||||
tensorflow/third_party/gpus/crosstool/BUILD.tpl
|
||||
tensorflow/third_party/gpus/crosstool/BUILD
|
||||
@ -89,6 +90,7 @@ tensorflow/third_party/gpus/cuda/LICENSE
|
||||
tensorflow/third_party/gpus/cuda/BUILD.tpl
|
||||
tensorflow/third_party/gpus/cuda/BUILD.windows.tpl
|
||||
tensorflow/third_party/gpus/cuda/cuda_config.h.tpl
|
||||
tensorflow/third_party/gpus/cuda/remote.BUILD.tpl
|
||||
tensorflow/third_party/gpus/cuda/BUILD
|
||||
tensorflow/third_party/gpus/cuda/build_defs.bzl.tpl
|
||||
tensorflow/third_party/gpus/rocm/rocm_config.h.tpl
|
||||
@ -192,6 +194,7 @@ tensorflow/third_party/tensorrt/BUILD
|
||||
tensorflow/third_party/tensorrt/build_defs.bzl.tpl
|
||||
tensorflow/third_party/tensorrt/BUILD.tpl
|
||||
tensorflow/third_party/tensorrt/tensorrt_configure.bzl
|
||||
tensorflow/third_party/tensorrt/remote.BUILD.tpl
|
||||
tensorflow/third_party/kafka/config.patch
|
||||
tensorflow/third_party/kafka/BUILD
|
||||
tensorflow/third_party/android/BUILD
|
||||
|
10
third_party/gpus/crosstool/remote.BUILD.tpl
vendored
Normal file
10
third_party/gpus/crosstool/remote.BUILD.tpl
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
# Description:
|
||||
# Template for crosstool Build file to use a pre-generated config.
|
||||
licenses(["restricted"])
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
alias(
|
||||
name = "toolchain",
|
||||
actual = "%{remote_cuda_repo}:toolchain",
|
||||
)
|
110
third_party/gpus/cuda/remote.BUILD.tpl
vendored
Normal file
110
third_party/gpus/cuda/remote.BUILD.tpl
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
# Description:
|
||||
# Template for cuda Build file to use a pre-generated config.
|
||||
licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
config_setting(
|
||||
name = "using_nvcc",
|
||||
values = {
|
||||
"define": "using_cuda_nvcc=true",
|
||||
},
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "using_clang",
|
||||
values = {
|
||||
"define": "using_cuda_clang=true",
|
||||
},
|
||||
)
|
||||
|
||||
# Equivalent to using_clang && -c opt.
|
||||
config_setting(
|
||||
name = "using_clang_opt",
|
||||
values = {
|
||||
"define": "using_cuda_clang=true",
|
||||
"compilation_mode": "opt",
|
||||
},
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "darwin",
|
||||
values = {"cpu": "darwin"},
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "freebsd",
|
||||
values = {"cpu": "freebsd"},
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cuda_headers",
|
||||
actual = "%{remote_cuda_repo}/cuda:cuda_headers",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cudart_static",
|
||||
actual = "%{remote_cuda_repo}/cuda:cudart_static",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cuda_driver",
|
||||
actual = "%{remote_cuda_repo}/cuda:cuda_driver",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cudart",
|
||||
actual = "%{remote_cuda_repo}/cuda:cudart",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cublas",
|
||||
actual = "%{remote_cuda_repo}/cuda:cublas",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cusolver",
|
||||
actual = "%{remote_cuda_repo}/cuda:cusolver",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cudnn",
|
||||
actual = "%{remote_cuda_repo}/cuda:cudnn",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cudnn_header",
|
||||
actual = "%{remote_cuda_repo}/cuda:cudnn_header",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cufft",
|
||||
actual = "%{remote_cuda_repo}/cuda:cufft",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "curand",
|
||||
actual = "%{remote_cuda_repo}/cuda:curand",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cuda",
|
||||
actual = "%{remote_cuda_repo}/cuda:cuda",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cupti_headers",
|
||||
actual = "%{remote_cuda_repo}/cuda:cupti_headers",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "cupti_dsos",
|
||||
actual = "%{remote_cuda_repo}/cuda:cupti_dsos",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "libdevice_root",
|
||||
actual = "%{remote_cuda_repo}/cuda:libdevice_root",
|
||||
)
|
17
third_party/gpus/cuda_configure.bzl
vendored
17
third_party/gpus/cuda_configure.bzl
vendored
@ -1508,16 +1508,17 @@ def _create_remote_cuda_repository(repository_ctx, remote_config_repo):
|
||||
),
|
||||
},
|
||||
)
|
||||
repository_ctx.template(
|
||||
_tpl(
|
||||
repository_ctx,
|
||||
"cuda:remote.BUILD",
|
||||
{
|
||||
"%{remote_cuda_repo}": remote_config_repo,
|
||||
},
|
||||
"cuda/BUILD",
|
||||
Label(remote_config_repo + "/cuda:BUILD"),
|
||||
{},
|
||||
)
|
||||
repository_ctx.template(
|
||||
"crosstool/BUILD",
|
||||
Label(remote_config_repo + "/crosstool:BUILD"),
|
||||
{},
|
||||
)
|
||||
_tpl(repository_ctx, "crosstool:remote.BUILD", {
|
||||
"%{remote_cuda_repo}": remote_config_repo,
|
||||
}, "crosstool/BUILD")
|
||||
|
||||
|
||||
def _cuda_autoconf_impl(repository_ctx):
|
||||
|
4
third_party/tensorrt/build_defs.bzl.tpl
vendored
4
third_party/tensorrt/build_defs.bzl.tpl
vendored
@ -2,4 +2,6 @@
|
||||
|
||||
def if_tensorrt(if_true, if_false=[]):
|
||||
"""Tests whether TensorRT was enabled during the configure process."""
|
||||
return %{if_tensorrt}
|
||||
if %{tensorrt_is_configured}:
|
||||
return if_true
|
||||
return if_false
|
||||
|
7
third_party/tensorrt/remote.BUILD.tpl
vendored
Normal file
7
third_party/tensorrt/remote.BUILD.tpl
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
licenses(["notice"]) # Apache 2.0
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
alias(name="LICENSE", actual = "%{target}:LICENSE")
|
||||
alias(name = "tensorrt_headers", actual = "%{target}:tensorrt_headers")
|
||||
alias(name = "tensorrt", actual = "%{target}:tensorrt")
|
11
third_party/tensorrt/tensorrt_configure.bzl
vendored
11
third_party/tensorrt/tensorrt_configure.bzl
vendored
@ -129,7 +129,7 @@ def _tpl(repository_ctx, tpl, substitutions):
|
||||
|
||||
def _create_dummy_repository(repository_ctx):
|
||||
"""Create a dummy TensorRT repository."""
|
||||
_tpl(repository_ctx, "build_defs.bzl", {"%{if_tensorrt}": "if_false"})
|
||||
_tpl(repository_ctx, "build_defs.bzl", {"%{tensorrt_is_configured}": "False"})
|
||||
|
||||
_tpl(repository_ctx, "BUILD", {
|
||||
"%{tensorrt_genrules}": "",
|
||||
@ -141,10 +141,11 @@ def _tensorrt_configure_impl(repository_ctx):
|
||||
"""Implementation of the tensorrt_configure repository rule."""
|
||||
if _TF_TENSORRT_CONFIG_REPO in repository_ctx.os.environ:
|
||||
# Forward to the pre-configured remote repository.
|
||||
remote_config_repo = repository_ctx.os.environ[_TF_TENSORRT_CONFIG_REPO]
|
||||
repository_ctx.template("BUILD", Label(remote_config_repo + ":BUILD"), {})
|
||||
repository_ctx.template("BUILD", Label("//third_party/tensorrt:remote.BUILD.tpl"), {
|
||||
"%{target}": repository_ctx.os.environ[_TF_TENSORRT_CONFIG_REPO],
|
||||
})
|
||||
# Set up config file.
|
||||
_tpl(repository_ctx, "build_defs.bzl", {"%{if_tensorrt}": "if_true"})
|
||||
_tpl(repository_ctx, "build_defs.bzl", {"%{tensorrt_is_configured}": "True"})
|
||||
return
|
||||
|
||||
if _TENSORRT_INSTALL_PATH not in repository_ctx.os.environ:
|
||||
@ -193,7 +194,7 @@ def _tensorrt_configure_impl(repository_ctx):
|
||||
))
|
||||
|
||||
# Set up config file.
|
||||
_tpl(repository_ctx, "build_defs.bzl", {"%{if_tensorrt}": "if_true"})
|
||||
_tpl(repository_ctx, "build_defs.bzl", {"%{tensorrt_is_configured}": "True"})
|
||||
|
||||
# Set up BUILD file.
|
||||
_tpl(repository_ctx, "BUILD", {
|
||||
|
Loading…
Reference in New Issue
Block a user