diff options
author | 2016-12-08 13:14:01 -0800 | |
---|---|---|
committer | 2016-12-08 13:29:40 -0800 | |
commit | 158f2a7272fd2fa679ea162cc2fb30383978e70d (patch) | |
tree | 85ab36a696275441e3cb62f3eddeb00dc7af6cdf | |
parent | 5b4c479a05782de156d4c24e579caec63444001a (diff) |
Add cuda_is_configured() build macro for testing whether CUDA was enabled at configure time.
Change: 141474932
-rw-r--r-- | third_party/gpus/cuda/build_defs.bzl.tpl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/third_party/gpus/cuda/build_defs.bzl.tpl b/third_party/gpus/cuda/build_defs.bzl.tpl index 62a16b6721..25d4b32157 100644 --- a/third_party/gpus/cuda/build_defs.bzl.tpl +++ b/third_party/gpus/cuda/build_defs.bzl.tpl @@ -15,12 +15,16 @@ def if_cuda(if_true, if_false = []): "//conditions:default": if_false }) +def cuda_is_configured(): + """Returns true if CUDA was enabled during the configure process.""" + return %{cuda_is_configured} + def if_cuda_is_configured(x): """Tests if the CUDA was enabled during the configure process. Unlike if_cuda(), this does not require that we are building with --config=cuda. Used to allow non-CUDA code to depend on CUDA libraries. """ - if %{cuda_is_configured}: + if cuda_is_configured(): return x return [] |