提交 e5d51daf authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #5480 from notoraptor/fix-old-backend-compilation

(small fix) Add new internal config flag `cuda.disable` to help disable compilation in old backend
......@@ -671,6 +671,14 @@ import theano and print the config variable, as in:
A directory with bin/, lib/, include/ folders containing cuda utilities.
.. attribute:: config.cuda.enabled
Bool value: either ``True`` of ``False``
Default: ``True``
If set to `False`, C code in old backend is not compiled.
.. attribute:: config.dnn.enabled
String value: ``'auto'``, ``'True'``, ``'False'``
......
......@@ -199,6 +199,12 @@ AddConfigVar(
StrParam(default_cuda_root),
in_c_key=False)
AddConfigVar(
'cuda.enabled',
'If false, C code in old backend is not compiled.',
BoolParam(True),
in_c_key=False)
def filter_nvcc_flags(s):
assert isinstance(s, str)
......
......@@ -27,6 +27,9 @@ def is_nvcc_available():
Return True iff the nvcc compiler is found.
"""
if not config.cuda.enabled:
return False
def set_version():
p_out = output_subprocess_Popen([nvcc_path, '--version'])
ver_line = decode(p_out[0]).strip().split('\n')[-1]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论