diff --git a/build_deps/gpu/cuda/BUILD.tpl b/build_deps/gpu/cuda/BUILD.tpl index 75cb39c1d5..1ac5643f10 100644 --- a/build_deps/gpu/cuda/BUILD.tpl +++ b/build_deps/gpu/cuda/BUILD.tpl @@ -1,3 +1,5 @@ +load(":build_defs.bzl", "cuda_header_library") + licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like package(default_visibility = ["//visibility:public"]) @@ -37,11 +39,12 @@ config_setting( visibility = ["//visibility:public"], ) -cc_library( +cuda_header_library( name = "cuda_headers", hdrs = [ %{cuda_headers} ], + include_prefix = "third_party/gpus", includes = [ ".", "cuda/include", diff --git a/build_deps/gpu/cuda/build_defs.bzl.tpl b/build_deps/gpu/cuda/build_defs.bzl.tpl index ca8bbc1ee2..a4f484fb50 100644 --- a/build_deps/gpu/cuda/build_defs.bzl.tpl +++ b/build_deps/gpu/cuda/build_defs.bzl.tpl @@ -31,3 +31,32 @@ def if_cuda_is_configured(x): if cuda_is_configured(): return x return [] + +def cuda_header_library( + name, + hdrs, + include_prefix = None, + strip_include_prefix = None, + deps = [], + **kwargs): + """Generates a cc_library containing both virtual and system include paths. + + Generates both a header-only target with virtual includes plus the full + target without virtual includes. This works around the fact that bazel can't + mix 'includes' and 'include_prefix' in the same target.""" + + native.cc_library( + name = name + "_virtual", + hdrs = hdrs, + include_prefix = include_prefix, + strip_include_prefix = strip_include_prefix, + deps = deps, + visibility = ["//visibility:private"], + ) + + native.cc_library( + name = name, + textual_hdrs = hdrs, + deps = deps + [":%s_virtual" % name], + **kwargs + ) diff --git a/build_deps/requirements.txt b/build_deps/requirements.txt index 5279e237b3..332a109199 100644 --- a/build_deps/requirements.txt +++ b/build_deps/requirements.txt @@ -1 +1 @@ -tf-nightly-2.0-preview +tf-nightly-2.0-preview==2.0.0.dev20190731 diff --git a/build_deps/requirements_gpu.txt b/build_deps/requirements_gpu.txt index f4114d87ba..24d74c5f53 100644 --- a/build_deps/requirements_gpu.txt +++ b/build_deps/requirements_gpu.txt @@ -1 +1 @@ -tf-nightly-gpu-2.0-preview +tf-nightly-gpu-2.0-preview==2.0.0.dev20190731