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
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
81
91
93#define LOOMC_LAUNCH_CONFIG_FUNCTION_INVALID_VALUE UINT64_MAX
94
97loomc_launch_config_function_invalid(void) {
100 return function;
101}
102
106static inline bool loomc_launch_config_function_is_valid(
109}
110
154
173 const loomc_artifact_t* artifact, loomc_allocator_t allocator,
174 loomc_launch_config_program_t** out_program);
175
181
187
199 const loomc_launch_config_program_t* program,
200 loomc_string_view_t export_name,
201 loomc_launch_config_function_t* out_function);
202
232 const uint64_t* workload_argument_bits,
233 loomc_host_size_t workload_argument_count,
234 loomc_launch_config_t* out_config);
235
236#ifdef __cplusplus
237} // extern "C"
238#endif
239
240#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:93
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:80
Host allocator used for persistent Loom object storage.
Definition base.h:390
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:87
uint64_t value
Program-local function value.
Definition launch_config.h:89
Complete concrete configuration for one compiled kernel launch.
Definition launch_config.h:117
loomc_structure_type_t type
Structure type.
Definition launch_config.h:120
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition launch_config.h:123
loomc_dimension3_t workgroup_cluster_size
Number of workgroups in each cooperative cluster dimension.
Definition launch_config.h:139
void * next
Unordered extension chain for additional launch properties.
Definition launch_config.h:126
uint32_t subgroup_size
Number of invocations in each hardware subgroup.
Definition launch_config.h:144
loomc_dimension3_t workgroup_count
Number of workgroups dispatched along each dimension.
Definition launch_config.h:129
loomc_dimension3_t workgroup_size
Number of invocations in each workgroup along each dimension.
Definition launch_config.h:134
uint64_t workgroup_storage_bytes
Total workgroup-local storage required per workgroup, in bytes.
Definition launch_config.h:152
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63