Python: tfe.implements
implements returns the decorated object unchanged. It attaches the annotation as __theformalera__, which tfe.annotations_of(obj) reads, for tools that inspect live objects. The CLI never imports kernel modules, so all arguments must be literals or tfe.layout calls.
Place it above @triton.jit and above @triton.autotune. It also works on a plain Python function that launches kernels (a launcher); see Annotate Triton kernels.
Python: tfe.layout
See Layouts and assumptions for which layouts the engine models in this release.
C++: comment form
- Each line is
// @theformalera <field> = <value>. Indented comment lines continue the previous value. - The block attaches to the next declaration, and must contain
implements. implementslists one or more double-quoted Spec Keys.
C++: macro form
#include <theformalera/annotate.h>, then THEFORMALERA_IMPLEMENTS("<key>"), THEFORMALERA_BIND(…), THEFORMALERA_LAYOUT(…), THEFORMALERA_DOMAIN(…), THEFORMALERA_ASSUME(…), THEFORMALERA_INSTANTIATE(…) and THEFORMALERA_GRID(…). Every macro expands to nothing. THEFORMALERA_TRACE_LAUNCH(…) records a launch for theformalera trace when compiled with -DTHEFORMALERA_TRACE.