Skip to content

Commit

Permalink
Add diagram for VM modules to c-api doc. (#14906)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottTodd authored Sep 1, 2023
1 parent 73b04d3 commit e93cbc0
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions docs/website/docs/reference/bindings/c-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,6 @@ A _call_ (`iree_runtime_call_t`) is a stateful VM function call builder.

#### VM

<!-- TODO(scotttodd): VM module diagram (bytecode, HAL, custom) -->

IREE uses its own Virtual Machine (VM) at runtime to interpret program
instructions on the host system.

Expand All @@ -411,10 +409,33 @@ dense math into HAL command buffers that are dispatched to hardware backends.
* VM _instances_ can serve multiple isolated execution _contexts_.
* VM _contexts_ are effectively sandboxes for loading modules and running
programs.
* VM _modules_ provide extra functionality to execution _contexts_, such as
* VM _modules_ provide all functionality to execution _contexts_, including
access to hardware accelerators through the HAL. Compiled user programs are
also modules.

```mermaid
stateDiagram-v2
accTitle: Sample VM Modules
accDescr {
Bytecode modules contain program state, program functions, and debug
information.
HAL modules contain devices, executables, HAL functions, and HAL types.
Custom modules may contain external functions and custom types.
}
state "Bytecode module" as bytecode {
bytecode_contents: Module state<br>Program functions<br>Debug information
}
state "HAL module" as HAL {
hal_contents: Devices<br>Executables<br>HAL functions<br>HAL types
}
state "Custom module" as custom {
custom_contents: External functions<br>Custom types
}
```

#### HAL

<!-- TODO(scotttodd): command buffer construction -> dispatch diagram -->
Expand Down

0 comments on commit e93cbc0

Please sign in to comment.