diff --git a/src/gt4py/cartesian/backend/dace_backend.py b/src/gt4py/cartesian/backend/dace_backend.py index 60da2c36ff..bf95e5a207 100644 --- a/src/gt4py/cartesian/backend/dace_backend.py +++ b/src/gt4py/cartesian/backend/dace_backend.py @@ -451,7 +451,7 @@ class DaCeComputationCodegen: const int __I = domain[0]; const int __J = domain[1]; const int __K = domain[2]; - ${name}_t dace_handle; + ${name}_{state_prefix} dace_handle; ${backend_specifics} auto allocator = gt::sid::cached_allocator(&${allocator}); ${"\\n".join(tmp_allocs)} @@ -561,6 +561,13 @@ def apply(cls, stencil_ir: gtir.Stencil, builder: "StencilBuilder", sdfg: dace.S else: omp_threads = "" omp_header = "" + + # Backward compatible state struct name change in dave >=0.15.x + try: + dace_state_prefix = dace.Config.get("compiler.codegen_state_struct_suffix") + except (KeyError, TypeError): + dace_state_prefix = "t" # old structure name + interface = cls.template.definition.render( name=sdfg.name, backend_specifics=omp_threads, @@ -568,6 +575,7 @@ def apply(cls, stencil_ir: gtir.Stencil, builder: "StencilBuilder", sdfg: dace.S functor_args=self.generate_functor_args(sdfg), tmp_allocs=self.generate_tmp_allocs(sdfg), allocator="gt::cuda_util::cuda_malloc" if is_gpu else "std::make_unique", + state_prefix=dace_state_prefix, ) generated_code = textwrap.dedent( f"""#include