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

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.

Enumerations

enum  loomc_spirv_feature_t {
  LOOMC_SPIRV_FEATURE_UNKNOWN = 0 , LOOMC_SPIRV_FEATURE_VULKAN_SHADER = 1 , LOOMC_SPIRV_FEATURE_PHYSICAL_STORAGE_BUFFER = 2 , LOOMC_SPIRV_FEATURE_FLOAT16 = 3 ,
  LOOMC_SPIRV_FEATURE_FLOAT64 = 4 , LOOMC_SPIRV_FEATURE_INT8 = 5 , LOOMC_SPIRV_FEATURE_INT16 = 6 , LOOMC_SPIRV_FEATURE_STORAGE_BUFFER_8BIT_ACCESS = 7 ,
  LOOMC_SPIRV_FEATURE_STORAGE_BUFFER_16BIT_ACCESS = 8 , LOOMC_SPIRV_FEATURE_COOPERATIVE_VECTOR_NV = 9 , LOOMC_SPIRV_FEATURE_COOPERATIVE_VECTOR_TRAINING_NV = 10 , LOOMC_SPIRV_FEATURE_COOPERATIVE_MATRIX_KHR = 11 ,
  LOOMC_SPIRV_FEATURE_BFLOAT16_TYPE_KHR = 12 , LOOMC_SPIRV_FEATURE_BFLOAT16_DOT_PRODUCT_KHR = 13 , LOOMC_SPIRV_FEATURE_BFLOAT16_COOPERATIVE_MATRIX_KHR = 14 , LOOMC_SPIRV_FEATURE_INT64 = 15 ,
  LOOMC_SPIRV_FEATURE_COUNT = 16
}
 Stable SPIR-V feature fact identifier. More...
enum  loomc_spirv_limit_t {
  LOOMC_SPIRV_LIMIT_UNKNOWN = 0 , LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_SIZE_X = 1 , LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_SIZE_Y = 2 , LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_SIZE_Z = 3 ,
  LOOMC_SPIRV_LIMIT_MAX_FLAT_WORKGROUP_SIZE = 4 , LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_STORAGE_BYTES = 5 , LOOMC_SPIRV_LIMIT_SUBGROUP_SIZE = 6 , LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_COUNT_X = 7 ,
  LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_COUNT_Y = 8 , LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_COUNT_Z = 9 , LOOMC_SPIRV_LIMIT_MAX_GRID_SIZE_X = 10 , LOOMC_SPIRV_LIMIT_MAX_GRID_SIZE_Y = 11 ,
  LOOMC_SPIRV_LIMIT_MAX_GRID_SIZE_Z = 12 , LOOMC_SPIRV_LIMIT_MAX_FLAT_GRID_SIZE = 13 , LOOMC_SPIRV_LIMIT_COUNT = 14
}
 Stable SPIR-V numeric limit fact identifier. More...
enum  loomc_spirv_environment_t { LOOMC_SPIRV_ENVIRONMENT_UNKNOWN = 0 , LOOMC_SPIRV_ENVIRONMENT_MAX_SPIRV_VERSION = 1 , LOOMC_SPIRV_ENVIRONMENT_COUNT = 2 }
 Stable SPIR-V numeric environment fact identifier. More...
enum  loomc_spirv_scalar_type_t {
  LOOMC_SPIRV_SCALAR_TYPE_UNKNOWN = 0 , LOOMC_SPIRV_SCALAR_TYPE_F16 = 1 , LOOMC_SPIRV_SCALAR_TYPE_F32 = 2 , LOOMC_SPIRV_SCALAR_TYPE_F64 = 3 ,
  LOOMC_SPIRV_SCALAR_TYPE_BF16 = 4 , LOOMC_SPIRV_SCALAR_TYPE_S8 = 5 , LOOMC_SPIRV_SCALAR_TYPE_S16 = 6 , LOOMC_SPIRV_SCALAR_TYPE_S32 = 7 ,
  LOOMC_SPIRV_SCALAR_TYPE_S64 = 8 , LOOMC_SPIRV_SCALAR_TYPE_U8 = 9 , LOOMC_SPIRV_SCALAR_TYPE_U16 = 10 , LOOMC_SPIRV_SCALAR_TYPE_U32 = 11 ,
  LOOMC_SPIRV_SCALAR_TYPE_U64 = 12
}
 SPIR-V semantic scalar type fact. More...
