Skip to content

Commit c0ffa29

Browse files
edopaostubbiali
authored andcommitted
fix[next][dace]: Missing symbolic args in lambda nested scope (GridTools#2094)
Some scalar arguments of a lambda nested SDFG were not represented as symbols, although used in domain symbolic expressions. The unittest `test_concat_where.py:test_lap_like` In the `concat_where` PR (GridTools#1713) was failing in lowering to SDFG because of this bug.
1 parent 0a29a2d commit c0ffa29

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/gt4py/next/program_processors/runners/dace/gtir_sdfg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,11 @@ def setup_nested_context(
381381
scope_symbols: dict[str, ts.DataType],
382382
) -> SDFGBuilder:
383383
nsdfg_builder = GTIRToSDFG(self.offset_provider_type, self.column_axis, scope_symbols)
384+
# We pass to the nested SDFG all symbols in scope, which includes the values
385+
# mapped to the parameters of the lambda expression (`node.params`) and
386+
# the symbols defined in the parent SDFG.
384387
params = [gtir.Sym(id=p_name, type=p_type) for p_name, p_type in scope_symbols.items()]
385-
symbolic_arguments = _collect_symbols_in_domain_expressions(node, node.params) | {
388+
symbolic_arguments = _collect_symbols_in_domain_expressions(node, params) | {
386389
# scalar values represented as dace symbols in parent SDFG are mapped
387390
# to dace symbols in the nested SDFG
388391
pname

0 commit comments

Comments
 (0)