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

Fix dependencies of contrib instructions

parent df0d2bef
No related branches found
No related tags found
No related merge requests found
...@@ -195,6 +195,12 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id): ...@@ -195,6 +195,12 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
replace_dict[Variable(iname)] = i replace_dict[Variable(iname)] = i
expression = substitute(pymbolic_expr, replace_dict) expression = substitute(pymbolic_expr, replace_dict)
# Determine dependencies
from loopy.match import Or, Writes
from pymbolic.mapper.dependency import DependencyMapper
from dune.perftool.tools import get_pymbolic_basename
deps = Or(tuple(Writes(get_pymbolic_basename(expr)) for expr in DependencyMapper()(expression)))
# Issue an instruction in the quadrature loop that fills the buffer # Issue an instruction in the quadrature loop that fills the buffer
# with the evaluation of the contribution at all quadrature points # with the evaluation of the contribution at all quadrature points
assignee = Subscript(Variable(temp), tuple(Variable(i) for i in quadrature_inames())) assignee = Subscript(Variable(temp), tuple(Variable(i) for i in quadrature_inames()))
...@@ -203,6 +209,7 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id): ...@@ -203,6 +209,7 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
forced_iname_deps=frozenset(quadrature_inames() + visitor.inames), forced_iname_deps=frozenset(quadrature_inames() + visitor.inames),
forced_iname_deps_is_final=True, forced_iname_deps_is_final=True,
tags=frozenset({"quadvec"}), tags=frozenset({"quadvec"}),
depends_on=frozenset({deps})
) )
contribution_ids.append(contrib_dep) contribution_ids.append(contrib_dep)
......
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