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

Allow explicit control of the diagonal vectorization strategy

parent c9f510b5
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,9 @@ class PerftoolOptionsArray(ImmutableRecord): ...@@ -59,6 +59,9 @@ class PerftoolOptionsArray(ImmutableRecord):
vectorize_slice = PerftoolOption(default=False, helpstr="whether to generate code with explicit vectorization") vectorize_slice = PerftoolOption(default=False, helpstr="whether to generate code with explicit vectorization")
vectorize_diagonal = PerftoolOption(default=False, helpstr="whether to generate code with explicit vectorization") vectorize_diagonal = PerftoolOption(default=False, helpstr="whether to generate code with explicit vectorization")
vectorize_greedy = PerftoolOption(default=False, helpstr="the heuristic currently in use (to produce paper numbers)") vectorize_greedy = PerftoolOption(default=False, helpstr="the heuristic currently in use (to produce paper numbers)")
vectorize_horizontal = PerftoolOption(default=None, helpstr="an explicit value for horizontal vectorization")
vectorize_vertical = PerftoolOption(default=None, helpstr="an explicit value for vertical vectorization")
vectorize_padding = PerftoolOption(default=None, helpstr="an explicit value for padding in vectorization")
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.")
......
...@@ -124,12 +124,25 @@ def horizontal_vectorization_strategy(sumfacts, width, allow_padding=1): ...@@ -124,12 +124,25 @@ def horizontal_vectorization_strategy(sumfacts, width, allow_padding=1):
def diagonal_vectorization_strategy(sumfacts, width): def diagonal_vectorization_strategy(sumfacts, width):
# Read explicitly set values
horizontal = get_option("vectorize_horizontal")
vertical = get_option("vectorize_vertical")
padding = get_option("vectorize_padding")
if width == 4: if width == 4:
horizontal, vertical = 2, 2 if horizontal is None:
padding = 0 horizontal = 2
if vertical is None:
vertical = 2
if padding is None:
padding = 0
elif width == 8: elif width == 8:
horizontal, vertical = 4, 2 if horizontal is None:
padding = 1 horizontal = 4
if vertical is None:
vertical = 2
if padding is None:
padding = 1
else: else:
raise NotImplementedError raise NotImplementedError
......
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