Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
iree_hal.h File Reference

AMDGPU compiler-and-loader targets from IREE HAL devices. More...

Go to the source code of this file.

Data Structures

struct  loomc_amdgpu_iree_hal_target_options_t
 AMDGPU target options for an IREE HAL device. More...

Functions

loomc_status_t loomc_target_select_amdgpu_iree_hal (loomc_target_environment_t *target_environment, const loomc_amdgpu_iree_hal_target_options_t *options, loomc_allocator_t allocator, loomc_iree_hal_target_selection_t *out_selection, loomc_result_t **out_result)
 Selects an AMDGPU compiler-and-loader target from an IREE HAL device.
const loomc_iree_hal_target_provider_t * loomc_amdgpu_iree_hal_target_provider (void)
 Returns the generic IREE HAL router provider for AMDGPU devices.

Detailed Description

AMDGPU compiler-and-loader targets from IREE HAL devices.

This optional leaf projects the canonical exact AMDGPU executable target advertised by an IREE HAL device into Loom's structured AMDGPU target profile. Target selectors and AMDHSA feature modes are parsed at the HAL family boundary and remain structured in the resulting profile.

A logical device containing heterogeneous physical devices must identify the physical-device set being compiled for. Omitting affinity is valid only when the logical device advertises one unambiguous highest-priority exact AMDGPU target.

Function Documentation

◆ loomc_amdgpu_iree_hal_target_provider()

const loomc_iree_hal_target_provider_t * loomc_amdgpu_iree_hal_target_provider ( void )

Returns the generic IREE HAL router provider for AMDGPU devices.

Returns
Process-lifetime provider descriptor. The returned pointer is immutable and may be placed directly in a loomc_iree_hal_target_options_t::providers array.

◆ loomc_target_select_amdgpu_iree_hal()

loomc_status_t loomc_target_select_amdgpu_iree_hal ( loomc_target_environment_t * target_environment,
const loomc_amdgpu_iree_hal_target_options_t * options,
loomc_allocator_t allocator,
loomc_iree_hal_target_selection_t * out_selection,
loomc_result_t ** out_result )

Selects an AMDGPU compiler-and-loader target from an IREE HAL device.

Without a caller-selected profile, the adapter selects one exact amdgpu executable target from the device specification, parses its canonical target key into target identity and AMDHSA feature states, and creates an ordinary AMDGPU profile. A caller-selected profile instead requires a HAL target with the same canonical key and exact or generic kind.

Parameters
target_environmentAMDGPU target environment that will own the profile.
optionsAMDGPU IREE HAL target options.
allocatorHost allocator used for result and profile storage.
out_selectionReceives one complete target selection when the result succeeds. Receives zero on failed result.
out_resultReceives a retained result containing adapter diagnostics.
Returns
OK when target selection completed far enough to report a result. Non-OK statuses represent API misuse or infrastructure failures before a result could be produced.
Ownership
The caller owns out_result on an OK return and releases it with loomc_result_release. When a profile is produced, the caller owns the returned profile reference with loomc_target_profile_release. The executable target remains borrowed from the device.
Thread safety
The adapter holds no mutable process-global state. It may be called concurrently for different invocations. The supplied HAL device must satisfy its own thread-safety contract.