'runtime' Dialect
A runtime out-of-tree MLIR dialect
This dialect contains dedicated operations, types, and attributes designed for representing hardware runtimes in MLIR.
- Operations
- runtime.chrono_duration (streamtensor::runtime::ChronoDurationOp)
- runtime.chrono_now (streamtensor::runtime::ChronoNowOp)
- runtime.delete_pointer (streamtensor::runtime::DeletePointerOp)
- runtime.load_binary_file (streamtensor::runtime::LoadBinaryFileOp)
- runtime.memref_to_pointer (streamtensor::runtime::MemRefToPointerOp)
- runtime.memref_unwiden (streamtensor::runtime::MemRefUnWidenOp)
- runtime.memref_widen (streamtensor::runtime::MemRefWidenOp)
- runtime.pointer_to_memref (streamtensor::runtime::PointerToMemRefOp)
- runtime.xrt_buffer (streamtensor::runtime::XRTBufferOp)
- runtime.xrt_buffer_sync_read (streamtensor::runtime::XRTBufferSyncReadOp)
- runtime.xrt_buffer_write_sync (streamtensor::runtime::XRTBufferWriteSyncOp)
- runtime.xrt_device (streamtensor::runtime::XRTDeviceOp)
- runtime.xrt_kernel (streamtensor::runtime::XRTKernelOp)
- runtime.xrt_load_xclbin (streamtensor::runtime::XRTLoadXclbinOp)
- runtime.xrt_logf (streamtensor::runtime::XRTLogFOp)
- runtime.xrt_run (streamtensor::runtime::XRTRunOp)
- runtime.xrt_run_set_arg (streamtensor::runtime::XRTRunSetArgOp)
- runtime.xrt_run_start (streamtensor::runtime::XRTRunStartOp)
- runtime.xrt_run_wait (streamtensor::runtime::XRTRunWaitOp)
- Types
Operations¶
runtime.chrono_duration (streamtensor::runtime::ChronoDurationOp)¶
Get the duration between two times
Syntax:
operation ::= `runtime.chrono_duration` $start `to` $end attr-dict `:` functional-type(operands, results)
Operands:¶
| Operand | Description |
|---|---|
start |
opaque type with name of std::chrono::time_point |
end |
opaque type with name of std::chrono::time_point |
Results:¶
| Result | Description |
|---|---|
durationInMs |
64-bit float |
runtime.chrono_now (streamtensor::runtime::ChronoNowOp)¶
Get the current time
Syntax:
operation ::= `runtime.chrono_now` attr-dict `:` type(results)
Results:¶
| Result | Description |
|---|---|
time |
opaque type with name of std::chrono::time_point |
runtime.delete_pointer (streamtensor::runtime::DeletePointerOp)¶
Delete a runtime Pointer
Syntax:
operation ::= `runtime.delete_pointer` $pointer attr-dict `:` type(operands)
Operands:¶
| Operand | Description |
|---|---|
pointer |
pointer type of any type |
runtime.load_binary_file (streamtensor::runtime::LoadBinaryFileOp)¶
Load a binary file
Syntax:
operation ::= `runtime.load_binary_file` $globalName attr-dict `:` type(results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), SymbolUserOpInterface
Effects: MemoryEffects::Effect{}
Attributes:¶
| Attribute | MLIR Type | Description |
|---|---|---|
globalName | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Results:¶
| Result | Description |
|---|---|
fileBuffer |
pointer type of any type |
runtime.memref_to_pointer (streamtensor::runtime::MemRefToPointerOp)¶
Convert a runtime MemRef to a Pointer
Syntax:
operation ::= `runtime.memref_to_pointer` $memref attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:¶
| Operand | Description |
|---|---|
memref |
statically shaped memref of any type values |
Results:¶
| Result | Description |
|---|---|
pointer |
pointer type of any type |
runtime.memref_unwiden (streamtensor::runtime::MemRefUnWidenOp)¶
Unwiden a runtime MemRef instance
Syntax:
operation ::= `runtime.memref_unwiden` $source attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), ViewLikeOpInterface
Effects: MemoryEffects::Effect{}
Operands:¶
| Operand | Description |
|---|---|
source |
statically shaped memref of any type values |
Results:¶
| Result | Description |
|---|---|
result |
statically shaped memref of any type values |
runtime.memref_widen (streamtensor::runtime::MemRefWidenOp)¶
Widen a runtime MemRef instance
Syntax:
operation ::= `runtime.memref_widen` $source attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), ViewLikeOpInterface
Effects: MemoryEffects::Effect{}
Operands:¶
| Operand | Description |
|---|---|
source |
statically shaped memref of any type values |
Results:¶
| Result | Description |
|---|---|
result |
statically shaped memref of any type values |
runtime.pointer_to_memref (streamtensor::runtime::PointerToMemRefOp)¶
Convert a runtime Pointer to a MemRef
Syntax:
operation ::= `runtime.pointer_to_memref` $pointer attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:¶
| Operand | Description |
|---|---|
pointer |
pointer type of any type |
Results:¶
| Result | Description |
|---|---|
memref |
statically shaped memref of any type values |
runtime.xrt_buffer (streamtensor::runtime::XRTBufferOp)¶
Create an XRT buffer object
Syntax:
operation ::= `runtime.xrt_buffer` `device` $xrtDevice `size` $sizeInByte `group` $xrtKernel `[` $argIndex `]`
attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:¶
| Attribute | MLIR Type | Description |
|---|---|---|
sizeInByte | ::mlir::IntegerAttr | 64-bit signed integer attribute |
argIndex | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operands:¶
| Operand | Description |
|---|---|
xrtDevice |
opaque type with name of xrt::device |
xrtKernel |
opaque type with name of xrt::kernel |
Results:¶
| Result | Description |
|---|---|
xrtBuffer |
opaque type with name of xrt::bo |
runtime.xrt_buffer_sync_read (streamtensor::runtime::XRTBufferSyncReadOp)¶
Read from an XRT buffer object
Syntax:
operation ::= `runtime.xrt_buffer_sync_read` $xrtBuffer `to` $hostBuffer attr-dict `:` type(operands)
Operands:¶
| Operand | Description |
|---|---|
xrtBuffer |
opaque type with name of xrt::bo |
hostBuffer |
pointer type of any type |
runtime.xrt_buffer_write_sync (streamtensor::runtime::XRTBufferWriteSyncOp)¶
Write to an XRT buffer object
Syntax:
operation ::= `runtime.xrt_buffer_write_sync` $xrtBuffer `from` $hostBuffer attr-dict `:` type(operands)
Operands:¶
| Operand | Description |
|---|---|
xrtBuffer |
opaque type with name of xrt::bo |
hostBuffer |
pointer type of any type |
runtime.xrt_device (streamtensor::runtime::XRTDeviceOp)¶
Create an XRT device
Syntax:
operation ::= `runtime.xrt_device` $deviceIndex attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:¶
| Operand | Description |
|---|---|
deviceIndex |
index |
Results:¶
| Result | Description |
|---|---|
xrtDevice |
opaque type with name of xrt::device |
runtime.xrt_kernel (streamtensor::runtime::XRTKernelOp)¶
Create an XRT kernel
Syntax:
operation ::= `runtime.xrt_kernel` `device` $xrtDevice `xclbin` $xrtXclbin $kernelName attr-dict `:`
functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), SymbolUserOpInterface
Effects: MemoryEffects::Effect{}
Attributes:¶
| Attribute | MLIR Type | Description |
|---|---|---|
kernelName | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Operands:¶
| Operand | Description |
|---|---|
xrtDevice |
opaque type with name of xrt::device |
xrtXclbin |
opaque type with name of xrt::uuid |
Results:¶
| Result | Description |
|---|---|
xrtKernel |
opaque type with name of xrt::kernel |
runtime.xrt_load_xclbin (streamtensor::runtime::XRTLoadXclbinOp)¶
Load an XRT xclbin
Syntax:
operation ::= `runtime.xrt_load_xclbin` `device` $xrtDevice $kernelName attr-dict `:`
functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), SymbolUserOpInterface
Effects: MemoryEffects::Effect{}
Attributes:¶
| Attribute | MLIR Type | Description |
|---|---|---|
kernelName | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Operands:¶
| Operand | Description |
|---|---|
xrtDevice |
opaque type with name of xrt::device |
Results:¶
| Result | Description |
|---|---|
xrtXclbin |
opaque type with name of xrt::uuid |
runtime.xrt_logf (streamtensor::runtime::XRTLogFOp)¶
Print a formatted string to the console
Syntax:
operation ::= `runtime.xrt_logf` $format (`,` $args^)? attr-dict `:` type(operands)
Attributes:¶
| Attribute | MLIR Type | Description |
|---|---|---|
format | ::mlir::StringAttr | string attribute |
Operands:¶
| Operand | Description |
|---|---|
args |
variadic of any type |
runtime.xrt_run (streamtensor::runtime::XRTRunOp)¶
Run an XRT kernel
Syntax:
operation ::= `runtime.xrt_run` `kernel` $xrtKernel (`buffers` $xrtBuffers^)? attr-dict `:`
functional-type(operands, results)
Operands:¶
| Operand | Description |
|---|---|
xrtKernel |
opaque type with name of xrt::kernel |
xrtBuffers |
variadic of opaque type with name of xrt::bo |
Results:¶
| Result | Description |
|---|---|
xrtRun |
opaque type with name of xrt::run |
runtime.xrt_run_set_arg (streamtensor::runtime::XRTRunSetArgOp)¶
Set an argument for an XRT kernel run
Syntax:
operation ::= `runtime.xrt_run_set_arg` $xrtRun `[` $argIndex `]` `with` $xrtBuffer attr-dict `:` type(operands)
Attributes:¶
| Attribute | MLIR Type | Description |
|---|---|---|
argIndex | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operands:¶
| Operand | Description |
|---|---|
xrtRun |
opaque type with name of xrt::run |
xrtBuffer |
opaque type with name of xrt::bo |
runtime.xrt_run_start (streamtensor::runtime::XRTRunStartOp)¶
Start an XRT kernel run
Syntax:
operation ::= `runtime.xrt_run_start` $xrtRun `autostart` $autoStart attr-dict `:` type(operands)
Attributes:¶
| Attribute | MLIR Type | Description |
|---|---|---|
autoStart | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operands:¶
| Operand | Description |
|---|---|
xrtRun |
opaque type with name of xrt::run |
runtime.xrt_run_wait (streamtensor::runtime::XRTRunWaitOp)¶
Wait for an XRT kernel run to finish
Syntax:
operation ::= `runtime.xrt_run_wait` $xrtRun `timeout` $timeoutInMs `ms` attr-dict `:` type(operands)
Attributes:¶
| Attribute | MLIR Type | Description |
|---|---|---|
timeoutInMs | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operands:¶
| Operand | Description |
|---|---|
xrtRun |
opaque type with name of xrt::run |
Types¶
OpaqueType¶
A runtime opaque type
Syntax:
!runtime.opaque<
::llvm::StringRef # name
>
Parameters:¶
| Parameter | C++ type | Description |
|---|---|---|
| name | ::llvm::StringRef |
PointerType¶
A runtime pointer type
Syntax:
!runtime.ptr<
mlir::Type, # elementType
unsigned # numElements
>
Parameters:¶
| Parameter | C++ type | Description |
|---|---|---|
| elementType | mlir::Type |
|
| numElements | unsigned |