enum  loomc_spirv_scope_t {
  LOOMC_SPIRV_SCOPE_CROSS_DEVICE = 0 , LOOMC_SPIRV_SCOPE_DEVICE = 1 , LOOMC_SPIRV_SCOPE_WORKGROUP = 2 , LOOMC_SPIRV_SCOPE_SUBGROUP = 3 ,
  LOOMC_SPIRV_SCOPE_INVOCATION = 4 , LOOMC_SPIRV_SCOPE_QUEUE_FAMILY = 5 , LOOMC_SPIRV_SCOPE_SHADER_CALL_KHR = 6
}
 SPIR-V Scope operand values used by public profile fact rows. More...
enum  loomc_spirv_cooperative_matrix_layout_flag_bits_t { LOOMC_SPIRV_COOPERATIVE_MATRIX_LAYOUT_ROW_MAJOR_BIT = 1u << 0 , LOOMC_SPIRV_COOPERATIVE_MATRIX_LAYOUT_COLUMN_MAJOR_BIT = 1u << 1 }
 Cooperative matrix layout fact bits. More...
enum  loomc_spirv_cooperative_matrix_operand_flag_bits_t {
  LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_A_SIGNED_COMPONENTS = 1u << 0 , LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_B_SIGNED_COMPONENTS = 1u << 1 , LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_C_SIGNED_COMPONENTS = 1u << 2 , LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_RESULT_SIGNED_COMPONENTS = 1u << 3 ,
  LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_SATURATING_ACCUMULATION = 1u << 4
}
 Cooperative matrix operand fact bits. More...
enum  loomc_spirv_component_type_t {
  LOOMC_SPIRV_COMPONENT_TYPE_FLOAT16_NV = 0 , LOOMC_SPIRV_COMPONENT_TYPE_FLOAT32_NV = 1 , LOOMC_SPIRV_COMPONENT_TYPE_FLOAT64_NV = 2 , LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT8_NV = 3 ,
  LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT16_NV = 4 , LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT32_NV = 5 , LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT64_NV = 6 , LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT8_NV = 7 ,
  LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT16_NV = 8 , LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT32_NV = 9 , LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT64_NV = 10 , LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT8_PACKED_NV = 1000491000 ,
  LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT8_PACKED_NV = 1000491001 , LOOMC_SPIRV_COMPONENT_TYPE_FLOAT_E4_M3_NV = 1000491002 , LOOMC_SPIRV_COMPONENT_TYPE_FLOAT_E5_M2_NV = 1000491003
}
 SPIR-V cooperative vector ComponentType operand values. More...
enum  loomc_spirv_cooperative_vector_matrix_layout_flag_bits_t { LOOMC_SPIRV_COOPERATIVE_VECTOR_MATRIX_LAYOUT_ROW_MAJOR_BIT = 1u << 0 , LOOMC_SPIRV_COOPERATIVE_VECTOR_MATRIX_LAYOUT_COLUMN_MAJOR_BIT = 1u << 1 , LOOMC_SPIRV_COOPERATIVE_VECTOR_MATRIX_LAYOUT_INFERENCING_OPTIMAL_BIT , LOOMC_SPIRV_COOPERATIVE_VECTOR_MATRIX_LAYOUT_TRAINING_OPTIMAL_BIT = 1u << 3 }
 Cooperative vector matrix-layout fact bits. More...
