Skip to content

Commit 3e4e3b6

Browse files
committed
compiler: Add Guards.as_map
1 parent ef3e166 commit 3e4e3b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

devito/ir/support/guards.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ def filter(self, key):
292292

293293
return Guards(m)
294294

295+
def as_map(self, d, cls):
296+
if cls not in (Le, Lt, Ge, Gt):
297+
raise ValueError(f"Unsupported class {cls}")
298+
299+
return dict(i.args for i in search(self.get(d), cls))
300+
295301

296302
class GuardExpr(LocalObject, BooleanFunction):
297303

0 commit comments

Comments
 (0)