提交 9e002865 authored 作者: Frederic's avatar Frederic

Fix gh-2954. If DebugMode.check_py=False by no py code, revert to c code.

上级 598f03d8
...@@ -1753,6 +1753,12 @@ class _Linker(gof.link.LocalLinker): ...@@ -1753,6 +1753,12 @@ class _Linker(gof.link.LocalLinker):
else: else:
thunks_py.append(None) thunks_py.append(None)
if not self.maker.mode.check_c_code and thunks_py[-1] is None:
print("Op %s don't have a perform, forcing check of the c code" % node.op)
thunk = node.op.make_c_thunk(node, storage_map, compute_map,
no_recycling)
thunks_c[-1] = thunk
# If the op defined its own make_thunk, use the generated thunk # If the op defined its own make_thunk, use the generated thunk
if thunk_other is not None: if thunk_other is not None:
if thunks_py[-1] is None: if thunks_py[-1] is None:
...@@ -2090,6 +2096,12 @@ class _Linker(gof.link.LocalLinker): ...@@ -2090,6 +2096,12 @@ class _Linker(gof.link.LocalLinker):
for r in node.inputs: for r in node.inputs:
storage_map[r][0] = None storage_map[r][0] = None
_logger.debug("%i - done with node", i) _logger.debug("%i - done with node", i)
for r in node.outputs:
if r not in r_vals:
idx = order.index(node)
assert thunks_py[idx] is None
assert thunks_c[idx] is None
raise Exception("No code run for %s" % node)
if False: if False:
# This could be useful to help finding refcount problem. # This could be useful to help finding refcount problem.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论