enum  loomc_spirv_cooperative_vector_flag_bits_t { LOOMC_SPIRV_COOPERATIVE_VECTOR_FLAG_TRANSPOSE = 1u << 0 , LOOMC_SPIRV_COOPERATIVE_VECTOR_FLAG_TRAINING = 1u << 1 }
 Cooperative vector behavior fact bits. More...
enum  loomc_spirv_storage_class_flag_bits_t { LOOMC_SPIRV_STORAGE_CLASS_BIT_WORKGROUP = 1u << 0 , LOOMC_SPIRV_STORAGE_CLASS_BIT_STORAGE_BUFFER = 1u << 1 , LOOMC_SPIRV_STORAGE_CLASS_BIT_PHYSICAL_STORAGE_BUFFER = 1u << 2 }
 Storage-class fact bits used by cooperative operation rows. More...
enum  loomc_spirv_profile_preset_t { LOOMC_SPIRV_PROFILE_PRESET_NONE = 0 , LOOMC_SPIRV_PROFILE_PRESET_VULKAN_1_3_BDA = 1 }
 Built-in SPIR-V profile preset. More...

Functions

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.

Detailed Description

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.

Example
Create a reusable Vulkan-style SPIR-V target profile:
{
.provenance = loomc_make_cstring_view("vulkaninfo:shaderFloat16"),
},
};
{
.value = 1024,
.provenance =
loomc_make_cstring_view("vulkaninfo:maxComputeWorkGroupSize[0]"),
},
};
{
.provenance = loomc_make_cstring_view("vulkaninfo:apiVersion"),
},
};
.structure_size = sizeof(loomc_spirv_profile_options_t),
.identifier = loomc_make_cstring_view("offline-vulkan13"),
.feature_facts = facts,
.feature_fact_count = 1,
.limit_facts = limits,
.limit_fact_count = 1,
.environment_facts = environment,
.environment_fact_count = 1,
};
loomc_target_profile_t* profile = NULL;
loomc_result_t* result = NULL;
target_environment, &options, loomc_allocator_system(), &profile,
&result);
if (!loomc_status_is_ok(status)) return status;
if (!loomc_result_succeeded(result)) {
// Inspect structured diagnostics; profile is NULL on profile failure.
}
loomc_allocator_t loomc_allocator_system(void)
Returns a process-global system allocator.
@ LOOMC_STRUCTURE_TYPE_SPIRV_PROFILE_OPTIONS
loomc_spirv_profile_options_t.
Definition base.h:231
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
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
@ LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_SIZE_X
Maximum local workgroup size along the x dimension.
Definition spirv/profile.h:209
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.
@ LOOMC_SPIRV_ENVIRONMENT_MAX_SPIRV_VERSION
Maximum SPIR-V binary version accepted by the target.
Definition spirv/profile.h:261
@ LOOMC_SPIRV_FEATURE_FLOAT16
16-bit floating-point scalar support.
Definition spirv/profile.h:102
#define LOOMC_SPIRV_VERSION_1_3
SPIR-V 1.3 binary version word.
Definition spirv/profile.h:161
@ LOOMC_SPIRV_PROFILE_PRESET_VULKAN_1_3_BDA
Vulkan 1.3 shader profile with physical-storage-buffer addressing.
Definition spirv/profile.h:472
One SPIR-V environment observation.
Definition spirv/profile.h:512
One SPIR-V feature observation.
Definition spirv/profile.h:476
One SPIR-V numeric limit observation.
Definition spirv/profile.h:488
SPIR-V target profile creation options.
Definition spirv/profile.h:544
@ LOOMC_TARGET_FACT_STATE_TRUE
The fact is known to be available or true.
Definition target.h:150
struct loomc_target_profile_t loomc_target_profile_t
Prepared immutable target profile.
Definition target.h:135

Macro Definition Documentation

◆ LOOMC_SPIRV_VERSION

#define LOOMC_SPIRV_VERSION ( major,
minor )
Value:
((((uint32_t)(major)) << 16) | (((uint32_t)(minor)) << 8))

