From e93cbc0817c3dcd8757a0c1f91347bed7951338d Mon Sep 17 00:00:00 2001 From: Scott Todd Date: Fri, 1 Sep 2023 15:50:49 -0700 Subject: [PATCH] Add diagram for VM modules to c-api doc. (#14906) ![image](https://github.com/openxla/iree/assets/4010439/ae46dd16-9948-4757-a8ed-7ad4ec7df3d1) --- docs/website/docs/reference/bindings/c-api.md | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/website/docs/reference/bindings/c-api.md b/docs/website/docs/reference/bindings/c-api.md index cc827e5413ec..1291bced7b5e 100644 --- a/docs/website/docs/reference/bindings/c-api.md +++ b/docs/website/docs/reference/bindings/c-api.md @@ -391,8 +391,6 @@ A _call_ (`iree_runtime_call_t`) is a stateful VM function call builder. #### VM - - IREE uses its own Virtual Machine (VM) at runtime to interpret program instructions on the host system. @@ -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
Program functions
Debug information + } + + state "HAL module" as HAL { + hal_contents: Devices
Executables
HAL functions
HAL types + } + + state "Custom module" as custom { + custom_contents: External functions
Custom types + } + ``` + #### HAL