提交 9b5f6493 authored 作者: James Bergstra's avatar James Bergstra

Added FAST_RUN_NOGC mode.

上级 f784c7b5
...@@ -33,7 +33,8 @@ def check_equal(x, y): ...@@ -33,7 +33,8 @@ def check_equal(x, y):
predefined_linkers = { predefined_linkers = {
'py' : gof.PerformLinker(), 'py' : gof.PerformLinker(),
'c' : gof.CLinker(), 'c' : gof.CLinker(),
'c|py' : gof.OpWiseCLinker(), 'c|py' : gof.OpWiseCLinker(allow_gc=True),
'c|py_nogc' : gof.OpWiseCLinker(allow_gc=False),
'c&py' : gof.DualLinker(checker = check_equal) 'c&py' : gof.DualLinker(checker = check_equal)
} }
...@@ -148,10 +149,12 @@ class Mode(object): ...@@ -148,10 +149,12 @@ class Mode(object):
# string as the key # string as the key
FAST_COMPILE = Mode('py', 'fast_compile') FAST_COMPILE = Mode('py', 'fast_compile')
FAST_RUN = Mode('c|py', 'fast_run') FAST_RUN = Mode('c|py', 'fast_run')
FAST_RUN_NOGC = Mode("c|py_nogc", 'fast_run')
SANITY_CHECK = [Mode('c|py', None), SANITY_CHECK = [Mode('c|py', None),
Mode('c|py', 'fast_run')] Mode('c|py', 'fast_run')]
predefined_modes = {'FAST_COMPILE': FAST_COMPILE, predefined_modes = {'FAST_COMPILE': FAST_COMPILE,
'FAST_RUN': FAST_RUN, 'FAST_RUN': FAST_RUN,
'FAST_RUN_NOGC':FAST_RUN_NOGC,
'SANITY_CHECK': SANITY_CHECK} 'SANITY_CHECK': SANITY_CHECK}
......
...@@ -271,11 +271,12 @@ def streamline(env, thunks, order, post_thunk_old_storage = None, no_recycling = ...@@ -271,11 +271,12 @@ def streamline(env, thunks, order, post_thunk_old_storage = None, no_recycling =
raise_with_op(node) raise_with_op(node)
f = streamline_default_f f = streamline_default_f
elif nice_errors: elif nice_errors:
thunk_node_list = zip(thunks, order)
def streamline_nice_errors_f(): def streamline_nice_errors_f():
for x in no_recycling: for x in no_recycling:
x[0] = None x[0] = None
try: try:
for thunk, node in zip(thunks, order): for thunk, node in thunk_node_list:
thunk() thunk()
except: except:
raise_with_op(node) raise_with_op(node)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论