Description
DaCe backends are currently missing support for casting in VariableKOffset. The issue comes from the fact that we "sympify" index computations in the _visit_offsets() function of tasklet_codegen.
|
sym_offsets = [ |
|
dace.symbolic.pystr_to_symbolic(self.visit(off, **kwargs)) |
|
for off in (node.to_dict()["i"], node.to_dict()["j"], node.k) |
|
] |
However, before we "sympify", casts are already translated to dace types, e.g. dace.int64 and then this isn't plain python anymore and fails sympy's python parser.
PR ... puts a mitigation in place to catch casts in indices of type VariableKOffset in the DaCe backends. The PR also adds a codgen test which
- uses
xfail for all DaCe backends
- succeeds for all other backends
That behavior can be simplified once DaCe backends also support casting in variable k offset expressions.
Description
DaCe backends are currently missing support for casting in
VariableKOffset. The issue comes from the fact that we "sympify" index computations in the_visit_offsets()function oftasklet_codegen.gt4py/src/gt4py/cartesian/gtc/dace/expansion/tasklet_codegen.py
Lines 46 to 49 in 1a46fb0
However, before we "sympify", casts are already translated to dace types, e.g.
dace.int64and then this isn't plain python anymore and failssympy's python parser.PR ... puts a mitigation in place to catch casts in indices of type
VariableKOffsetin the DaCe backends. The PR also adds a codgen test whichxfailfor all DaCe backendsThat behavior can be simplified once DaCe backends also support casting in variable k offset expressions.