loki.backend.dacegen module

dacegen(ir)

Generate standard Python 3 code with Dace-specializations (and Numpy) from one or many IR objects/trees.

class DaceCodegen(depth=0, indent='  ', linewidth=100)

Bases: PyCodegen

Tree visitor that extends PyCodegen with Dace-specific language variations.

visit_Subroutine(o, **kwargs)
Format as:

…imports… def <name>(<args>):

…spec without imports and only declarations with initial values… …body…

visit_Module(o, **kwargs)

Format a Module as

<repr(Module)>
  ...spec...
  ...routines...
visit_Loop(o, **kwargs)
Format loop with explicit range as
for <var> in range(<start>, <end> + <incr>, <incr>):

…body…

visit_SymbolAttributes(o, **kwargs)