Encodes a SPIR-V binary version word.

Enumeration Type Documentation

◆ loomc_spirv_component_type_t

SPIR-V cooperative vector ComponentType operand values.

Enumerator
LOOMC_SPIRV_COMPONENT_TYPE_FLOAT16_NV 

Float16NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_FLOAT32_NV 

Float32NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_FLOAT64_NV 

Float64NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT8_NV 

SignedInt8NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT16_NV 

SignedInt16NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT32_NV 

SignedInt32NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT64_NV 

SignedInt64NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT8_NV 

UnsignedInt8NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT16_NV 

UnsignedInt16NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT32_NV 

UnsignedInt32NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT64_NV 

UnsignedInt64NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_SIGNED_INT8_PACKED_NV 

SignedInt8PackedNV component type.

LOOMC_SPIRV_COMPONENT_TYPE_UNSIGNED_INT8_PACKED_NV 

UnsignedInt8PackedNV component type.

LOOMC_SPIRV_COMPONENT_TYPE_FLOAT_E4_M3_NV 

FloatE4M3NV component type.

LOOMC_SPIRV_COMPONENT_TYPE_FLOAT_E5_M2_NV 

FloatE5M2NV component type.

◆ loomc_spirv_cooperative_matrix_layout_flag_bits_t

Cooperative matrix layout fact bits.

Enumerator
LOOMC_SPIRV_COOPERATIVE_MATRIX_LAYOUT_ROW_MAJOR_BIT 

RowMajorKHR layout is accepted.

LOOMC_SPIRV_COOPERATIVE_MATRIX_LAYOUT_COLUMN_MAJOR_BIT 

ColumnMajorKHR layout is accepted.

◆ loomc_spirv_cooperative_matrix_operand_flag_bits_t

Cooperative matrix operand fact bits.

Enumerator
LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_A_SIGNED_COMPONENTS 

Matrix A signed-components operand is required.

LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_B_SIGNED_COMPONENTS 

Matrix B signed-components operand is required.

LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_C_SIGNED_COMPONENTS 

Matrix C signed-components operand is required.

LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_RESULT_SIGNED_COMPONENTS 

Matrix result signed-components operand is required.

LOOMC_SPIRV_COOPERATIVE_MATRIX_OPERAND_SATURATING_ACCUMULATION 

Saturating accumulation operand is required.

◆ loomc_spirv_cooperative_vector_flag_bits_t

Cooperative vector behavior fact bits.

Enumerator
LOOMC_SPIRV_COOPERATIVE_VECTOR_FLAG_TRANSPOSE 

Transposed opaque matrix layout is accepted.

LOOMC_SPIRV_COOPERATIVE_VECTOR_FLAG_TRAINING 

Row is intended for training operations rather than inference only.

◆ loomc_spirv_cooperative_vector_matrix_layout_flag_bits_t

Cooperative vector matrix-layout fact bits.

Enumerator
LOOMC_SPIRV_COOPERATIVE_VECTOR_MATRIX_LAYOUT_ROW_MAJOR_BIT 

RowMajorNV layout is accepted.

LOOMC_SPIRV_COOPERATIVE_VECTOR_MATRIX_LAYOUT_COLUMN_MAJOR_BIT 

ColumnMajorNV layout is accepted.

LOOMC_SPIRV_COOPERATIVE_VECTOR_MATRIX_LAYOUT_INFERENCING_OPTIMAL_BIT 

InferencingOptimalNV layout is accepted.

LOOMC_SPIRV_COOPERATIVE_VECTOR_MATRIX_LAYOUT_TRAINING_OPTIMAL_BIT 

TrainingOptimalNV layout is accepted.

◆ loomc_spirv_environment_t

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.

Enumerator
LOOMC_SPIRV_ENVIRONMENT_UNKNOWN 

Unknown or uninitialized environment fact.

LOOMC_SPIRV_ENVIRONMENT_MAX_SPIRV_VERSION 

Maximum SPIR-V binary version accepted by the target.

LOOMC_SPIRV_ENVIRONMENT_COUNT 

Number of public SPIR-V environment identifiers.

◆ loomc_spirv_feature_t

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.

Enumerator
LOOMC_SPIRV_FEATURE_UNKNOWN 

Unknown or uninitialized feature.

LOOMC_SPIRV_FEATURE_VULKAN_SHADER 

Vulkan shader-module baseline.

LOOMC_SPIRV_FEATURE_PHYSICAL_STORAGE_BUFFER 

SPV_KHR_physical_storage_buffer support.

LOOMC_SPIRV_FEATURE_FLOAT16 

16-bit floating-point scalar support.

LOOMC_SPIRV_FEATURE_FLOAT64 

64-bit floating-point scalar support.

LOOMC_SPIRV_FEATURE_INT8 

8-bit integer scalar support.

LOOMC_SPIRV_FEATURE_INT16 

16-bit integer scalar support.

LOOMC_SPIRV_FEATURE_STORAGE_BUFFER_8BIT_ACCESS 

8-bit storage-buffer access support.

LOOMC_SPIRV_FEATURE_STORAGE_BUFFER_16BIT_ACCESS 

16-bit storage-buffer access support.

LOOMC_SPIRV_FEATURE_COOPERATIVE_VECTOR_NV 

SPV_NV_cooperative_vector support.

LOOMC_SPIRV_FEATURE_COOPERATIVE_VECTOR_TRAINING_NV 

SPV_NV_cooperative_vector training-operation support.

LOOMC_SPIRV_FEATURE_COOPERATIVE_MATRIX_KHR 

SPV_KHR_cooperative_matrix support.

LOOMC_SPIRV_FEATURE_BFLOAT16_TYPE_KHR 

SPV_KHR_bfloat16 scalar type support.

LOOMC_SPIRV_FEATURE_BFLOAT16_DOT_PRODUCT_KHR 

SPV_KHR_bfloat16 dot-product support.

LOOMC_SPIRV_FEATURE_BFLOAT16_COOPERATIVE_MATRIX_KHR 

SPV_KHR_bfloat16 cooperative-matrix support.

LOOMC_SPIRV_FEATURE_INT64 

64-bit integer scalar support.

LOOMC_SPIRV_FEATURE_COUNT 

Number of public SPIR-V feature identifiers.

◆ 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.

Enumerator
LOOMC_SPIRV_LIMIT_UNKNOWN 

Unknown or uninitialized limit.

LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_SIZE_X 

Maximum local workgroup size along the x dimension.

LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_SIZE_Y 

Maximum local workgroup size along the y dimension.

LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_SIZE_Z 

Maximum local workgroup size along the z dimension.

LOOMC_SPIRV_LIMIT_MAX_FLAT_WORKGROUP_SIZE 

Maximum product of local workgroup dimensions.

LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_STORAGE_BYTES 

Maximum bytes reserved in SPIR-V Workgroup storage by one entry point.

LOOMC_SPIRV_LIMIT_SUBGROUP_SIZE 

Fixed target-wide subgroup size in invocations.

LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_COUNT_X 

Maximum dispatched workgroup count along the x dimension.

LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_COUNT_Y 

Maximum dispatched workgroup count along the y dimension.

LOOMC_SPIRV_LIMIT_MAX_WORKGROUP_COUNT_Z 

Maximum dispatched workgroup count along the z dimension.

LOOMC_SPIRV_LIMIT_MAX_GRID_SIZE_X 

Maximum dispatched grid size along the x dimension, in workitems.

LOOMC_SPIRV_LIMIT_MAX_GRID_SIZE_Y 

Maximum dispatched grid size along the y dimension, in workitems.

LOOMC_SPIRV_LIMIT_MAX_GRID_SIZE_Z 

Maximum dispatched grid size along the z dimension, in workitems.

