提交 158f2a72 编写于 作者: P Peter Hawkins 提交者: TensorFlower Gardener

Add cuda_is_configured() build macro for testing whether CUDA was enabled at configure time.

Change: 141474932
上级 5b4c479a
......@@ -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 []
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册