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

SPIR-V emission option space. More...

Go to the source code of this file.

Data Structures

struct  loomc_spirv_emit_options_t
 SPIR-V binary emission options. More...

Detailed Description

SPIR-V emission option space.

Link the SPIR-V target binding package to make the generic loomc_emit_module operation capable of producing LOOMC_ARTIFACT_FORMAT_SPIRV artifacts. This header owns SPIR-V-specific emission descriptors that may be attached to loomc_emit_options_t::next.

Example
Emit a prepared SPIR-V target-low module:
loomc_emit_options_t emit_options = {
.structure_size = sizeof(loomc_emit_options_t),
.artifact_format = loomc_make_cstring_view(LOOMC_ARTIFACT_FORMAT_SPIRV),
.identifier = loomc_make_cstring_view("kernel.spv"),
};
loomc_result_t* emit_result = NULL;
target_environment, workspace, module, &emit_options,
loomc_allocator_system(), &emit_result);
if (!loomc_status_is_ok(status)) return status;
if (!loomc_result_succeeded(emit_result)) {
// Inspect typed diagnostics from emit_result.
}
loomc_result_release(emit_result);
loomc_allocator_t loomc_allocator_system(void)
Returns a process-global system allocator.
@ LOOMC_STRUCTURE_TYPE_EMIT_OPTIONS
loomc_emit_options_t.
Definition base.h:234
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
loomc_status_t loomc_emit_module(loomc_target_environment_t *target_environment, loomc_workspace_t *workspace, loomc_module_t *module, const loomc_emit_options_t *options, loomc_allocator_t allocator, loomc_result_t **out_result)
Emits target artifacts from a prepared module.
void loomc_result_release(loomc_result_t *result)
Releases result from one owner.
bool loomc_result_succeeded(const loomc_result_t *result)
Returns true when result succeeded.
struct loomc_result_t loomc_result_t
Immutable operation result.
Definition result.h:63
Target emission options.
Definition emit.h:118
#define LOOMC_ARTIFACT_FORMAT_SPIRV
SPIR-V binary artifact format.
Definition target/spirv/base.h:26