diff --git a/loopy/statistics.py b/loopy/statistics.py index 5aa251dc9318bae6fe49b69642722ecc88d79887..c273edd54a364096ad74685d6c9a1549a3d4ef57 100755 --- a/loopy/statistics.py +++ b/loopy/statistics.py @@ -131,7 +131,7 @@ class ExpressionOpCounter(CombineMapper): def map_call(self, expr): return ToCountMap( - {(self.type_inf(expr), 'call'): 1} + {(self.type_inf(expr), 'func:'+str(expr.function)): 1} ) + self.rec(expr.parameters) # def map_call_with_kwargs(self, expr): # implemented in CombineMapper diff --git a/test/test_statistics.py b/test/test_statistics.py index 47663952018763de96163eb362114b17b922e331..2cf537f5ed9c039d09cb1d10066ec9294898d9b9 100644 --- a/test/test_statistics.py +++ b/test/test_statistics.py @@ -115,7 +115,7 @@ def test_op_counter_specialops(): [ """ c[i, j, k] = (2*a[i,j,k])%(2+b[i,j,k]/3.0) - e[i, k] = (1+g[i,k])**(1+h[i,k+1])+rsqrt(g[i,k]) + e[i, k] = (1+g[i,k])**(1+h[i,k+1])+rsqrt(g[i,k])*sin(g[i,k]) """ ], name="specialops", assumptions="n,m,l >= 1") @@ -133,11 +133,12 @@ def test_op_counter_specialops(): f64pow = poly[(np.dtype(np.float64), 'pow')].eval_with_dict(params) f64add = poly[(np.dtype(np.float64), 'add')].eval_with_dict(params) i32add = poly[(np.dtype(np.int32), 'add')].eval_with_dict(params) - f64call = poly[(np.dtype(np.float64), 'call')].eval_with_dict(params) + f64rsqrt = poly[(np.dtype(np.float64), 'func:rsqrt')].eval_with_dict(params) + f64sin = poly[(np.dtype(np.float64), 'func:sin')].eval_with_dict(params) assert f32div == 2*n*m*l assert f32mul == f32add == n*m*l assert f64add == 3*n*m - assert f64pow == i32add == f64call == n*m + assert f64pow == i32add == f64rsqrt == f64sin == n*m def test_op_counter_bitwise():