Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
iree_hal.h
Go to the documentation of this file.
1// Copyright 2026 The IREE Authors
2//
3// Licensed under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
7#ifndef LOOMC_TARGET_IREE_HAL_H_
8#define LOOMC_TARGET_IREE_HAL_H_
9
10#include <stdbool.h>
11
12#include "iree/hal/api.h"
13#include "loomc/module.h"
14#include "loomc/sanitizer.h"
15#include "loomc/target.h"
16
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
42
46
72 const loomc_module_t* module,
73 const loomc_sanitizer_options_t* sanitizer_options,
74 const loomc_string_view_t* root_symbols,
75 loomc_host_size_t root_symbol_count,
76 iree_hal_device_runtime_feature_flags_t* out_runtime_features);
77
91
119 void* user_data, loomc_target_environment_t* target_environment,
120 const loomc_iree_hal_target_options_t* options, loomc_allocator_t allocator,
121 bool* out_supported, loomc_iree_hal_target_selection_t* out_selection,
122 loomc_result_t** out_result);
123
135
174
198 loomc_target_environment_t* target_environment,
199 const loomc_iree_hal_target_options_t* options, loomc_allocator_t allocator,
201 loomc_result_t** out_result);
202
203#ifdef __cplusplus
204} // extern "C"
205#endif
206
207#endif // LOOMC_TARGET_IREE_HAL_H_
#define LOOMC_API_EXPORT
Exports a public Loom C API symbol from a shared library build.
Definition base.h:34
size_t loomc_host_size_t
Host allocation and container size type.
Definition base.h:45
loomc_structure_type_t
Structure type values used by extensible public descriptors.
Definition base.h:181
#define LOOMC_API_PTR
Marks a public callback function pointer type.
Definition base.h:38
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
loomc_status_t loomc_iree_hal_module_query_runtime_features(const loomc_module_t *module, const loomc_sanitizer_options_t *sanitizer_options, const loomc_string_view_t *root_symbols, loomc_host_size_t root_symbol_count, iree_hal_device_runtime_feature_flags_t *out_runtime_features)
Queries HAL runtime services required by a module and sanitizer policy.
loomc_status_t loomc_target_select_iree_hal(loomc_target_environment_t *target_environment, const loomc_iree_hal_target_options_t *options, loomc_allocator_t allocator, loomc_iree_hal_target_selection_t *out_selection, loomc_result_t **out_result)
Selects a compiler-and-loader target from an IREE HAL device.
loomc_status_t(* loomc_iree_hal_target_provider_fn_t)(void *user_data, loomc_target_environment_t *target_environment, const loomc_iree_hal_target_options_t *options, loomc_allocator_t allocator, bool *out_supported, loomc_iree_hal_target_selection_t *out_selection, loomc_result_t **out_result)
Attempts to select a compiler-and-loader target from an IREE HAL device.
Definition iree_hal.h:118
Opaque in-memory Loom modules.
struct loomc_module_t loomc_module_t
Opaque parsed, linked, optimized, or lowered module.
Definition module.h:90
struct loomc_result_t loomc_result_t
Immutable operation result.
Definition result.h:71
Sanitizer compile options.
Host allocator used for persistent Loom object storage.
Definition base.h:414
IREE HAL target-routing options.
Definition iree_hal.h:137
loomc_host_size_t provider_count
Number of entries in providers.
Definition iree_hal.h:172
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition iree_hal.h:143
loomc_structure_type_t type
Structure type.
Definition iree_hal.h:140
const void * next
Provider-specific option descriptors.
Definition iree_hal.h:146
const loomc_iree_hal_target_provider_t *const * providers
Ordered borrowed array of provider descriptors.
Definition iree_hal.h:169
iree_hal_physical_device_affinity_t physical_device_affinity
Optional physical-device set the selected target must fully cover.
Definition iree_hal.h:158
loomc_target_profile_t * target_profile
Optional caller-selected profile that the HAL target must load exactly.
Definition iree_hal.h:166
loomc_string_view_t identifier
Stable identifier for a profile derived from the device.
Definition iree_hal.h:149
iree_hal_device_t * device
IREE HAL device borrowed for the duration of the call.
Definition iree_hal.h:152
One linked IREE HAL target provider.
Definition iree_hal.h:125
void * user_data
Provider-owned callback state.
Definition iree_hal.h:130
loomc_string_view_t name
Stable provider name used in diagnostics and reports.
Definition iree_hal.h:127
loomc_iree_hal_target_provider_fn_t select_target
Provider callback that attempts target selection.
Definition iree_hal.h:133
One compiler-and-loader target selected from an IREE HAL device.
Definition iree_hal.h:79
const iree_hal_executable_target_t * executable_target
Exact HAL executable target that can load artifacts for target_profile.
Definition iree_hal.h:89
loomc_target_profile_t * target_profile
Complete Loom target profile retained for the caller.
Definition iree_hal.h:83
Invocation option extension that enables sanitizer assertions.
Definition sanitizer.h:80
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63
Prepared target environments and target lowering pipelines.
struct loomc_target_environment_t loomc_target_environment_t
Prepared immutable target environment.
Definition target.h:124
struct loomc_target_profile_t loomc_target_profile_t
Prepared immutable target profile.
Definition target.h:136