Skip to content
Snippets Groups Projects
Commit 69b5f281 authored by René Heß's avatar René Heß
Browse files

[skip ci] Restructure conditionals

parent f1382d61
No related branches found
No related tags found
No related merge requests found
......@@ -247,23 +247,28 @@ def realize_sumfact_kernel_function(sf):
if sf.vectorized:
insn_args["forced_iname_deps"] = frozenset({vec_iname[0].name})
insn_dep = sf.interface.realize_direct(matprod, output_inames, out_shape, **insn_args)
else:
# Get a temporary that interprets the base storage of the output.
#
# Note: In this step the reordering of the fastest directions
# is happening. The new direction (out_inames[0]) and the
# corresponding shape (out_shape[0]) goes to the end (slowest
# direction) and everything stays column major (ftags->fortran
# style).
#
# If we are in the last step we reverse the permutation.
elif l == len(matrix_sequence) - 1:
output_shape = tuple(out_shape[1:]) + (out_shape[0],)
if l == len(matrix_sequence) - 1:
# TODO: Move permutations to interface
output_shape = permute_backward(output_shape, sf.cost_permutation)
if sf.stage == 3:
output_shape = permute_backward(output_shape, sf.interface.quadrature_permutation)
# TODO: Move permutations to interface
output_shape = permute_backward(output_shape, sf.cost_permutation)
if sf.stage == 3:
output_shape = permute_backward(output_shape, sf.interface.quadrature_permutation)
out = buffer.get_temporary("buff_step{}_out".format(l),
shape=output_shape + vec_shape,
dim_tags=ftags,
)
# Issue the reduction instruction that implements the multiplication
# at the same time store the instruction ID for the next instruction to depend on
insn_dep = frozenset({instruction(assignee=prim.Subscript(prim.Variable(out), output_inames + vec_iname),
expression=matprod,
**insn_args
)
})
else:
output_shape = tuple(out_shape[1:]) + (out_shape[0],)
out = buffer.get_temporary("buff_step{}_out".format(l),
shape=output_shape + vec_shape,
dim_tags=ftags,
......
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