MeteoSwiss-APN/dawn

Unused API Fields cause CUDA backend to fail

mroethlin opened this issue · 0 comments

If a API field is unused like so

@stencil
def sparse_reduction(
    a: Field[Edge], b: Field[Edge], UNUSED: Field[Edge],
):
    with levels_downward:
        a = b

The cuda backend will fail. This is because the CUDA backend assumes that all API fields are also stencil fields here. It does this to figure out if a fields is an out or "inout" field to determine whether it should include the field in the copy back functions. Fixing this is probably as simple as neglecting API fields that aren't stencil fields in the copy back functions.