diff options
author | Peter Hawkins <phawkins@google.com> | 2016-12-07 16:42:18 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-12-07 17:02:47 -0800 |
commit | 3e1124995ca297c9bd1da943e5da8f13609a8e15 (patch) | |
tree | cb4b8f552aafadafb56e060f9966a32d23836631 /tensorflow/stream_executor/BUILD | |
parent | 4878e06d1d6b999760ac77e074673f75c8c63e37 (diff) |
Separate the stream executor CUDA plugin into its own build target. This allows non --config=cuda builds to link the CUDA plugins if desired.
Add build macro if_cuda_is_configured() that tests whether CUDA was enabled at configure time, rather than whether the current BUILD is using a CUDA compiler.
Change: 141375030
Diffstat (limited to 'tensorflow/stream_executor/BUILD')
-rw-r--r-- | tensorflow/stream_executor/BUILD | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/tensorflow/stream_executor/BUILD b/tensorflow/stream_executor/BUILD index a84f9d5f9d..c315e3e9de 100644 --- a/tensorflow/stream_executor/BUILD +++ b/tensorflow/stream_executor/BUILD @@ -1,6 +1,6 @@ licenses(["restricted"]) -load("//tensorflow:tensorflow.bzl", "if_cuda") +load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda_is_configured") cc_library( name = "stream_executor", @@ -15,13 +15,6 @@ cc_library( exclude = [ "**/*_test.cc", ], - ) + if_cuda( - glob( - [ - "cuda/*.cc", - ], - exclude = ["cuda/cuda_platform_id.cc"], - ), ), hdrs = glob([ "*.h", @@ -31,6 +24,27 @@ cc_library( "lib/gtl/*.h", "platform/**/*.h", ]), + linkopts = [ + "-ldl", + ], + visibility = ["//visibility:public"], + deps = [ + "//tensorflow/core:lib", + "@local_config_cuda//cuda:cuda_headers", + ], + alwayslink = 1, +) + +cc_library( + name = "cuda_platform", + srcs = if_cuda_is_configured( + glob( + [ + "cuda/*.cc", + ], + exclude = ["cuda/cuda_platform_id.cc"], + ), + ), data = [ "//tensorflow/core:cuda", "@local_config_cuda//cuda:cublas", @@ -43,6 +57,7 @@ cc_library( ], visibility = ["//visibility:public"], deps = [ + ":stream_executor", "//tensorflow/core:lib", "@local_config_cuda//cuda:cuda_headers", ], |