diff --git a/loopy/statistics.py b/loopy/statistics.py index 9ef292f63c12ef06f553738752d9ea894b14eb0c..36acbc0bf64cc4eab38512381e8678db8931c276 100755 --- a/loopy/statistics.py +++ b/loopy/statistics.py @@ -115,7 +115,9 @@ class ExpressionOpCounter(CombineMapper): # return 0,0 def map_call(self, expr): - return self.rec(expr.parameters) + return ToCountMap( + {(self.type_inf(expr), 'call'): 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 0fc4fd218ee2d0f8293e36548a1bb741107ff702..a11822f43431fa847b20773d8bc95f9efc9df10e 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]) + e[i, k] = (1+g[i,k])**(1+h[i,k+1])+rsqrt(g[i,k]) """ ], name="specialops", assumptions="n,m,l >= 1") @@ -133,10 +133,11 @@ 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) assert f32div == 2*n*m*l assert f32mul == f32add == n*m*l - assert f64add == 2*n*m - assert f64pow == i32add == n*m + assert f64add == 3*n*m + assert f64pow == i32add == f64call == n*m def test_op_counter_bitwise():