Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
attach metadata to the form kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikcfd committed Sep 22, 2024
1 parent 9f42f95 commit 741412c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tsfc/loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ def generate(impero_c, args, scalar_type, kernel_name="loopy_kernel", index_name

# Create loopy kernel
knl = lp.make_function(domains, instructions, data, name=kernel_name, target=target,
seq_dependencies=True, silenced_warnings=["summing_if_branches_ops"],
seq_dependencies=True,
silenced_warnings=["summing_if_branches_ops",
"v1_scheduler_fallback"],
lang_version=(2018, 2), preambles=preamble)

# Prevent loopy interchange by loopy
Expand Down Expand Up @@ -302,14 +304,14 @@ def statement_for(tree, ctx):

@statement.register(imp.Initialise)
def statement_initialise(leaf, ctx):
return [lp.Assignment(expression(leaf.indexsum, ctx), 0.0, within_inames=ctx.active_inames())]
return [lp.Assignment(expression(leaf.indexsum, ctx), 0.0, within_inames=ctx.active_inames(), tags=frozenset(["evaluate"]))]


@statement.register(imp.Accumulate)
def statement_accumulate(leaf, ctx):
lhs = expression(leaf.indexsum, ctx)
rhs = lhs + expression(leaf.indexsum.children[0], ctx)
return [lp.Assignment(lhs, rhs, within_inames=ctx.active_inames())]
return [lp.Assignment(lhs, rhs, within_inames=ctx.active_inames(), tags=frozenset(["evaluate"]))]


@statement.register(imp.Return)
Expand All @@ -325,7 +327,7 @@ def statement_return(leaf, ctx):
def statement_returnaccumulate(leaf, ctx):
lhs = expression(leaf.variable, ctx)
rhs = lhs + expression(leaf.indexsum.children[0], ctx)
return [lp.Assignment(lhs, rhs, within_inames=ctx.active_inames())]
return [lp.Assignment(lhs, rhs, within_inames=ctx.active_inames(), tags=frozenset(["quadrature"]))]


@statement.register(imp.Evaluate)
Expand Down Expand Up @@ -370,7 +372,7 @@ def statement_evaluate(leaf, ctx):

return [lp.CallInstruction(lhs, rhs, within_inames=ctx.active_inames())]
else:
return [lp.Assignment(ctx.pymbolic_variable(expr), expression(expr, ctx, top=True), within_inames=ctx.active_inames())]
return [lp.Assignment(ctx.pymbolic_variable(expr), expression(expr, ctx, top=True), within_inames=ctx.active_inames(), tags=frozenset(["evaluate"]))]


def expression(expr, ctx, top=False):
Expand Down

0 comments on commit 741412c

Please sign in to comment.