|
Loom C API
Public Loom compiler C API
|
Optional target-profile router for IREE HAL devices. More...
Go to the source code of this file.
Data Structures | |
| struct | loomc_iree_hal_profile_provider_t |
| One linked IREE HAL profile provider. More... | |
| struct | loomc_iree_hal_profile_options_t |
| IREE HAL target-profile routing options. More... | |
Typedefs | |
| typedef loomc_status_t(* | loomc_iree_hal_profile_provider_fn_t) (void *user_data, loomc_target_environment_t *target_environment, const loomc_iree_hal_profile_options_t *options, loomc_allocator_t allocator, bool *out_supported, loomc_target_profile_t **out_profile, loomc_result_t **out_result) |
| Attempts to create a target profile from an IREE HAL device. | |
Functions | |
| loomc_status_t | loomc_target_profile_create_iree_hal (loomc_target_environment_t *target_environment, const loomc_iree_hal_profile_options_t *options, loomc_allocator_t allocator, loomc_target_profile_t **out_profile, loomc_result_t **out_result) |
| Routes an IREE HAL device through the linked target-profile providers. | |
Optional target-profile router for IREE HAL devices.
This leaf is for hosts that already own an iree_hal_device_t and want a Loom target profile without coupling callsites to a specific HAL backend. Core Loom C API headers stay free of IREE HAL types; embedders opt in by linking this leaf and one or more target-family provider leaves.
Routing is explicit and ordered. Callers pass the provider table selected by the linked binary, and the router asks each provider whether it can describe the device. A provider that does not recognize the device returns a route miss, not an error. A provider that recognizes the device returns the normal Loom operation result so unsupported device capabilities, missing executable formats, or incomplete facts are reported as structured diagnostics.
| typedef loomc_status_t(* loomc_iree_hal_profile_provider_fn_t) (void *user_data, loomc_target_environment_t *target_environment, const loomc_iree_hal_profile_options_t *options, loomc_allocator_t allocator, bool *out_supported, loomc_target_profile_t **out_profile, loomc_result_t **out_result) |
Attempts to create a target profile from an IREE HAL device.
| user_data | Provider-owned pointer from loomc_iree_hal_profile_provider_t::user_data. |
| target_environment | Target environment that will own the profile. |
| options | Router options borrowed for the duration of the call. |
| allocator | Host allocator used for result and profile storage. |
| out_supported | Receives true when this provider handled the device. |
| out_profile | Receives one retained profile when supported and the provider's result succeeds. Receives NULL on route miss or failed result. |
| out_result | Receives the provider result when supported. Receives NULL on route miss. |
| loomc_status_t loomc_target_profile_create_iree_hal | ( | loomc_target_environment_t * | target_environment, |
| const loomc_iree_hal_profile_options_t * | options, | ||
| loomc_allocator_t | allocator, | ||
| loomc_target_profile_t ** | out_profile, | ||
| loomc_result_t ** | out_result ) |
Routes an IREE HAL device through the linked target-profile providers.
| target_environment | Target environment whose provider package understands the returned profile. |
| options | Routing options. |
| allocator | Host allocator used for result and profile storage. |
| out_profile | Receives one retained profile when routing succeeds and the selected provider result succeeds. Receives NULL on failed result. |
| out_result | Receives a retained result for the routing operation. |