diff --git a/tensorflow/opensource_only.files b/tensorflow/opensource_only.files index 850b5f5ca2e..9c4dd2f4b86 100644 --- a/tensorflow/opensource_only.files +++ b/tensorflow/opensource_only.files @@ -82,7 +82,6 @@ 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 @@ -90,7 +89,6 @@ 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 @@ -194,7 +192,6 @@ 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 diff --git a/third_party/gpus/crosstool/remote.BUILD.tpl b/third_party/gpus/crosstool/remote.BUILD.tpl deleted file mode 100644 index b2316331db2..00000000000 --- a/third_party/gpus/crosstool/remote.BUILD.tpl +++ /dev/null @@ -1,10 +0,0 @@ -# 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", -) diff --git a/third_party/gpus/cuda/remote.BUILD.tpl b/third_party/gpus/cuda/remote.BUILD.tpl deleted file mode 100644 index 100c7bb7c41..00000000000 --- a/third_party/gpus/cuda/remote.BUILD.tpl +++ /dev/null @@ -1,110 +0,0 @@ -# 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", -) diff --git a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl index 90020b66087..76f2f3a07b2 100644 --- a/third_party/gpus/cuda_configure.bzl +++ b/third_party/gpus/cuda_configure.bzl @@ -1508,17 +1508,21 @@ def _create_remote_cuda_repository(repository_ctx, remote_config_repo): ), }, ) - _tpl( - repository_ctx, - "cuda:remote.BUILD", - { - "%{remote_cuda_repo}": remote_config_repo, - }, + repository_ctx.template( "cuda/BUILD", + Label(remote_config_repo + "/cuda:BUILD"), + {}, + ) + repository_ctx.template( + "cuda/build_defs.bzl", + Label(remote_config_repo + "/cuda:build_defs.bzl"), + {}, + ) + repository_ctx.template( + "cuda/cuda/cuda_config.h", + Label(remote_config_repo + "/cuda:cuda/cuda_config.h"), + {}, ) - _tpl(repository_ctx, "crosstool:remote.BUILD", { - "%{remote_cuda_repo}": remote_config_repo, - }, "crosstool/BUILD") def _cuda_autoconf_impl(repository_ctx): diff --git a/third_party/tensorrt/build_defs.bzl.tpl b/third_party/tensorrt/build_defs.bzl.tpl index 0dc3a7ba2d2..6d00513827b 100644 --- a/third_party/tensorrt/build_defs.bzl.tpl +++ b/third_party/tensorrt/build_defs.bzl.tpl @@ -2,6 +2,4 @@ def if_tensorrt(if_true, if_false=[]): """Tests whether TensorRT was enabled during the configure process.""" - if %{tensorrt_is_configured}: - return if_true - return if_false + return %{if_tensorrt} diff --git a/third_party/tensorrt/remote.BUILD.tpl b/third_party/tensorrt/remote.BUILD.tpl deleted file mode 100644 index d5afc4a5c10..00000000000 --- a/third_party/tensorrt/remote.BUILD.tpl +++ /dev/null @@ -1,7 +0,0 @@ -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") diff --git a/third_party/tensorrt/tensorrt_configure.bzl b/third_party/tensorrt/tensorrt_configure.bzl index d3bc388346a..c6de25b33e3 100644 --- a/third_party/tensorrt/tensorrt_configure.bzl +++ b/third_party/tensorrt/tensorrt_configure.bzl @@ -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", {"%{tensorrt_is_configured}": "False"}) + _tpl(repository_ctx, "build_defs.bzl", {"%{if_tensorrt}": "if_false"}) _tpl(repository_ctx, "BUILD", { "%{tensorrt_genrules}": "", @@ -141,11 +141,13 @@ 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. - 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", {"%{tensorrt_is_configured}": "True"}) + remote_config_repo = repository_ctx.os.environ[_TF_TENSORRT_CONFIG_REPO] + repository_ctx.template("BUILD", Label(remote_config_repo + ":BUILD"), {}) + repository_ctx.template( + "build_defs.bzl", + Label(remote_config_repo + ":build_defs.bzl"), + {}, + ) return if _TENSORRT_INSTALL_PATH not in repository_ctx.os.environ: @@ -194,7 +196,7 @@ def _tensorrt_configure_impl(repository_ctx): )) # Set up config file. - _tpl(repository_ctx, "build_defs.bzl", {"%{tensorrt_is_configured}": "True"}) + _tpl(repository_ctx, "build_defs.bzl", {"%{if_tensorrt}": "if_true"}) # Set up BUILD file. _tpl(repository_ctx, "BUILD", {