提交 351b4edf authored 作者: nouiz's avatar nouiz

Merge pull request #1140 from lamblin/fix_no_openmp

Fix tests when OpenMP is not available
......@@ -769,6 +769,7 @@ class OpenMPOp(Op):
@staticmethod
def test_gxx_support():
default_openmp = True
try:
code = """
#include <omp.h>
......@@ -804,10 +805,9 @@ class OpenMPOp(Op):
os.remove(path)
except OSError, e:
return False
return True
return default_openmp
def make_thunk(self, node, storage_map, compute_map, no_recycling):
op = self
if self.openmp:
if OpenMPOp.gxx_support_openmp is None:
OpenMPOp.gxx_support_openmp = OpenMPOp.test_gxx_support()
......@@ -820,8 +820,7 @@ class OpenMPOp(Op):
" To remove this warning set the theano flags `openmp`"
" to False.")
if OpenMPOp.gxx_support_openmp is False:
op = copy.copy(self)
op.openmp = False
self.openmp = False
theano.config.openmp = False
return super(OpenMPOp, op).make_thunk(node, storage_map,
compute_map, no_recycling)
return super(OpenMPOp, self).make_thunk(node, storage_map,
compute_map, no_recycling)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论