Expand description
XLA FFI: calling Rust functions from compiled programs.
A program calls a handler with stablehlo.custom_call @name(...) {api_version = 4 : i32}. The handler is registered with a plugin under
that name through the plugin’s FFI extension
(Plugin::register_ffi_handler), and runs on the host with the device
buffers of the arguments and results.
This is how ruxla runs operations that StableHLO has no operation for,
such as most of linear algebra. Handlers
are written with handle, which takes care of XLA’s metadata query and
of the execution stages.
Structs§
- FfiAttrs
- The attributes of an FFI call, by name.
- FfiBuffer
- An argument or result buffer of an FFI call.
Enums§
- FfiAttr
- An attribute of an FFI call (
mhlo.backend_configof the custom call). - FfiData
Type - The element type of an FFI buffer, for the types handlers commonly use.
- Memory
- Where the buffers of an FFI call live.
Traits§
- FfiElement
- The element types of
FfiBufferviews.
Functions§
- handle⚠
- Runs the body of an FFI handler.
- handle_
with ⚠ handlewith the call’s attributes, for buffers inmemory.