Skip to content
Snippets Groups Projects
Commit c66d8970 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Automatically optimize quotients in pymbolic

parent e42c8239
No related branches found
No related tags found
No related merge requests found
......@@ -256,8 +256,7 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker):
#
def product(self, o):
from pymbolic import flattened_product
return flattened_product(tuple(self.call(op) for op in o.ufl_operands))
return prim.flattened_product(tuple(self.call(op) for op in o.ufl_operands))
def float_value(self, o):
return o.value()
......@@ -266,11 +265,10 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker):
return o.value()
def division(self, o):
return Quotient(self.call(o.ufl_operands[0]), self.call(o.ufl_operands[1]))
return prim.quotient(self.call(o.ufl_operands[0]), self.call(o.ufl_operands[1]))
def sum(self, o):
from pymbolic import flattened_sum
return flattened_sum(tuple(self.call(op) for op in o.ufl_operands))
return prim.flattened_sum(tuple(self.call(op) for op in o.ufl_operands))
def zero(self, o):
# UFL has Zeroes with shape. We ignore those indices.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment