|
Loom C API
Public Loom compiler C API
|
SPIR-V target profile facts. More...
Go to the source code of this file.
Data Structures | |
| struct | loomc_spirv_feature_fact_t |
| One SPIR-V feature observation. More... | |
| struct | loomc_spirv_limit_fact_t |
| One SPIR-V numeric limit observation. More... | |
| struct | loomc_spirv_limit_value_t |
| Queried SPIR-V numeric limit state. More... | |
| struct | loomc_spirv_environment_fact_t |
| One SPIR-V environment observation. More... | |
| struct | loomc_spirv_environment_value_t |
| Queried SPIR-V environment fact state. More... | |
| struct | loomc_spirv_profile_options_t |
| SPIR-V target profile creation options. More... | |
| struct | loomc_spirv_profile_info_t |
| Prepared SPIR-V profile summary. More... | |
| struct | loomc_spirv_cooperative_matrix_row_t |
| Cooperative matrix operation fact row. More... | |
| struct | loomc_spirv_cooperative_vector_row_t |
| Cooperative vector operation fact row. More... | |
Macros | |
| #define | LOOMC_SPIRV_VERSION(major, minor) |
| Encodes a SPIR-V binary version word. | |
| #define | LOOMC_SPIRV_VERSION_1_0 LOOMC_SPIRV_VERSION(1, 0) |
| SPIR-V 1.0 binary version word. | |
| #define | LOOMC_SPIRV_VERSION_1_1 LOOMC_SPIRV_VERSION(1, 1) |
| SPIR-V 1.1 binary version word. | |
| #define | LOOMC_SPIRV_VERSION_1_2 LOOMC_SPIRV_VERSION(1, 2) |
| SPIR-V 1.2 binary version word. | |
| #define | LOOMC_SPIRV_VERSION_1_3 LOOMC_SPIRV_VERSION(1, 3) |
| SPIR-V 1.3 binary version word. | |
| #define | LOOMC_SPIRV_VERSION_1_4 LOOMC_SPIRV_VERSION(1, 4) |
| SPIR-V 1.4 binary version word. | |
| #define | LOOMC_SPIRV_VERSION_1_5 LOOMC_SPIRV_VERSION(1, 5) |
| SPIR-V 1.5 binary version word. | |
| #define | LOOMC_SPIRV_VERSION_1_6 LOOMC_SPIRV_VERSION(1, 6) |
| SPIR-V 1.6 binary version word. | |
Typedefs | |
| typedef uint64_t | loomc_spirv_feature_bits_t |
| Bitset of loomc_spirv_feature_t values. | |
| typedef uint32_t | loomc_spirv_cooperative_matrix_layout_flags_t |
| Bitset of loomc_spirv_cooperative_matrix_layout_flag_bits_t values. | |
| typedef uint32_t | loomc_spirv_cooperative_matrix_operand_flags_t |
| Bitset of loomc_spirv_cooperative_matrix_operand_flag_bits_t values. | |
| typedef uint32_t | loomc_spirv_cooperative_vector_matrix_layout_flags_t |
| Bitset of loomc_spirv_cooperative_vector_matrix_layout_flag_bits_t values. | |
| typedef uint32_t | loomc_spirv_cooperative_vector_flags_t |
| Bitset of loomc_spirv_cooperative_vector_flag_bits_t values. | |
| typedef uint32_t | loomc_spirv_storage_class_flags_t |
| Bitset of loomc_spirv_storage_class_flag_bits_t values. | |
SPIR-V target profile facts.
This leaf owns the normalized, header-light SPIR-V profile API. It does not include Vulkan, IREE HAL, or platform probe headers. Live adapters and saved profile importers should normalize their observations into these facts and then create ordinary loomc_target_profile_t handles.
Profiles are partial by construction. Unknown feature facts remain unknown until a caller supplies a stronger observation; false means a feature is known to be unavailable. Contradictory true/false facts are reported through the returned loomc_result_t with provenance strings preserved in the diagnostic text. Numeric limits and environment facts follow the same tri-state model: true means the value is known, false means the fact is known not to apply to this profile, and unknown preserves partial-target compilation.
| #define LOOMC_SPIRV_VERSION | ( | major, | |
| minor ) |
Encodes a SPIR-V binary version word.
SPIR-V cooperative vector ComponentType operand values.
Cooperative matrix operand fact bits.
Cooperative vector matrix-layout fact bits.
Stable SPIR-V numeric environment fact identifier.
Environment facts describe the SPIR-V module environment accepted by the target independently from individual feature bits. They constrain feature selection but do not themselves imply extensions or capabilities.
Stable SPIR-V feature fact identifier.
These identifiers are Loom profile facts, not Vulkan feature struct fields. A live Vulkan probe, saved vulkaninfo profile, or non-Vulkan driver may all map their own capability model into the same feature IDs.
| enum loomc_spirv_limit_t |
Stable SPIR-V numeric limit fact identifier.
Limits use Loom profile names rather than Vulkan field names so the same fact can come from Vulkan, another SPIR-V-capable API, a saved profile, or a synthetic cross-compilation target.
SPIR-V semantic scalar type fact.
These values describe the scalar element types Loom selects for SPIR-V type declarations. They are separate from SPIR-V component-type enum operands, which are only used by instructions or extension APIs that literally encode those operands.
| enum loomc_spirv_scope_t |
SPIR-V Scope operand values used by public profile fact rows.
Storage-class fact bits used by cooperative operation rows.
| loomc_status_t loomc_spirv_target_profile_capability_at | ( | const loomc_target_profile_t * | profile, |
| loomc_host_size_t | index, | ||
| uint32_t * | out_capability ) |
Returns an OpCapability numeric row by index.
| profile | SPIR-V target profile to query. |
| index | Zero-based capability row index. |
| out_capability | Receives the SPIR-V capability enumerant value. |
| loomc_status_t loomc_spirv_target_profile_cooperative_matrix_row_at | ( | const loomc_target_profile_t * | profile, |
| loomc_host_size_t | index, | ||
| loomc_spirv_cooperative_matrix_row_t * | out_row ) |
Returns a cooperative matrix fact row by index.
| profile | SPIR-V target profile to query. |
| index | Zero-based cooperative matrix row index. |
| out_row | Receives the cooperative matrix fact row. |
| loomc_status_t loomc_spirv_target_profile_cooperative_vector_row_at | ( | const loomc_target_profile_t * | profile, |
| loomc_host_size_t | index, | ||
| loomc_spirv_cooperative_vector_row_t * | out_row ) |
Returns a cooperative vector fact row by index.
| profile | SPIR-V target profile to query. |
| index | Zero-based cooperative vector row index. |
| out_row | Receives the cooperative vector fact row. |
| loomc_status_t loomc_spirv_target_profile_decoration_at | ( | const loomc_target_profile_t * | profile, |
| loomc_host_size_t | index, | ||
| uint32_t * | out_decoration ) |
Returns a decoration numeric row by index.
| profile | SPIR-V target profile to query. |
| index | Zero-based decoration row index. |
| out_decoration | Receives the SPIR-V decoration enumerant value. |
| loomc_status_t loomc_spirv_target_profile_extension_at | ( | const loomc_target_profile_t * | profile, |
| loomc_host_size_t | index, | ||
| loomc_string_view_t * | out_extension ) |
Returns an OpExtension row by index.
| profile | SPIR-V target profile to query. |
| index | Zero-based extension row index. |
| out_extension | Receives the extension name. |
| loomc_status_t loomc_spirv_target_profile_opcode_at | ( | const loomc_target_profile_t * | profile, |
| loomc_host_size_t | index, | ||
| uint32_t * | out_opcode ) |
Returns an opcode numeric row by index.
| profile | SPIR-V target profile to query. |
| index | Zero-based opcode row index. |
| out_opcode | Receives the SPIR-V opcode enumerant value. |
| loomc_status_t loomc_spirv_target_profile_query_environment | ( | const loomc_target_profile_t * | profile, |
| loomc_spirv_environment_t | environment, | ||
| loomc_spirv_environment_value_t * | out_value ) |
Returns the known state and value for one SPIR-V environment fact.
| profile | SPIR-V target profile to query. |
| environment | Environment fact to inspect. |
| out_value | Receives the environment state and value. |
| loomc_status_t loomc_spirv_target_profile_query_feature | ( | const loomc_target_profile_t * | profile, |
| loomc_spirv_feature_t | feature, | ||
| loomc_target_fact_state_t * | out_state ) |
Returns the known state for one SPIR-V feature fact.
| profile | SPIR-V target profile to query. |
| feature | Feature fact to inspect. |
| out_state | Receives the feature state. |
| loomc_status_t loomc_spirv_target_profile_query_info | ( | const loomc_target_profile_t * | profile, |
| loomc_spirv_profile_info_t * | out_info ) |
Returns prepared SPIR-V profile summary rows.
| profile | SPIR-V target profile to query. |
| out_info | Receives counts for extension, capability, opcode, storage-class, decoration, and cooperative operation rows. |
| loomc_status_t loomc_spirv_target_profile_query_limit | ( | const loomc_target_profile_t * | profile, |
| loomc_spirv_limit_t | limit, | ||
| loomc_spirv_limit_value_t * | out_value ) |
Returns the known state and value for one SPIR-V numeric limit.
| profile | SPIR-V target profile to query. |
| limit | Limit fact to inspect. |
| out_value | Receives the limit state and value. |
| loomc_status_t loomc_spirv_target_profile_refine | ( | const loomc_target_profile_t * | base_profile, |
| const loomc_spirv_profile_options_t * | options, | ||
| loomc_allocator_t | allocator, | ||
| loomc_target_profile_t ** | out_profile, | ||
| loomc_result_t ** | out_result ) |
Refines a SPIR-V target profile with additional facts.
| base_profile | Existing SPIR-V profile to refine. |
| options | Additional profile facts, or NULL to clone the base profile. |
| allocator | Host allocator used for refined profile and result storage. |
| out_profile | Receives one retained refined profile when out_result succeeds. |
| out_result | Receives one retained result describing profile refinement. |
Refinement never mutates base_profile. Known facts from base_profile are applied first, then options->preset, then explicit option facts in array order. Repeating the same fact is accepted when the known state and value match. Contradictory facts fail out_result and preserve provenance from both the base fact and the refining fact. Empty options->identifier carries the base profile identifier into the refined profile.
| loomc_status_t loomc_spirv_target_profile_storage_class_at | ( | const loomc_target_profile_t * | profile, |
| loomc_host_size_t | index, | ||
| uint32_t * | out_storage_class ) |
Returns a storage-class numeric row by index.
| profile | SPIR-V target profile to query. |
| index | Zero-based storage-class row index. |
| out_storage_class | Receives the SPIR-V storage-class enumerant value. |
| loomc_status_t loomc_target_profile_create_spirv | ( | loomc_target_environment_t * | target_environment, |
| const loomc_spirv_profile_options_t * | options, | ||
| loomc_allocator_t | allocator, | ||
| loomc_target_profile_t ** | out_profile, | ||
| loomc_result_t ** | out_result ) |
Creates a reusable SPIR-V target profile.
| target_environment | SPIR-V-capable target environment. |
| options | Profile facts, or NULL for an empty partial profile. |
| allocator | Host allocator used for profile and result storage. |
| out_profile | Receives one retained profile when out_result succeeds. |
| out_result | Receives one retained result describing profile preparation. |
When known-true facts select the Vulkan 1.3 physical-storage-buffer profile, the returned target profile contains a compiler-facing target bundle whose snapshot includes known numeric limit facts. More partial profiles still carry SPIR-V target data, but let source IR target records select the compiler target snapshot.