Skip to content

template.decl

template dialect

Abstract compile-time callable-family declaration. The declaration owns the stable signature and coarse applicability contract.

Operation contract

Property Value
Semantic phase
Traits SymbolDefine
Interfaces FuncLike

Symbol contract

Property Value
Kind template family
Defining field family
Interfaces func_like, template_family
Flags declaration

Signature

Kind Name Type Cardinality Description
Operand args any variadic
Result results any variadic
Attribute family symbol required
Attribute visibility enum Visibility optional
Attribute cc enum CallingConv optional
Attribute purity enum Purity optional
Attribute temperature enum Temperature optional
Attribute predicates predicate_list optional
Attribute target symbol (target) optional
Attribute requires parameterized_array optional Typed proof requirements over application-site target facts. Requirements filter eligibility and never add facts.
Attribute retain enum Retain optional

Examples

template.decl public @vector_transform(%value: vector<32xf32>) -> (vector<32xf32>)
template.decl requires [#target.subgroup.size<32>] @wave32_transform(%value: vector<32xf32>) -> (vector<32xf32>)