‘emitasc’ Dialect
C++ emission support dialect
Operations
emitasc.call_opaque (emitasc::CallOpaqueOp)
Call C++ function by its name
Syntax:
operation ::= `emitasc.call_opaque` $callee `(` $callee_operands `)` attr-dict `:`
functional-type($callee_operands, $result)
Callee name must be demangled. It may include namespaces and template arguments. Constructor should be represented as its parent class name.
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
callee | ::mlir::StringAttr | string attribute |
Operands:
Operand |
Description |
|---|---|
|
variadic of any type |
Results:
Result |
Description |
|---|---|
|
any type |
emitasc.copy_struct (emitasc::CopyStructOp)
Create local structure and perform memcpy from another one
Syntax:
operation ::= `emitasc.copy_struct` $base attr-dict `:` type($base) `,` type($result)
Operands:
Operand |
Description |
|---|---|
|
memref of any type values |
Results:
Result |
Description |
|---|---|
|
any type |
emitasc.declare_py_struct (emitasc::DeclarePyStructOp)
Declare custom structure
Syntax:
operation ::= `emitasc.declare_py_struct` $pystruct attr-dict
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
pystruct | ::mlir::TypeAttr | any type attribute |
emitasc.dereference (emitasc::DereferenceOp)
Dereference pointer to underlying object (unary operator*)
Syntax:
operation ::= `emitasc.dereference` $base attr-dict `:` type($base) `,` type($result)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
Operand |
Description |
|---|---|
|
memref of any type values |
Results:
Result |
Description |
|---|---|
|
any type |
emitasc.mask (emitasc::MaskOp)
Creates a mask in bit-by-bit mode (pair of 64-bit integers)
Syntax:
operation ::= `emitasc.mask` $maskH `,` $maskL attr-dict
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
Operand |
Description |
|---|---|
|
64-bit signless integer |
|
64-bit signless integer |
Results:
Result |
Description |
|---|---|
|
emitasc.member (emitasc::MemberOp)
Syntax:
operation ::= `emitasc.member` $base $field attr-dict `:` type($base) `,` type($result)
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
field | ::mlir::StringAttr | string attribute |
Operands:
Operand |
Description |
|---|---|
|
any type |
Results:
Result |
Description |
|---|---|
|
any type |
emitasc.member_ptr (emitasc::MemberPtrOp)
Access pointer-to-struct member (operator->)
Syntax:
operation ::= `emitasc.member_ptr` $base `[` $index `]` ($field^)? attr-dict `:` type($base) `,` type($result)
This operation represents getting an address of a struct member at the given pointer, and it should be emitted as the following:
auto *result = (ResultT *)&base->member;
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
index | ::mlir::IntegerAttr | index attribute |
field | ::mlir::StringAttr | string attribute |
Operands:
Operand |
Description |
|---|---|
|
memref of any type values |
Results:
Result |
Description |
|---|---|
|
memref of any type values |
emitasc.member_ref (emitasc::MemberRefOp)
Access pointer-to-struct member (emit result as reference)
Syntax:
operation ::= `emitasc.member_ref` $base `[` $index `]` ($field^)? attr-dict `:` type($base) `,` type($result)
This operation represents obtaining a struct member at the given pointer as a reference, and it should be emitted as the following:
ResultT &result = base->member;
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
index | ::mlir::IntegerAttr | index attribute |
field | ::mlir::StringAttr | string attribute |
Operands:
Operand |
Description |
|---|---|
|
memref of any type values |
Results:
Result |
Description |
|---|---|
|
any type |
emitasc.ptr_offset (emitasc::PtrOffsetOp)
Apply operator+ between pointer and offset
Syntax:
operation ::= `emitasc.ptr_offset` $base `[` ($dynamicOffset^):($staticOffset ` `)? `]` attr-dict `:`
type($base) `,` type($result)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), ViewLikeOpInterface
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
staticOffset | ::mlir::IntegerAttr | index attribute |
Operands:
Operand |
Description |
|---|---|
|
memref of any type values |
|
index |
Results:
Result |
Description |
|---|---|
|
memref of any type values |
emitasc.reinterpret_cast (emitasc::ReinterpretCastOp)
Convert between types by reinterpreting the underlying data
Syntax:
operation ::= `emitasc.reinterpret_cast` $source attr-dict `:` type($source) `to` type($result)
Traits: AlwaysSpeculatableImplTrait
Interfaces: CastOpInterface, ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
Operand |
Description |
|---|---|
|
any type |
Results:
Result |
Description |
|---|---|
|
any type |
emitasc.set_member (emitasc::SetMemberOp)
Syntax:
operation ::= `emitasc.set_member` $base $field `,` $value attr-dict `:` type($base) `,` type($value)
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
field | ::mlir::StringAttr | string attribute |
Operands:
Operand |
Description |
|---|---|
|
any type |
|
any type |
emitasc.variable (emitasc::VariableOp)
Define a mutable variable
Syntax:
operation ::= `emitasc.variable` attr-dict ($dynamicInit^ `:` type($dynamicInit)):($staticInit)? `,` type($result)
This operation combines an allocation and storing a value to memref<1x...>.
Its element type must be the same as init type (either static or dynamic).
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
staticInit | ::mlir::TypedAttr | TypedAttr instance{{% markdown %}} This interface is used for attributes that have a type. The type of an attribute is understood to represent the type of the data contained in the attribute and is often used as the type of a value with this data. {{% /markdown %}} |
Operands:
Operand |
Description |
|---|---|
|
any type |
Results:
Result |
Description |
|---|---|
|
non-0-ranked.memref of any type values |
emitasc.verbatim (emitasc::VerbatimOp)
Syntax:
operation ::= `emitasc.verbatim` $value ($args^ `:` type($args))? attr-dict
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
value | ::mlir::StringAttr | string attribute |
Operands:
Operand |
Description |
|---|---|
|
variadic of any type |
Attributes
KernelArgumentAttr
kind of kernel argument for the launcher
Syntax:
#emitasc.kernel_arg<
::mlir::emitasc::KernelArgument # value
>
Describes kind of kernel argument: explicit argument, target specific argument (workspace, ffts address, etc.)
Parameters:
Parameter |
C++ type |
Description |
|---|---|---|
value |
|
an enum of type KernelArgument |
Types
MaskType
Syntax: !emitasc.mask
Represents 2-element array with high and low mask
PyStructType
Syntax:
!emitasc.py_struct<
StringAttr, # nameAttr
ArrayAttr, # typesAttr
ArrayAttr # namesAttr
>
Parameters:
Parameter |
C++ type |
Description |
|---|---|---|
nameAttr |
|
|
typesAttr |
|
|
namesAttr |
|
Enums
KernelArgument
kernel argument
Cases:
Symbol |
Value |
String |
|---|---|---|
Explicit |
|
explicit |
FftsAddr |
|
ffts_addr |