Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
launch_config.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_LAUNCH_CONFIG_H_
8#define LOOMC_LAUNCH_CONFIG_H_
9
10#include <stdbool.h>
11#include <stdint.h>
12
13#include "loomc/artifact.h"
14
66
67#ifdef __cplusplus
68extern "C" {
69#endif
70
85
95
97#define LOOMC_LAUNCH_CONFIG_FUNCTION_INVALID_VALUE UINT64_MAX
98
101loomc_launch_config_function_invalid(void) {
104 return function;
105}
106
110static inline bool loomc_launch_config_function_is_valid(
113}
114
158
177 const loomc_artifact_t* artifact, loomc_allocator_t allocator,
178 loomc_launch_config_program_t** out_program);
179
185
191
204 const loomc_launch_config_program_t* program,
205 loomc_string_view_t export_name,
206 loomc_launch_config_function_t* out_function);
207
239 const uint64_t* workload_argument_bits,
240 loomc_host_size_t workload_argument_count,
241 loomc_launch_config_t* out_config);
242
243#ifdef __cplusplus
244} // extern "C"
245#endif
246
247#endif // LOOMC_LAUNCH_CONFIG_H_
In-memory output artifacts produced by compiler operations.
#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
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
loomc_status_t loomc_launch_config_program_load(const loomc_artifact_t *artifact, loomc_allocator_t allocator, loomc_launch_config_program_t **out_program)
Loads and verifies a compiled launch-config program.
loomc_status_t loomc_launch_config_program_invoke(loomc_launch_config_program_t *program, loomc_launch_config_function_t function, const uint64_t *workload_argument_bits, loomc_host_size_t workload_argument_count, loomc_launch_config_t *out_config)
Invokes one compiled launch-config function for one kernel workload.
#define LOOMC_LAUNCH_CONFIG_FUNCTION_INVALID_VALUE
Invalid launch-config function token value.
Definition launch_config.h:97
void loomc_launch_config_program_retain(loomc_launch_config_program_t *program)
Retains program for another owner.
loomc_status_t loomc_launch_config_program_lookup_function(const loomc_launch_config_program_t *program, loomc_string_view_t export_name, loomc_launch_config_function_t *out_function)
Resolves a compiled kernel export name to a program-local function token.
void loomc_launch_config_program_release(loomc_launch_config_program_t *program)
Releases program from one owner.
struct loomc_launch_config_program_t loomc_launch_config_program_t
Loaded program containing compiled kernel launch configurations.
Definition launch_config.h:84
Host allocator used for persistent Loom object storage.
Definition base.h:414
Borrowed artifact view owned by a producer-specific result or product.
Definition artifact.h:78
Three-dimensional unsigned extent used by Loom C API structs.
Definition base.h:165
Program-local launch-config function token.
Definition launch_config.h:91
uint64_t value
Program-local function value.
Definition launch_config.h:93
Complete concrete configuration for one compiled kernel launch.
Definition launch_config.h:121
loomc_structure_type_t type
Structure type.
Definition launch_config.h:124
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition launch_config.h:127
loomc_dimension3_t workgroup_cluster_size
Number of workgroups in each cooperative cluster dimension.
Definition launch_config.h:143
void * next
Unordered extension chain for additional launch properties.
Definition launch_config.h:130
uint32_t subgroup_size
Number of invocations in each hardware subgroup.
Definition launch_config.h:148
loomc_dimension3_t workgroup_count
Number of workgroups dispatched along each dimension.
Definition launch_config.h:133
loomc_dimension3_t workgroup_size
Number of invocations in each workgroup along each dimension.
Definition launch_config.h:138
uint64_t workgroup_storage_bytes
Total workgroup-local storage required per workgroup, in bytes.
Definition launch_config.h:156
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63