Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build_deps/gpu/cuda/BUILD.tpl
Original file line number Diff line number Diff line change
@@ -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"])
Expand Down Expand Up @@ -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",
Expand Down
29 changes: 29 additions & 0 deletions build_deps/gpu/cuda/build_defs.bzl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 1 addition & 1 deletion build_deps/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tf-nightly-2.0-preview
tf-nightly-2.0-preview==2.0.0.dev20190731
2 changes: 1 addition & 1 deletion build_deps/requirements_gpu.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tf-nightly-gpu-2.0-preview
tf-nightly-gpu-2.0-preview==2.0.0.dev20190731