From 513fb07fc5d70367b40d5c086e0bf730a3e542a3 Mon Sep 17 00:00:00 2001 From: Nicholas Christensen <11543181+nchristensen@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:28:01 -0600 Subject: [PATCH] Handle type casting in op counter (#902) * Handle type casting in op counter * Recurse in map_type_cast --- loopy/statistics.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loopy/statistics.py b/loopy/statistics.py index e0987f9e..04ec9a52 100755 --- a/loopy/statistics.py +++ b/loopy/statistics.py @@ -1003,6 +1003,10 @@ class ExpressionOpCounter(CounterBase): + self.rec(expr.base) \ + self.rec(expr.exponent) + def map_type_cast(self, expr): + # Treats type casting as free + return self.rec(expr.child) + def map_left_shift(self, expr): return self.new_poly_map({Op(dtype=self.type_inf(expr), name="shift", -- GitLab