LOOMC_SPIRV_LIMIT_MAX_FLAT_GRID_SIZE 

Maximum product of dispatched grid dimensions, in workitems.

LOOMC_SPIRV_LIMIT_COUNT 

Number of public SPIR-V limit identifiers.

◆ loomc_spirv_profile_preset_t

Built-in SPIR-V profile preset.

Enumerator
LOOMC_SPIRV_PROFILE_PRESET_NONE 

No preset facts.

LOOMC_SPIRV_PROFILE_PRESET_VULKAN_1_3_BDA 

Vulkan 1.3 shader profile with physical-storage-buffer addressing.

◆ loomc_spirv_scalar_type_t

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.

Enumerator
LOOMC_SPIRV_SCALAR_TYPE_UNKNOWN 

Unknown or uninitialized scalar type.

LOOMC_SPIRV_SCALAR_TYPE_F16 

IEEE binary16 floating-point scalar type.

LOOMC_SPIRV_SCALAR_TYPE_F32 

IEEE binary32 floating-point scalar type.

LOOMC_SPIRV_SCALAR_TYPE_F64 

IEEE binary64 floating-point scalar type.

LOOMC_SPIRV_SCALAR_TYPE_BF16 

KHR bfloat16 scalar type.

LOOMC_SPIRV_SCALAR_TYPE_S8 

Signed 8-bit integer scalar type.

LOOMC_SPIRV_SCALAR_TYPE_S16 

Signed 16-bit integer scalar type.

LOOMC_SPIRV_SCALAR_TYPE_S32 

Signed 32-bit integer scalar type.

LOOMC_SPIRV_SCALAR_TYPE_S64 

Signed 64-bit integer scalar type.

LOOMC_SPIRV_SCALAR_TYPE_U8 

Unsigned 8-bit integer scalar type.

LOOMC_SPIRV_SCALAR_TYPE_U16 

Unsigned 16-bit integer scalar type.

LOOMC_SPIRV_SCALAR_TYPE_U32 

Unsigned 32-bit integer scalar type.

LOOMC_SPIRV_SCALAR_TYPE_U64 

Unsigned 64-bit integer scalar type.

◆ loomc_spirv_scope_t

SPIR-V Scope operand values used by public profile fact rows.

Enumerator
LOOMC_SPIRV_SCOPE_CROSS_DEVICE 

CrossDevice scope.

LOOMC_SPIRV_SCOPE_DEVICE 

Device scope.

LOOMC_SPIRV_SCOPE_WORKGROUP 

Workgroup scope.

LOOMC_SPIRV_SCOPE_SUBGROUP 

Subgroup scope.

LOOMC_SPIRV_SCOPE_INVOCATION 

Invocation scope.

LOOMC_SPIRV_SCOPE_QUEUE_FAMILY 

QueueFamily scope.

LOOMC_SPIRV_SCOPE_SHADER_CALL_KHR 

ShaderCallKHR scope.

◆ loomc_spirv_storage_class_flag_bits_t

Storage-class fact bits used by cooperative operation rows.

Enumerator
LOOMC_SPIRV_STORAGE_CLASS_BIT_WORKGROUP 

Workgroup storage class is accepted.

LOOMC_SPIRV_STORAGE_CLASS_BIT_STORAGE_BUFFER 

StorageBuffer storage class is accepted.

LOOMC_SPIRV_STORAGE_CLASS_BIT_PHYSICAL_STORAGE_BUFFER 

PhysicalStorageBuffer storage class is accepted.

Function Documentation

◆ loomc_spirv_target_profile_capability_at()

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.

Parameters
profileSPIR-V target profile to query.
indexZero-based capability row index.
out_capabilityReceives the SPIR-V capability enumerant value.
Returns
OK when the capability row was returned.

◆ loomc_spirv_target_profile_cooperative_matrix_row_at()

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.

