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

AMDGPU target profile facts. More...

Go to the source code of this file.

Data Structures

struct  loomc_amdgpu_amdhsa_feature_states_t
 Structured AMDHSA target-ID feature states. More...
struct  loomc_amdgpu_target_identity_t
 Complete structured AMDGPU identity used to construct a target profile. More...
struct  loomc_amdgpu_profile_options_t
 AMDGPU target profile creation options. More...

Enumerations

enum  loomc_amdgpu_target_feature_state_t { LOOMC_AMDGPU_TARGET_FEATURE_ANY = 0 , LOOMC_AMDGPU_TARGET_FEATURE_UNSUPPORTED = 1 , LOOMC_AMDGPU_TARGET_FEATURE_OFF = 2 , LOOMC_AMDGPU_TARGET_FEATURE_ON = 3 }
 Normalized state of one AMDHSA target-ID feature. More...

Functions

loomc_status_t loomc_target_profile_create_amdgpu (loomc_target_environment_t *target_environment, const loomc_amdgpu_profile_options_t *options, loomc_allocator_t allocator, loomc_target_profile_t **out_profile)
 Creates an AMDGPU target profile from a canonical target selector.
loomc_status_t loomc_amdgpu_target_profile_query_identity (const loomc_target_profile_t *profile, loomc_amdgpu_target_identity_t *out_identity)
 Returns the complete identity selected by an AMDGPU target profile.
loomc_status_t loomc_amdgpu_target_identity_from_hsa_isa_name (loomc_string_view_t hsa_isa_name, uint32_t asic_revision, loomc_amdgpu_target_identity_t *out_identity)
 Resolves an HSA ISA name and physical ASIC revision to an AMDGPU identity.

Detailed Description

AMDGPU target profile facts.

The AMDGPU public profile selects one exact, generic, or overlay AMDGPU target such as gfx1151, gfx11-generic, or gfx1250-a0. Each target binds a backend processor to all semantic overlays required to compile for that target. The profile determines the descriptor-family target bundle, native HSACO support, default wavefront size, HSA target id, and target-record family used by compilation and emission. Live HSA/HIP/HRX adapters resolve their physical device observations to a canonical target and then create a normal loomc_target_profile_t.

Enumeration Type Documentation

◆ loomc_amdgpu_target_feature_state_t

Normalized state of one AMDHSA target-ID feature.

Enumerator
LOOMC_AMDGPU_TARGET_FEATURE_ANY 

The target identity does not constrain the feature.

LOOMC_AMDGPU_TARGET_FEATURE_UNSUPPORTED 

The selected target is known not to support the feature.

LOOMC_AMDGPU_TARGET_FEATURE_OFF 

The feature is explicitly disabled, such as xnack-.

LOOMC_AMDGPU_TARGET_FEATURE_ON 

The feature is explicitly enabled, such as sramecc+.

Function Documentation

◆ loomc_amdgpu_target_identity_from_hsa_isa_name()

loomc_status_t loomc_amdgpu_target_identity_from_hsa_isa_name ( loomc_string_view_t hsa_isa_name,
uint32_t asic_revision,
loomc_amdgpu_target_identity_t * out_identity )

Resolves an HSA ISA name and physical ASIC revision to an AMDGPU identity.

HSA agents report ISA names such as amdgcn-amd-amdhsa--gfx942:sramecc+:xnack-. The adapter preserves every structured target-ID feature and resolves the physical processor and ASIC revision through Loom's generated target map. The resulting identity uses a canonical target selector and carries no independent revision coordinate.

Parameters
hsa_isa_nameHSA ISA target id reported by the runtime.
asic_revisionPhysical ASIC revision reported by HSA.
out_identityReceives the structured AMDGPU target identity.
Returns
OK when the target id names a known processor and its physical observation maps to a supported canonical target.
Lifetime
out_identity->target is owned by Loom's static AMDGPU target tables and remains valid for the lifetime of the process.

◆ loomc_amdgpu_target_profile_query_identity()

loomc_status_t loomc_amdgpu_target_profile_query_identity ( const loomc_target_profile_t * profile,
loomc_amdgpu_target_identity_t * out_identity )

Returns the complete identity selected by an AMDGPU target profile.

Parameters
profileAMDGPU target profile to query.
out_identityReceives the structured AMDGPU identity.
Returns
OK when profile is an AMDGPU target profile.
Lifetime
out_identity->target remains valid until profile is released.

◆ loomc_target_profile_create_amdgpu()

loomc_status_t loomc_target_profile_create_amdgpu ( loomc_target_environment_t * target_environment,
const loomc_amdgpu_profile_options_t * options,
loomc_allocator_t allocator,
loomc_target_profile_t ** out_profile )

Creates an AMDGPU target profile from a canonical target selector.

Parameters
target_environmentAMDGPU-capable target environment.
optionsProfile options. Required.
allocatorHost allocator used for profile storage.
out_profileReceives one retained profile on success.
Returns
OK when the target is known, HSACO-capable, and has a supported Loom descriptor-family bundle.
Ownership
The caller owns the returned profile and releases it with loomc_target_profile_release.