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

Make simplification optional, instead of deactivated

parent 850e0dc5
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,7 @@ class PerftoolOptionsArray(ImmutableRecord): ...@@ -63,6 +63,7 @@ class PerftoolOptionsArray(ImmutableRecord):
turn_off_diagonal_jacobian = PerftoolOption(default=False, helpstr="Do not use diagonal_jacobian transformation on the ufl tree and cast result of jacobianInverseTransposed into a FieldMatrix.") turn_off_diagonal_jacobian = PerftoolOption(default=False, helpstr="Do not use diagonal_jacobian transformation on the ufl tree and cast result of jacobianInverseTransposed into a FieldMatrix.")
architecture = PerftoolOption(default="haswell", helpstr="The architecture to optimize for. Possible values: haswell|knl") architecture = PerftoolOption(default="haswell", helpstr="The architecture to optimize for. Possible values: haswell|knl")
grid_offset = PerftoolOption(default=False, helpstr="Set to true if you want a yasp grid where the lower left corner is not in the origin.") grid_offset = PerftoolOption(default=False, helpstr="Set to true if you want a yasp grid where the lower left corner is not in the origin.")
simplify = PerftoolOption(default=True, helpstr="Whether to simplify expressions using sympy")
# Arguments that are mainly to be set by logic depending on other options # Arguments that are mainly to be set by logic depending on other options
max_vector_width = PerftoolOption(default=256, helpstr=None) max_vector_width = PerftoolOption(default=256, helpstr=None)
......
...@@ -61,8 +61,9 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker): ...@@ -61,8 +61,9 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker):
self.current_info = info self.current_info = info
expr = self._call(o, False) expr = self._call(o, False)
if expr != 0: if expr != 0:
# from dune.perftool.sympy import simplify_pymbolic_expression if get_option("simplify"):
# expr = simplify_pymbolic_expression(expr) from dune.perftool.sympy import simplify_pymbolic_expression
expr = simplify_pymbolic_expression(expr)
self.interface.generate_accumulation_instruction(expr, self) self.interface.generate_accumulation_instruction(expr, self)
def _call(self, o, do_predicates): def _call(self, o, do_predicates):
......
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