gem5 v24.0.0.0
|
Classes | |
struct | hsa_agent_s |
Struct containing an opaque handle to an agent, a device that participates in the HSA memory model. More... | |
struct | hsa_cache_s |
Cache handle. More... | |
Typedefs | |
typedef struct hsa_agent_s | hsa_agent_t |
Struct containing an opaque handle to an agent, a device that participates in the HSA memory model. | |
typedef struct hsa_cache_s | hsa_cache_t |
Cache handle. | |
Functions | |
hsa_status_t HSA_API | hsa_system_get_info (hsa_system_info_t attribute, void *value) |
Get the current value of a system attribute. | |
hsa_status_t HSA_API | hsa_extension_get_name (uint16_t extension, const char **name) |
Query the name of a given extension. | |
hsa_status_t HSA_API HSA_DEPRECATED | hsa_system_extension_supported (uint16_t extension, uint16_t version_major, uint16_t version_minor, bool *result) |
Query if a given version of an extension is supported by the HSA implementation. | |
hsa_status_t HSA_API | hsa_system_major_extension_supported (uint16_t extension, uint16_t version_major, uint16_t *version_minor, bool *result) |
Query if a given version of an extension is supported by the HSA implementation. | |
hsa_status_t HSA_API HSA_DEPRECATED | hsa_system_get_extension_table (uint16_t extension, uint16_t version_major, uint16_t version_minor, void *table) |
Retrieve the function pointers corresponding to a given version of an extension. Portable applications are expected to invoke the extension API using the returned function pointers. | |
hsa_status_t HSA_API | hsa_system_get_major_extension_table (uint16_t extension, uint16_t version_major, size_t table_length, void *table) |
Retrieve the function pointers corresponding to a given major version of an extension. | |
hsa_status_t HSA_API | hsa_agent_get_info (hsa_agent_t agent, hsa_agent_info_t attribute, void *value) |
Get the current value of an attribute for a given agent. | |
hsa_status_t HSA_API | hsa_iterate_agents (hsa_status_t(*callback)(hsa_agent_t agent, void *data), void *data) |
Iterate over the available agents, and invoke an application-defined callback on every iteration. | |
hsa_status_t HSA_API HSA_DEPRECATED | hsa_agent_get_exception_policies (hsa_agent_t agent, hsa_profile_t profile, uint16_t *mask) |
Retrieve the exception policy support for a given combination of agent and profile. | |
hsa_status_t HSA_API | hsa_cache_get_info (hsa_cache_t cache, hsa_cache_info_t attribute, void *value) |
Get the current value of an attribute for a given cache object. | |
hsa_status_t HSA_API | hsa_agent_iterate_caches (hsa_agent_t agent, hsa_status_t(*callback)(hsa_cache_t cache, void *data), void *data) |
Iterate over the memory caches of a given agent, and invoke an application-defined callback on every iteration. | |
hsa_status_t HSA_API HSA_DEPRECATED | hsa_agent_extension_supported (uint16_t extension, hsa_agent_t agent, uint16_t version_major, uint16_t version_minor, bool *result) |
Query if a given version of an extension is supported by an agent. | |
hsa_status_t HSA_API | hsa_agent_major_extension_supported (uint16_t extension, hsa_agent_t agent, uint16_t version_major, uint16_t *version_minor, bool *result) |
Query if a given version of an extension is supported by an agent. | |
typedef struct hsa_agent_s hsa_agent_t |
Struct containing an opaque handle to an agent, a device that participates in the HSA memory model.
An agent can submit AQL packets for execution, and may also accept AQL packets for execution (agent dispatch packets or kernel dispatch packets launching HSAIL-derived binaries).
typedef struct hsa_cache_s hsa_cache_t |
Cache handle.
enum hsa_agent_feature_t |
enum hsa_agent_info_t |
Agent attributes.
Enumerator | |
---|---|
HSA_AGENT_INFO_NAME | Agent name. The type of this attribute is a NUL-terminated char[64]. The name must be at most 63 characters long (not including the NUL terminator) and all array elements not used for the name must be NUL. |
HSA_AGENT_INFO_VENDOR_NAME | Name of vendor. The type of this attribute is a NUL-terminated char[64]. The name must be at most 63 characters long (not including the NUL terminator) and all array elements not used for the name must be NUL. |
HSA_AGENT_INFO_FEATURE | Agent capability. The type of this attribute is hsa_agent_feature_t. |
HSA_AGENT_INFO_MACHINE_MODEL |
Machine model supported by the agent. The type of this attribute is hsa_machine_model_t. |
HSA_AGENT_INFO_PROFILE |
Profile supported by the agent. The type of this attribute is hsa_profile_t. |
HSA_AGENT_INFO_DEFAULT_FLOAT_ROUNDING_MODE |
Default floating-point rounding mode. The type of this attribute is hsa_default_float_rounding_mode_t, but the value HSA_DEFAULT_FLOAT_ROUNDING_MODE_DEFAULT is not allowed. |
HSA_AGENT_INFO_BASE_PROFILE_DEFAULT_FLOAT_ROUNDING_MODES |
A bit-mask of hsa_default_float_rounding_mode_t values, representing the default floating-point rounding modes supported by the agent in the Base profile. The type of this attribute is uint32_t. The default floating-point rounding mode (HSA_AGENT_INFO_DEFAULT_FLOAT_ROUNDING_MODE) bit must not be set. |
HSA_AGENT_INFO_FAST_F16_OPERATION |
Flag indicating that the f16 HSAIL operation is at least as fast as the f32 operation in the current agent. The value of this attribute is undefined if the agent is not a kernel agent. The type of this attribute is bool. |
HSA_AGENT_INFO_WAVEFRONT_SIZE |
Number of work-items in a wavefront. Must be a power of 2 in the range [1,256]. The value of this attribute is undefined if the agent is not a kernel agent. The type of this attribute is uint32_t. |
HSA_AGENT_INFO_WORKGROUP_MAX_DIM |
Maximum number of work-items of each dimension of a work-group. Each maximum must be greater than 0. No maximum can exceed the value of HSA_AGENT_INFO_WORKGROUP_MAX_SIZE. The value of this attribute is undefined if the agent is not a kernel agent. The type of this attribute is uint16_t[3]. |
HSA_AGENT_INFO_WORKGROUP_MAX_SIZE |
Maximum total number of work-items in a work-group. The value of this attribute is undefined if the agent is not a kernel agent. The type of this attribute is uint32_t. |
HSA_AGENT_INFO_GRID_MAX_DIM |
Maximum number of work-items of each dimension of a grid. Each maximum must be greater than 0, and must not be smaller than the corresponding value in HSA_AGENT_INFO_WORKGROUP_MAX_DIM. No maximum can exceed the value of HSA_AGENT_INFO_GRID_MAX_SIZE. The value of this attribute is undefined if the agent is not a kernel agent. The type of this attribute is hsa_dim3_t. |
HSA_AGENT_INFO_GRID_MAX_SIZE |
Maximum total number of work-items in a grid. The value of this attribute is undefined if the agent is not a kernel agent. The type of this attribute is uint32_t. |
HSA_AGENT_INFO_FBARRIER_MAX_SIZE |
Maximum number of fbarriers per work-group. Must be at least 32. The value of this attribute is undefined if the agent is not a kernel agent. The type of this attribute is uint32_t. |
HSA_AGENT_INFO_QUEUES_MAX |
Maximum number of queues that can be active (created but not destroyed) at one time in the agent. The type of this attribute is uint32_t. |
HSA_AGENT_INFO_QUEUE_MIN_SIZE | Minimum number of packets that a queue created in the agent can hold. Must be a power of 2 greater than 0. Must not exceed the value of HSA_AGENT_INFO_QUEUE_MAX_SIZE. The type of this attribute is uint32_t. |
HSA_AGENT_INFO_QUEUE_MAX_SIZE | Maximum number of packets that a queue created in the agent can hold. Must be a power of 2 greater than 0. The type of this attribute is uint32_t. |
HSA_AGENT_INFO_QUEUE_TYPE | Type of a queue created in the agent. The type of this attribute is hsa_queue_type32_t. |
HSA_AGENT_INFO_NODE |
Identifier of the NUMA node associated with the agent. The type of this attribute is uint32_t. |
HSA_AGENT_INFO_DEVICE | Type of hardware device associated with the agent. The type of this attribute is hsa_device_type_t. |
HSA_AGENT_INFO_CACHE_SIZE |
Array of data cache sizes (L1..L4). Each size is expressed in bytes. A size of 0 for a particular level indicates that there is no cache information for that level. The type of this attribute is uint32_t[4]. |
HSA_AGENT_INFO_ISA |
Instruction set architecture of the agent. The type of this attribute is hsa_isa_t. |
HSA_AGENT_INFO_EXTENSIONS | Bit-mask indicating which extensions are supported by the agent. An extension with an ID of |
HSA_AGENT_INFO_VERSION_MAJOR | Major version of the HSA runtime specification supported by the agent. The type of this attribute is uint16_t. |
HSA_AGENT_INFO_VERSION_MINOR | Minor version of the HSA runtime specification supported by the agent. The type of this attribute is uint16_t. |
enum hsa_cache_info_t |
Cache attributes.
Enumerator | |
---|---|
HSA_CACHE_INFO_NAME_LENGTH | The length of the cache name in bytes, not including the NUL terminator. The type of this attribute is uint32_t. |
HSA_CACHE_INFO_NAME | Human-readable description. The type of this attribute is a NUL-terminated character array with the length equal to the value of HSA_CACHE_INFO_NAME_LENGTH attribute. |
HSA_CACHE_INFO_LEVEL | Cache level. A L1 cache must return a value of 1, a L2 must return a value of 2, and so on. The type of this attribute is uint8_t. |
HSA_CACHE_INFO_SIZE | Cache size, in bytes. A value of 0 indicates that there is no size information available. The type of this attribute is uint32_t. |
Default floating-point rounding mode.
enum hsa_device_type_t |
enum hsa_endianness_t |
enum hsa_extension_t |
HSA extensions.
enum hsa_machine_model_t |
enum hsa_profile_t |
Profile.
A profile indicates a particular level of feature support. For example, in the base profile the application must use the HSA runtime allocator to reserve shared virtual memory, while in the full profile any host pointer can be shared across all the agents.
Enumerator | |
---|---|
HSA_PROFILE_BASE | Base profile. |
HSA_PROFILE_FULL | Full profile. |
enum hsa_system_info_t |
System attributes.
Enumerator | |
---|---|
HSA_SYSTEM_INFO_VERSION_MAJOR | Major version of the HSA runtime specification supported by the implementation. The type of this attribute is uint16_t. |
HSA_SYSTEM_INFO_VERSION_MINOR | Minor version of the HSA runtime specification supported by the implementation. The type of this attribute is uint16_t. |
HSA_SYSTEM_INFO_TIMESTAMP | Current timestamp. The value of this attribute monotonically increases at a constant rate. The type of this attribute is uint64_t. |
HSA_SYSTEM_INFO_TIMESTAMP_FREQUENCY | Timestamp value increase rate, in Hz. The timestamp (clock) frequency is in the range 1-400MHz. The type of this attribute is uint64_t. |
HSA_SYSTEM_INFO_SIGNAL_MAX_WAIT | Maximum duration of a signal wait operation. Expressed as a count based on the timestamp frequency. The type of this attribute is uint64_t. |
HSA_SYSTEM_INFO_ENDIANNESS | Endianness of the system. The type of this attribute is hsa_endianness_t. |
HSA_SYSTEM_INFO_MACHINE_MODEL | Machine model supported by the HSA runtime. The type of this attribute is hsa_machine_model_t. |
HSA_SYSTEM_INFO_EXTENSIONS | Bit-mask indicating which extensions are supported by the implementation. An extension with an ID of |
hsa_status_t HSA_API HSA_DEPRECATED hsa_agent_extension_supported | ( | uint16_t | extension, |
hsa_agent_t | agent, | ||
uint16_t | version_major, | ||
uint16_t | version_minor, | ||
bool * | result ) |
Query if a given version of an extension is supported by an agent.
[in] | extension | Extension identifier. |
[in] | agent | Agent. |
[in] | version_major | Major version number. |
[in] | version_minor | Minor version number. |
[out] | result | Pointer to a memory location where the HSA runtime stores the result of the check. The result is true if the specified version of the extension is supported, and false otherwise. The result must be false if hsa_system_extension_supported returns false for the same extension version. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_AGENT | The agent is invalid. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | extension is not a valid extension, or result is NULL. |
hsa_status_t HSA_API HSA_DEPRECATED hsa_agent_get_exception_policies | ( | hsa_agent_t | agent, |
hsa_profile_t | profile, | ||
uint16_t * | mask ) |
Retrieve the exception policy support for a given combination of agent and profile.
[in] | agent | Agent. |
[in] | profile | Profile. |
[out] | mask | Pointer to a memory location where the HSA runtime stores a mask of hsa_exception_policy_t values. Must not be NULL. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_AGENT | The agent is invalid. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | profile is not a valid profile, or mask is NULL. |
hsa_status_t HSA_API hsa_agent_get_info | ( | hsa_agent_t | agent, |
hsa_agent_info_t | attribute, | ||
void * | value ) |
Get the current value of an attribute for a given agent.
[in] | agent | A valid agent. |
[in] | attribute | Attribute to query. |
[out] | value | Pointer to an application-allocated buffer where to store the value of the attribute. If the buffer passed by the application is not large enough to hold the value of attribute , the behavior is undefined. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_AGENT | The agent is invalid. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | attribute is an invalid agent attribute, or value is NULL. |
hsa_status_t HSA_API hsa_agent_iterate_caches | ( | hsa_agent_t | agent, |
hsa_status_t(* | callback )(hsa_cache_t cache, void *data), | ||
void * | data ) |
Iterate over the memory caches of a given agent, and invoke an application-defined callback on every iteration.
Caches are visited in ascending order according to the value of the HSA_CACHE_INFO_LEVEL attribute.
[in] | agent | A valid agent. |
[in] | callback | Callback to be invoked once per cache that is present in the agent. The HSA runtime passes two arguments to the callback: the cache and the application data. If callback returns a status other than HSA_STATUS_SUCCESS for a particular iteration, the traversal stops and that value is returned. |
[in] | data | Application data that is passed to callback on every iteration. May be NULL. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_AGENT | The agent is invalid. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | callback is NULL. |
hsa_status_t HSA_API hsa_agent_major_extension_supported | ( | uint16_t | extension, |
hsa_agent_t | agent, | ||
uint16_t | version_major, | ||
uint16_t * | version_minor, | ||
bool * | result ) |
Query if a given version of an extension is supported by an agent.
All minor versions from 0 up to the returned version_minor
must be supported.
[in] | extension | Extension identifier. |
[in] | agent | Agent. |
[in] | version_major | Major version number. |
[out] | version_minor | Minor version number. |
[out] | result | Pointer to a memory location where the HSA runtime stores the result of the check. The result is true if the specified version of the extension is supported, and false otherwise. The result must be false if hsa_system_extension_supported returns false for the same extension version. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_AGENT | The agent is invalid. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | extension is not a valid extension, or version_minor is NULL, or result is NULL. |
hsa_status_t HSA_API hsa_cache_get_info | ( | hsa_cache_t | cache, |
hsa_cache_info_t | attribute, | ||
void * | value ) |
Get the current value of an attribute for a given cache object.
[in] | cache | Cache. |
[in] | attribute | Attribute to query. |
[out] | value | Pointer to an application-allocated buffer where to store the value of the attribute. If the buffer passed by the application is not large enough to hold the value of attribute , the behavior is undefined. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_CACHE | The cache is invalid. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | attribute is an invalid instruction set architecture attribute, or value is NULL. |
hsa_status_t HSA_API hsa_extension_get_name | ( | uint16_t | extension, |
const char ** | name ) |
Query the name of a given extension.
[in] | extension | Extension identifier. If the extension is not supported by the implementation (see HSA_SYSTEM_INFO_EXTENSIONS), the behavior is undefined. |
[out] | name | Pointer to a memory location where the HSA runtime stores the extension name. The extension name is a NUL-terminated string. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | extension is not a valid extension, or name is NULL. |
hsa_status_t HSA_API hsa_iterate_agents | ( | hsa_status_t(* | callback )(hsa_agent_t agent, void *data), |
void * | data ) |
Iterate over the available agents, and invoke an application-defined callback on every iteration.
[in] | callback | Callback to be invoked once per agent. The HSA runtime passes two arguments to the callback: the agent and the application data. If callback returns a status other than HSA_STATUS_SUCCESS for a particular iteration, the traversal stops and hsa_iterate_agents returns that status value. |
[in] | data | Application data that is passed to callback on every iteration. May be NULL. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | callback is NULL. |
hsa_status_t HSA_API HSA_DEPRECATED hsa_system_extension_supported | ( | uint16_t | extension, |
uint16_t | version_major, | ||
uint16_t | version_minor, | ||
bool * | result ) |
Query if a given version of an extension is supported by the HSA implementation.
[in] | extension | Extension identifier. |
[in] | version_major | Major version number. |
[in] | version_minor | Minor version number. |
[out] | result | Pointer to a memory location where the HSA runtime stores the result of the check. The result is true if the specified version of the extension is supported, and false otherwise. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | extension is not a valid extension, or result is NULL. |
hsa_status_t HSA_API HSA_DEPRECATED hsa_system_get_extension_table | ( | uint16_t | extension, |
uint16_t | version_major, | ||
uint16_t | version_minor, | ||
void * | table ) |
Retrieve the function pointers corresponding to a given version of an extension. Portable applications are expected to invoke the extension API using the returned function pointers.
The application is responsible for verifying that the given version of the extension is supported by the HSA implementation (see hsa_system_extension_supported). If the given combination of extension, major version, and minor version is not supported by the implementation, the behavior is undefined.
[in] | extension | Extension identifier. |
[in] | version_major | Major version number for which to retrieve the function pointer table. |
[in] | version_minor | Minor version number for which to retrieve the function pointer table. |
[out] | table | Pointer to an application-allocated function pointer table that is populated by the HSA runtime. Must not be NULL. The memory associated with table can be reused or freed after the function returns. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | extension is not a valid extension, or table is NULL. |
hsa_status_t HSA_API hsa_system_get_info | ( | hsa_system_info_t | attribute, |
void * | value ) |
Get the current value of a system attribute.
[in] | attribute | Attribute to query. |
[out] | value | Pointer to an application-allocated buffer where to store the value of the attribute. If the buffer passed by the application is not large enough to hold the value of attribute , the behavior is undefined. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | attribute is an invalid system attribute, or value is NULL. |
hsa_status_t HSA_API hsa_system_get_major_extension_table | ( | uint16_t | extension, |
uint16_t | version_major, | ||
size_t | table_length, | ||
void * | table ) |
Retrieve the function pointers corresponding to a given major version of an extension.
Portable applications are expected to invoke the extension API using the returned function pointers.
The application is responsible for verifying that the given major version of the extension is supported by the HSA implementation (see hsa_system_major_extension_supported). If the given combination of extension and major version is not supported by the implementation, the behavior is undefined. Additionally if the length doesn't allow space for a full minor version, it is implementation defined if only some of the function pointers for that minor version get written.
[in] | extension | Extension identifier. |
[in] | version_major | Major version number for which to retrieve the function pointer table. |
[in] | table_length | Size in bytes of the function pointer table to be populated. The implementation will not write more than this many bytes to the table. |
[out] | table | Pointer to an application-allocated function pointer table that is populated by the HSA runtime. Must not be NULL. The memory associated with table can be reused or freed after the function returns. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | extension is not a valid extension, or table is NULL. |
hsa_status_t HSA_API hsa_system_major_extension_supported | ( | uint16_t | extension, |
uint16_t | version_major, | ||
uint16_t * | version_minor, | ||
bool * | result ) |
Query if a given version of an extension is supported by the HSA implementation.
All minor versions from 0 up to the returned version_minor
must be supported by the implementation.
[in] | extension | Extension identifier. |
[in] | version_major | Major version number. |
[out] | version_minor | Minor version number. |
[out] | result | Pointer to a memory location where the HSA runtime stores the result of the check. The result is true if the specified version of the extension is supported, and false otherwise. |
HSA_STATUS_SUCCESS | The function has been executed successfully. |
HSA_STATUS_ERROR_NOT_INITIALIZED | The HSA runtime has not been initialized. |
HSA_STATUS_ERROR_INVALID_ARGUMENT | extension is not a valid extension, or version_minor is NULL, or result is NULL. |