From cf5d974bc981ce57939881289e860de1699c2fba Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Tue, 18 Feb 2025 13:41:41 -0600 Subject: [PATCH] VectorizabilityChecker: allow ternaries --- loopy/expression.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/loopy/expression.py b/loopy/expression.py index 5873e8ea..5a11b835 100644 --- a/loopy/expression.py +++ b/loopy/expression.py @@ -189,6 +189,9 @@ class VectorizabilityChecker(Mapper[bool, []]): # FIXME: Do this more carefully raise UnvectorizableError() + def map_if(self, expr: p.If) -> bool: + return any(self.rec(child) for child in [expr.condition, expr.then, expr.else_]) + # }}} # vim: fdm=marker -- GitLab