Parameters
profileSPIR-V target profile to query.
indexZero-based cooperative matrix row index.
out_rowReceives the cooperative matrix fact row.
Returns
OK when the cooperative matrix row was returned.
Lifetime
The returned string view remains valid until profile is released.

◆ loomc_spirv_target_profile_cooperative_vector_row_at()

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.

Parameters
profileSPIR-V target profile to query.
indexZero-based cooperative vector row index.
out_rowReceives the cooperative vector fact row.
Returns
OK when the cooperative vector row was returned.
Lifetime
The returned string view remains valid until profile is released.

◆ loomc_spirv_target_profile_decoration_at()

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.

Parameters
profileSPIR-V target profile to query.
indexZero-based decoration row index.
out_decorationReceives the SPIR-V decoration enumerant value.
Returns
OK when the decoration row was returned.

◆ loomc_spirv_target_profile_extension_at()

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.

Parameters
profileSPIR-V target profile to query.
indexZero-based extension row index.
out_extensionReceives the extension name.
Returns
OK when the extension row was returned.
Lifetime
The returned string view remains valid until profile is released.

◆ loomc_spirv_target_profile_opcode_at()

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.

Parameters
profileSPIR-V target profile to query.
indexZero-based opcode row index.
out_opcodeReceives the SPIR-V opcode enumerant value.
Returns
OK when the opcode row was returned.

◆ loomc_spirv_target_profile_query_environment()

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.

Parameters
profileSPIR-V target profile to query.
environmentEnvironment fact to inspect.
out_valueReceives the environment state and value.
Returns
OK when the environment state was returned.

◆ loomc_spirv_target_profile_query_feature()

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.

Parameters
profileSPIR-V target profile to query.
featureFeature fact to inspect.
out_stateReceives the feature state.
Returns
OK when the feature state was returned.

◆ loomc_spirv_target_profile_query_info()

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.

Parameters
profileSPIR-V target profile to query.
out_infoReceives counts for extension, capability, opcode, storage-class, decoration, and cooperative operation rows.
Returns
OK when summary information was returned.

◆ loomc_spirv_target_profile_query_limit()

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.

Parameters
profileSPIR-V target profile to query.
limitLimit fact to inspect.
out_valueReceives the limit state and value.
Returns
OK when the limit state was returned.

◆ loomc_spirv_target_profile_refine()

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.

Parameters
base_profileExisting SPIR-V profile to refine.
optionsAdditional profile facts, or NULL to clone the base profile.
allocatorHost allocator used for refined profile and result storage.
out_profileReceives one retained refined profile when out_result succeeds.
out_resultReceives one retained result describing profile refinement.
Returns
OK when refinement completed far enough to report a result. Non-OK statuses represent API misuse or infrastructure failures before a result could be produced.

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.

Ownership
The caller owns out_profile when the returned result succeeds and releases it with loomc_target_profile_release. The caller always owns out_result on an OK return and releases it with loomc_result_release.
Thread safety
Refinement reads the immutable base profile and may run concurrently with other queries or refinements of the same profile.

◆ loomc_spirv_target_profile_storage_class_at()

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.

Parameters
profileSPIR-V target profile to query.
indexZero-based storage-class row index.
out_storage_classReceives the SPIR-V storage-class enumerant value.
Returns
OK when the storage-class row was returned.

◆ loomc_target_profile_create_spirv()

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.

Parameters
target_environmentSPIR-V-capable target environment.
optionsProfile facts, or NULL for an empty partial profile.
allocatorHost allocator used for profile and result storage.
out_profileReceives one retained profile when out_result succeeds.
out_resultReceives one retained result describing profile preparation.
Returns
OK when profile preparation completed far enough to report a result. Non-OK statuses represent API misuse or infrastructure failures before a result could be produced.

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.

Ownership
The caller owns out_profile when the returned result succeeds and releases it with loomc_target_profile_release. The caller always owns out_result on an OK return and releases it with loomc_result_release.
Thread safety
Created profiles are immutable and may be shared across threads.