aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/gpus/cuda
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <nobody@tensorflow.org>2016-05-13 12:46:48 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-05-13 13:52:03 -0700
commit9c947222fb9e522b2788ad668e9ab99e9edaaa2a (patch)
tree9cb7063fa4de120c35ec68051810352973e68b2e /third_party/gpus/cuda
parent1d094c93bfde6f8df458f15527ea377e0b92e639 (diff)
Move if_cuda build macro into //third_party/gpus/cuda/build_defs.bzl,
and remove the cuda_crosstool_condition build condition. Now if_cuda is just using_nvcc || using_gcudacc. Change: 122291892
Diffstat (limited to 'third_party/gpus/cuda')
-rw-r--r--third_party/gpus/cuda/BUILD8
-rw-r--r--third_party/gpus/cuda/build_defs.bzl14
2 files changed, 15 insertions, 7 deletions
diff --git a/third_party/gpus/cuda/BUILD b/third_party/gpus/cuda/BUILD
index a130fade72..a0d1d6561b 100644
--- a/third_party/gpus/cuda/BUILD
+++ b/third_party/gpus/cuda/BUILD
@@ -1,6 +1,6 @@
licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like
-load("//tensorflow:tensorflow.bzl", "if_cuda")
+load("//third_party/gpus/cuda:build_defs.bzl", "if_cuda")
load("platform", "cuda_library_path")
load("platform", "cuda_static_library_path")
load("platform", "cudnn_library_path")
@@ -10,12 +10,6 @@ load("platform", "readlink_command")
package(default_visibility = ["//visibility:public"])
config_setting(
- name = "cuda_crosstool_condition",
- values = {"define": "using_cuda=true"},
- visibility = ["//visibility:public"],
-)
-
-config_setting(
name = "using_gcudacc",
values = {
"define": "using_cuda_gcudacc=true",
diff --git a/third_party/gpus/cuda/build_defs.bzl b/third_party/gpus/cuda/build_defs.bzl
new file mode 100644
index 0000000000..49b977e93e
--- /dev/null
+++ b/third_party/gpus/cuda/build_defs.bzl
@@ -0,0 +1,14 @@
+# Macros for building CUDA code.
+
+def if_cuda(if_true, if_false = []):
+ """Shorthand for select()'ing on whether we're building with CUDA.
+
+ Returns a select statement which evaluates to if_true if we're building
+ with CUDA enabled. Otherwise, the select statement evaluates to if_false.
+
+ """
+ return select({
+ "//third_party/gpus/cuda:using_nvcc": if_true,
+ "//third_party/gpus/cuda:using_gcudacc": if_true,
+ "//conditions:default": if_false
+ })