Author: Antonio Cuni <[email protected]>
Branch:
Changeset: r66675:f096cc2ad291
Date: 2013-08-30 18:08 +0200
http://bitbucket.org/pypy/pypy/changeset/f096cc2ad291/
Log: (antocuni, mjacob): remove identity from the greenargs of
compute_reduce: this is the same fix as in r891ccccca71d
diff --git a/pypy/module/micronumpy/loop.py b/pypy/module/micronumpy/loop.py
--- a/pypy/module/micronumpy/loop.py
+++ b/pypy/module/micronumpy/loop.py
@@ -132,7 +132,7 @@
reduce_driver = jit.JitDriver(name='numpy_reduce',
greens = ['shapelen', 'func', 'done_func',
- 'calc_dtype', 'identity'],
+ 'calc_dtype'],
reds = 'auto')
def compute_reduce(obj, calc_dtype, func, done_func, identity):
@@ -146,7 +146,7 @@
while not obj_iter.done():
reduce_driver.jit_merge_point(shapelen=shapelen, func=func,
done_func=done_func,
- calc_dtype=calc_dtype, identity=identity,
+ calc_dtype=calc_dtype,
)
rval = obj_iter.getitem().convert_to(calc_dtype)
if done_func is not None and done_func(calc_dtype, rval):
diff --git a/pypy/module/micronumpy/test/test_zjit.py
b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -56,7 +56,7 @@
elif isinstance(w_res, interp_boxes.W_BoolBox):
return float(w_res.value)
raise TypeError(w_res)
-
+
if self.graph is None:
interp, graph = self.meta_interp(f, [0],
listops=True,
@@ -139,11 +139,17 @@
'int_add': 3,
})
+ def define_reduce():
+ return """
+ a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ sum(a)
+ """
+
def test_reduce_compile_only_once(self):
self.compile_graph()
reset_stats()
pyjitpl._warmrunnerdesc.memory_manager.alive_loops.clear()
- i = self.code_mapping['sum']
+ i = self.code_mapping['reduce']
# run it twice
retval = self.interp.eval_graph(self.graph, [i])
retval = self.interp.eval_graph(self.graph, [i])
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit