43#ifndef HSA_RUNTIME_INC_HSA_H_
44#define HSA_RUNTIME_INC_HSA_H_
58#ifndef HSA_EXPORT_DECORATOR
60#define HSA_EXPORT_DECORATOR __attribute__ ((visibility ("default")))
62#define HSA_EXPORT_DECORATOR
65#define HSA_API_EXPORT HSA_EXPORT_DECORATOR HSA_CALL
66#define HSA_API_IMPORT HSA_CALL
68#if !defined(HSA_API) && defined(HSA_EXPORT)
69#define HSA_API HSA_API_EXPORT
71#define HSA_API HSA_API_IMPORT
76#if defined(__LP64__) || defined(_M_X64)
77#define HSA_LARGE_MODEL
81#if !defined(LITTLEENDIAN_CPU) && !defined(BIGENDIAN_CPU)
82#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \
83 defined(_M_X64) || defined(__aarch64__)
84#define LITTLEENDIAN_CPU
88#undef HSA_LITTLE_ENDIAN
89#if defined(LITTLEENDIAN_CPU)
90#define HSA_LITTLE_ENDIAN
91#elif defined(BIGENDIAN_CPU)
93#error "BIGENDIAN_CPU or LITTLEENDIAN_CPU must be defined"
105#define HSA_VERSION_1_0 1
285 const char ** status_string);
603 uint16_t version_major,
604 uint16_t version_minor,
632 uint16_t version_major,
633 uint16_t *version_minor,
672 uint16_t version_major,
673 uint16_t version_minor,
712 uint16_t version_major,
1256 uint16_t version_major,
1257 uint16_t version_minor,
1291 uint16_t version_major,
1292 uint16_t *version_minor,
1319#ifdef HSA_LARGE_MODEL
1357 uint32_t num_consumers,
2009 uint64_t timeout_hint,
2019 uint64_t timeout_hint,
2031 uint64_t timeout_hint,
2079 uint32_t num_signals,
2081 uint32_t num_consumers,
2255#ifdef HSA_LARGE_MODEL
2257#elif defined HSA_LITTLE_ENDIAN
2376 uint32_t private_segment_size,
2377 uint32_t group_segment_size,
2976#ifdef HSA_LARGE_MODEL
2977 void* kernarg_address;
2978#elif defined HSA_LITTLE_ENDIAN
2986 void* kernarg_address;
3030#ifdef HSA_LARGE_MODEL
3031 void* return_address;
3032#elif defined HSA_LITTLE_ENDIAN
3036 void* return_address;
4078 const void *code_object,
4173 const char *options,
4209 const char *options,
4295 const char *options,
4362 const char *options,
4396 const char *options);
4485 const char *variable_name,
4533 const char *variable_name,
4585 const char *variable_name,
4643 const char *options,
4699 const char *module_name,
4700 const char *symbol_name,
4702 int32_t call_convention,
4736 const char *symbol_name,
5211 const char *options,
5212 void **serialized_code_object,
5213 size_t *serialized_code_object_size);
5246 void *serialized_code_object,
5247 size_t serialized_code_object_size,
5248 const char *options,
5412 const char *options);
5459 const char *symbol_name,
5492 const char *module_name,
5493 const char *symbol_name,
std::vector< SwitchingFiber * > expected({ &a, &b, &a, &a, &a, &b, &c, &a, &c, &c, &c })
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_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_agent_info_t
Agent attributes.
hsa_cache_info_t
Cache attributes.
hsa_endianness_t
Endianness.
hsa_machine_model_t
Machine model.
hsa_system_info_t
System attributes.
hsa_device_type_t
Hardware device type.
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 ...
hsa_extension_t
HSA extensions.
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_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_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_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.
struct hsa_agent_s hsa_agent_t
Struct containing an opaque handle to an agent, a device that participates in the HSA memory model.
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_default_float_rounding_mode_t
Default floating-point rounding mode.
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.
hsa_status_t HSA_API hsa_extension_get_name(uint16_t extension, const char **name)
Query the name of a given extension.
hsa_exception_policy_t
Exception policies applied in the presence of hardware exceptions.
hsa_agent_feature_t
Agent features.
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.
struct hsa_cache_s hsa_cache_t
Cache handle.
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 application...
@ HSA_AGENT_INFO_BASE_PROFILE_DEFAULT_FLOAT_ROUNDING_MODES
@ HSA_AGENT_INFO_DEVICE
Type of hardware device associated with the agent.
@ HSA_AGENT_INFO_VERSION_MAJOR
Major version of the HSA runtime specification supported by the agent.
@ HSA_AGENT_INFO_QUEUES_MAX
@ HSA_AGENT_INFO_NAME
Agent name.
@ HSA_AGENT_INFO_GRID_MAX_SIZE
@ HSA_AGENT_INFO_WAVEFRONT_SIZE
@ HSA_AGENT_INFO_FAST_F16_OPERATION
@ HSA_AGENT_INFO_EXTENSIONS
Bit-mask indicating which extensions are supported by the agent.
@ HSA_AGENT_INFO_QUEUE_TYPE
Type of a queue created in the agent.
@ HSA_AGENT_INFO_FEATURE
Agent capability.
@ HSA_AGENT_INFO_GRID_MAX_DIM
@ HSA_AGENT_INFO_WORKGROUP_MAX_DIM
@ HSA_AGENT_INFO_MACHINE_MODEL
@ HSA_AGENT_INFO_FBARRIER_MAX_SIZE
@ HSA_AGENT_INFO_VERSION_MINOR
Minor version of the HSA runtime specification supported by the agent.
@ HSA_AGENT_INFO_DEFAULT_FLOAT_ROUNDING_MODE
@ HSA_AGENT_INFO_VENDOR_NAME
Name of vendor.
@ HSA_AGENT_INFO_QUEUE_MAX_SIZE
Maximum number of packets that a queue created in the agent can hold.
@ HSA_AGENT_INFO_QUEUE_MIN_SIZE
Minimum number of packets that a queue created in the agent can hold.
@ HSA_AGENT_INFO_WORKGROUP_MAX_SIZE
@ HSA_AGENT_INFO_CACHE_SIZE
@ HSA_CACHE_INFO_NAME
Human-readable description.
@ HSA_CACHE_INFO_NAME_LENGTH
The length of the cache name in bytes, not including the NUL terminator.
@ HSA_CACHE_INFO_LEVEL
Cache level.
@ HSA_CACHE_INFO_SIZE
Cache size, in bytes.
@ HSA_ENDIANNESS_BIG
The most significant byte is stored in the smallest address.
@ HSA_ENDIANNESS_LITTLE
The least significant byte is stored in the smallest address.
@ HSA_MACHINE_MODEL_LARGE
Large machine model.
@ HSA_MACHINE_MODEL_SMALL
Small machine model.
@ HSA_SYSTEM_INFO_VERSION_MINOR
Minor version of the HSA runtime specification supported by the implementation.
@ HSA_SYSTEM_INFO_EXTENSIONS
Bit-mask indicating which extensions are supported by the implementation.
@ HSA_SYSTEM_INFO_SIGNAL_MAX_WAIT
Maximum duration of a signal wait operation.
@ HSA_SYSTEM_INFO_MACHINE_MODEL
Machine model supported by the HSA runtime.
@ HSA_SYSTEM_INFO_ENDIANNESS
Endianness of the system.
@ HSA_SYSTEM_INFO_VERSION_MAJOR
Major version of the HSA runtime specification supported by the implementation.
@ HSA_SYSTEM_INFO_TIMESTAMP
Current timestamp.
@ HSA_SYSTEM_INFO_TIMESTAMP_FREQUENCY
Timestamp value increase rate, in Hz.
@ HSA_DEVICE_TYPE_DSP
DSP device.
@ HSA_DEVICE_TYPE_CPU
CPU device.
@ HSA_DEVICE_TYPE_GPU
GPU device.
@ HSA_EXTENSION_STD_LAST
Extension count.
@ HSA_EXTENSION_FINALIZER
Finalizer extension.
@ HSA_AMD_FIRST_EXTENSION
First AMD extension number.
@ HSA_EXTENSION_PROFILING_EVENTS
Profiling events extension.
@ HSA_EXTENSION_AMD_LOADER
Loader extension.
@ HSA_AMD_LAST_EXTENSION
Last AMD extension.
@ HSA_EXTENSION_IMAGES
Images extension.
@ HSA_EXTENSION_PERFORMANCE_COUNTERS
Performance counter extension.
@ HSA_EXTENSION_AMD_PROFILER
Profiler extension.
@ HSA_DEFAULT_FLOAT_ROUNDING_MODE_NEAR
Operations that specify the default floating-point mode are rounded to the nearest representable numb...
@ HSA_DEFAULT_FLOAT_ROUNDING_MODE_DEFAULT
Use a default floating-point rounding mode specified elsewhere.
@ HSA_DEFAULT_FLOAT_ROUNDING_MODE_ZERO
Operations that specify the default floating-point mode are rounded to zero by default.
@ HSA_PROFILE_FULL
Full profile.
@ HSA_PROFILE_BASE
Base profile.
@ HSA_EXCEPTION_POLICY_DETECT
If a hardware exception is detected, a hardware status bit is set.
@ HSA_EXCEPTION_POLICY_BREAK
If a hardware exception is detected, a work-item signals an exception.
@ HSA_AGENT_FEATURE_AGENT_DISPATCH
The agent supports AQL packets of agent dispatch type.
@ HSA_AGENT_FEATURE_KERNEL_DISPATCH
The agent supports AQL packets of kernel dispatch type.
hsa_kernel_dispatch_packet_setup_t
Sub-fields of the kernel dispatch packet setup field.
struct hsa_agent_dispatch_packet_s hsa_agent_dispatch_packet_t
Agent dispatch packet.
hsa_packet_header_t
Sub-fields of the header field that is present in any AQL packet.
hsa_packet_type_t
Packet type.
hsa_fence_scope_t
Scope of the memory fence operation associated with a packet.
struct hsa_barrier_or_packet_s hsa_barrier_or_packet_t
Barrier-OR packet.
struct hsa_barrier_and_packet_s hsa_barrier_and_packet_t
Barrier-AND packet.
hsa_kernel_dispatch_packet_setup_width_t
Width (in bits) of the sub-fields in hsa_kernel_dispatch_packet_setup_t.
hsa_packet_header_width_t
Width (in bits) of the sub-fields in hsa_packet_header_t.
struct hsa_kernel_dispatch_packet_s hsa_kernel_dispatch_packet_t
AQL kernel dispatch packet.
@ HSA_KERNEL_DISPATCH_PACKET_SETUP_DIMENSIONS
Number of dimensions of the grid.
@ HSA_PACKET_HEADER_SCACQUIRE_FENCE_SCOPE
Acquire fence scope.
@ HSA_PACKET_HEADER_RELEASE_FENCE_SCOPE
@ HSA_PACKET_HEADER_TYPE
Packet type.
@ HSA_PACKET_HEADER_SCRELEASE_FENCE_SCOPE
Release fence scope, The value of this sub-field determines the scope and type of the memory fence op...
@ HSA_PACKET_HEADER_BARRIER
Barrier bit.
@ HSA_PACKET_HEADER_ACQUIRE_FENCE_SCOPE
@ HSA_PACKET_TYPE_BARRIER_AND
Packet used by agents to delay processing of subsequent packets, and to express complex dependencies ...
@ HSA_PACKET_TYPE_BARRIER_OR
Packet used by agents to delay processing of subsequent packets, and to express complex dependencies ...
@ HSA_PACKET_TYPE_VENDOR_SPECIFIC
Vendor-specific packet.
@ HSA_PACKET_TYPE_INVALID
The packet has been processed in the past, but has not been reassigned to the packet processor.
@ HSA_PACKET_TYPE_KERNEL_DISPATCH
Packet used by agents for dispatching jobs to kernel agents.
@ HSA_PACKET_TYPE_AGENT_DISPATCH
Packet used by agents for dispatching jobs to agents.
@ HSA_FENCE_SCOPE_NONE
No scope (no fence is applied).
@ HSA_FENCE_SCOPE_SYSTEM
The fence is applied across both agent and system scope for the global segment.
@ HSA_FENCE_SCOPE_AGENT
The fence is applied with agent scope for the global segment.
@ HSA_KERNEL_DISPATCH_PACKET_SETUP_WIDTH_DIMENSIONS
@ HSA_PACKET_HEADER_WIDTH_SCRELEASE_FENCE_SCOPE
@ HSA_PACKET_HEADER_WIDTH_SCACQUIRE_FENCE_SCOPE
@ HSA_PACKET_HEADER_WIDTH_BARRIER
@ HSA_PACKET_HEADER_WIDTH_TYPE
@ HSA_PACKET_HEADER_WIDTH_ACQUIRE_FENCE_SCOPE
@ HSA_PACKET_HEADER_WIDTH_RELEASE_FENCE_SCOPE
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_get_symbol(hsa_code_object_t code_object, const char *symbol_name, hsa_code_symbol_t *symbol)
Get the symbol handle within a code object for a given a symbol name.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_get_symbol_from_name(hsa_code_object_t code_object, const char *module_name, const char *symbol_name, hsa_code_symbol_t *symbol)
Get the symbol handle within a code object for a given a symbol name.
struct hsa_code_symbol_s hsa_code_symbol_t
Code object symbol handle.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_iterate_symbols(hsa_code_object_t code_object, hsa_status_t(*callback)(hsa_code_object_t code_object, hsa_code_symbol_t symbol, void *data), void *data)
Iterate over the symbols in a code object, and invoke an application-defined callback on every iterat...
hsa_code_object_info_t
Code object attributes.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_get_info(hsa_code_object_t code_object, hsa_code_object_info_t attribute, void *value)
Get the current value of an attribute for a given code object.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_deserialize(void *serialized_code_object, size_t serialized_code_object_size, const char *options, hsa_code_object_t *code_object)
Deserialize a code object.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_symbol_get_info(hsa_code_symbol_t code_symbol, hsa_code_symbol_info_t attribute, void *value)
Get the current value of an attribute for a given code symbol.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_serialize(hsa_code_object_t code_object, hsa_status_t(*alloc_callback)(size_t size, hsa_callback_data_t data, void **address), hsa_callback_data_t callback_data, const char *options, void **serialized_code_object, size_t *serialized_code_object_size)
Serialize a code object. Can be used for offline finalization, install-time finalization,...
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_destroy(hsa_code_object_t code_object)
Destroy a code object.
struct hsa_callback_data_s hsa_callback_data_t
Application data handle that is passed to the serialization and deserialization functions.
hsa_status_t HSA_API HSA_DEPRECATED hsa_executable_load_code_object(hsa_executable_t executable, hsa_agent_t agent, hsa_code_object_t code_object, const char *options)
Load code object into the executable.
hsa_code_symbol_info_t
Code object symbol attributes.
hsa_code_object_type_t
Code object type.
struct hsa_code_object_s hsa_code_object_t
Struct containing an opaque handle to a code object, which contains ISA for finalized kernels and ind...
@ HSA_CODE_OBJECT_INFO_MACHINE_MODEL
Machine model this code object is produced for.
@ HSA_CODE_OBJECT_INFO_DEFAULT_FLOAT_ROUNDING_MODE
Default floating-point rounding mode used when the code object is produced.
@ HSA_CODE_OBJECT_INFO_TYPE
Type of code object.
@ HSA_CODE_OBJECT_INFO_VERSION
The version of the code object.
@ HSA_CODE_OBJECT_INFO_ISA
Instruction set architecture this code object is produced for.
@ HSA_CODE_OBJECT_INFO_PROFILE
Profile this code object is produced for.
@ HSA_CODE_SYMBOL_INFO_VARIABLE_SIZE
Size of the variable.
@ HSA_CODE_SYMBOL_INFO_MODULE_NAME_LENGTH
The length of the module name in bytes (not including the NUL terminator) to which this symbol belong...
@ HSA_CODE_SYMBOL_INFO_VARIABLE_ALLOCATION
The allocation kind of the variable.
@ HSA_CODE_SYMBOL_INFO_LINKAGE
The linkage kind of the symbol.
@ HSA_CODE_SYMBOL_INFO_KERNEL_GROUP_SEGMENT_SIZE
Size of static group segment memory required by the kernel (per work-group), in bytes.
@ HSA_CODE_SYMBOL_INFO_NAME
The name of the symbol.
@ HSA_CODE_SYMBOL_INFO_VARIABLE_IS_CONST
Indicates whether the variable is constant.
@ HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_ALIGNMENT
Alignment (in bytes) of the buffer used to pass arguments to the kernel, which is the maximum of 16 a...
@ HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE
Size of kernarg segment memory that is required to hold the values of the kernel arguments,...
@ HSA_CODE_SYMBOL_INFO_TYPE
The type of the symbol.
@ HSA_CODE_SYMBOL_INFO_INDIRECT_FUNCTION_CALL_CONVENTION
Call convention of the indirect function.
@ HSA_CODE_SYMBOL_INFO_VARIABLE_ALIGNMENT
Alignment of the symbol in memory.
@ HSA_CODE_SYMBOL_INFO_NAME_LENGTH
The length of the symbol name in bytes, not including the NUL terminator.
@ HSA_CODE_SYMBOL_INFO_KERNEL_PRIVATE_SEGMENT_SIZE
Size of static private, spill, and arg segment memory required by this kernel (per work-item),...
@ HSA_CODE_SYMBOL_INFO_VARIABLE_SEGMENT
The segment kind of the variable.
@ HSA_CODE_SYMBOL_INFO_KERNEL_CALL_CONVENTION
Call convention of the kernel.
@ HSA_CODE_SYMBOL_INFO_MODULE_NAME
The module name to which this symbol belongs if this symbol has module linkage, otherwise an empty st...
@ HSA_CODE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK
Dynamic callstack flag.
@ HSA_CODE_SYMBOL_INFO_IS_DEFINITION
Indicates whether the symbol corresponds to a definition.
@ HSA_CODE_OBJECT_TYPE_PROGRAM
Produces code object that contains ISA for all kernels and indirect functions in HSA source.
hsa_access_permission_t
Access permissions.
struct hsa_dim3_s hsa_dim3_t
Three-dimensional coordinate.
int hsa_file_t
POSIX file descriptor.
@ HSA_ACCESS_PERMISSION_WO
Write-only access.
@ HSA_ACCESS_PERMISSION_RW
Read and write access.
@ HSA_ACCESS_PERMISSION_RO
Read-only access.
hsa_variable_allocation_t
Allocation type of a variable.
hsa_status_t HSA_API HSA_DEPRECATED hsa_executable_iterate_symbols(hsa_executable_t executable, hsa_status_t(*callback)(hsa_executable_t exec, hsa_executable_symbol_t symbol, void *data), void *data)
Iterate over the symbols in a executable, and invoke an application-defined callback on every iterati...
hsa_status_t HSA_API hsa_executable_get_info(hsa_executable_t executable, hsa_executable_info_t attribute, void *value)
Get the current value of an attribute for a given executable.
hsa_executable_info_t
Executable attributes.
hsa_executable_symbol_info_t
Executable symbol attributes.
hsa_status_t HSA_API hsa_executable_create_alt(hsa_profile_t profile, hsa_default_float_rounding_mode_t default_float_rounding_mode, const char *options, hsa_executable_t *executable)
Create an empty executable.
struct hsa_loaded_code_object_s hsa_loaded_code_object_t
Loaded code object handle.
hsa_status_t HSA_API hsa_executable_validate_alt(hsa_executable_t executable, const char *options, uint32_t *result)
Validate an executable.
hsa_status_t HSA_API hsa_executable_freeze(hsa_executable_t executable, const char *options)
Freeze the executable.
hsa_status_t HSA_API hsa_executable_iterate_agent_symbols(hsa_executable_t executable, hsa_agent_t agent, hsa_status_t(*callback)(hsa_executable_t exec, hsa_agent_t agent, hsa_executable_symbol_t symbol, void *data), void *data)
Iterate over the kernels, indirect functions, and agent allocation variables in an executable for a g...
hsa_status_t HSA_API hsa_executable_agent_global_variable_define(hsa_executable_t executable, hsa_agent_t agent, const char *variable_name, void *address)
Define an external global variable with agent allocation.
struct hsa_executable_s hsa_executable_t
Struct containing an opaque handle to an executable, which contains ISA for finalized kernels and ind...
hsa_status_t HSA_API hsa_executable_get_symbol_by_name(hsa_executable_t executable, const char *symbol_name, const hsa_agent_t *agent, hsa_executable_symbol_t *symbol)
Retrieve the symbol handle corresponding to a given a symbol name.
hsa_symbol_kind_t
Symbol type.
hsa_status_t HSA_API HSA_DEPRECATED hsa_executable_create(hsa_profile_t profile, hsa_executable_state_t executable_state, const char *options, hsa_executable_t *executable)
Create an empty executable.
hsa_status_t HSA_API hsa_executable_validate(hsa_executable_t executable, uint32_t *result)
Validate an executable.
hsa_status_t HSA_API hsa_executable_symbol_get_info(hsa_executable_symbol_t executable_symbol, hsa_executable_symbol_info_t attribute, void *value)
Get the current value of an attribute for a given executable symbol.
hsa_status_t HSA_API hsa_executable_global_variable_define(hsa_executable_t executable, const char *variable_name, void *address)
Define an external global variable with program allocation.
hsa_status_t HSA_API hsa_executable_load_agent_code_object(hsa_executable_t executable, hsa_agent_t agent, hsa_code_object_reader_t code_object_reader, const char *options, hsa_loaded_code_object_t *loaded_code_object)
Load an agent code object into an executable.
hsa_variable_segment_t
Memory segment associated with a variable.
hsa_status_t HSA_API hsa_executable_destroy(hsa_executable_t executable)
Destroy an executable.
struct hsa_code_object_reader_s hsa_code_object_reader_t
Code object reader handle.
struct hsa_executable_symbol_s hsa_executable_symbol_t
Executable symbol handle.
hsa_status_t HSA_API hsa_code_object_reader_create_from_memory(const void *code_object, size_t size, hsa_code_object_reader_t *code_object_reader)
Create a code object reader to operate on memory.
hsa_status_t HSA_API hsa_executable_load_program_code_object(hsa_executable_t executable, hsa_code_object_reader_t code_object_reader, const char *options, hsa_loaded_code_object_t *loaded_code_object)
Load a program code object into an executable.
hsa_status_t HSA_API hsa_executable_readonly_variable_define(hsa_executable_t executable, hsa_agent_t agent, const char *variable_name, void *address)
Define an external readonly variable.
hsa_status_t HSA_API HSA_DEPRECATED hsa_executable_get_symbol(hsa_executable_t executable, const char *module_name, const char *symbol_name, hsa_agent_t agent, int32_t call_convention, hsa_executable_symbol_t *symbol)
Get the symbol handle for a given a symbol name.
hsa_status_t HSA_API hsa_code_object_reader_create_from_file(hsa_file_t file, hsa_code_object_reader_t *code_object_reader)
Create a code object reader to operate on a file.
hsa_status_t HSA_API hsa_code_object_reader_destroy(hsa_code_object_reader_t code_object_reader)
Destroy a code object reader.
hsa_status_t HSA_API hsa_executable_iterate_program_symbols(hsa_executable_t executable, hsa_status_t(*callback)(hsa_executable_t exec, hsa_executable_symbol_t symbol, void *data), void *data)
Iterate over the program allocation variables in an executable, and invoke an application-defined cal...
hsa_symbol_linkage_t
Linkage type of a symbol.
hsa_executable_state_t
Executable state.
@ HSA_VARIABLE_ALLOCATION_AGENT
Agent allocation.
@ HSA_VARIABLE_ALLOCATION_PROGRAM
Program allocation.
@ HSA_EXECUTABLE_INFO_STATE
Executable state.
@ HSA_EXECUTABLE_INFO_DEFAULT_FLOAT_ROUNDING_MODE
Default floating-point rounding mode specified when executable was created.
@ HSA_EXECUTABLE_INFO_PROFILE
Profile this executable is created for.
@ HSA_EXECUTABLE_SYMBOL_INFO_MODULE_NAME_LENGTH
@ HSA_EXECUTABLE_SYMBOL_INFO_MODULE_NAME
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_SIZE
@ HSA_EXECUTABLE_SYMBOL_INFO_INDIRECT_FUNCTION_CALL_CONVENTION
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE
Size of kernarg segment memory that is required to hold the values of the kernel arguments,...
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK
Dynamic callstack flag.
@ HSA_EXECUTABLE_SYMBOL_INFO_NAME_LENGTH
The length of the symbol name in bytes, not including the NUL terminator.
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ALIGNMENT
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_ALIGNMENT
Alignment (in bytes) of the buffer used to pass arguments to the kernel, which is the maximum of 16 a...
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_OBJECT
Kernel object handle, used in the kernel dispatch packet.
@ HSA_EXECUTABLE_SYMBOL_INFO_AGENT
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_GROUP_SEGMENT_SIZE
Size of static group segment memory required by the kernel (per work-group), in bytes.
@ HSA_EXECUTABLE_SYMBOL_INFO_TYPE
The kind of the symbol.
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ALLOCATION
@ HSA_EXECUTABLE_SYMBOL_INFO_IS_DEFINITION
Indicates whether the symbol corresponds to a definition.
@ HSA_EXECUTABLE_SYMBOL_INFO_NAME
The name of the symbol.
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_IS_CONST
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_SEGMENT
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_PRIVATE_SEGMENT_SIZE
Size of static private, spill, and arg segment memory required by this kernel (per work-item),...
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ADDRESS
The address of the variable.
@ HSA_EXECUTABLE_SYMBOL_INFO_LINKAGE
The linkage kind of the symbol.
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_CALL_CONVENTION
@ HSA_EXECUTABLE_SYMBOL_INFO_INDIRECT_FUNCTION_OBJECT
Indirect function object handle.
@ HSA_SYMBOL_KIND_INDIRECT_FUNCTION
Indirect function.
@ HSA_SYMBOL_KIND_VARIABLE
Variable.
@ HSA_SYMBOL_KIND_KERNEL
Kernel.
@ HSA_VARIABLE_SEGMENT_READONLY
Readonly memory segment.
@ HSA_VARIABLE_SEGMENT_GLOBAL
Global memory segment.
@ HSA_SYMBOL_LINKAGE_PROGRAM
Program linkage.
@ HSA_SYMBOL_LINKAGE_MODULE
Module linkage.
@ HSA_EXECUTABLE_STATE_UNFROZEN
Executable state, which allows the user to load code objects and define external variables.
@ HSA_EXECUTABLE_STATE_FROZEN
Executable state, which allows the user to query variable addresses, kernel code handles,...
hsa_status_t HSA_API hsa_init()
Initialize the HSA runtime.
hsa_status_t HSA_API hsa_shut_down()
Shut down the HSA runtime.
hsa_wavefront_info_t
Wavefront attributes.
struct hsa_wavefront_s hsa_wavefront_t
Wavefront handle.
struct hsa_isa_s hsa_isa_t
Instruction set architecture.
hsa_status_t HSA_API hsa_isa_from_name(const char *name, hsa_isa_t *isa)
Retrieve a reference to an instruction set architecture handle out of a symbolic name.
hsa_status_t HSA_API HSA_DEPRECATED hsa_isa_get_info(hsa_isa_t isa, hsa_isa_info_t attribute, uint32_t index, void *value)
Get the current value of an attribute for a given instruction set architecture (ISA).
hsa_status_t HSA_API hsa_isa_get_info_alt(hsa_isa_t isa, hsa_isa_info_t attribute, void *value)
Get the current value of an attribute for a given instruction set architecture (ISA).
hsa_status_t HSA_API hsa_agent_iterate_isas(hsa_agent_t agent, hsa_status_t(*callback)(hsa_isa_t isa, void *data), void *data)
Iterate over the instruction sets supported by the given agent, and invoke an application-defined cal...
hsa_isa_info_t
Instruction set architecture attributes.
hsa_status_t HSA_API hsa_isa_iterate_wavefronts(hsa_isa_t isa, hsa_status_t(*callback)(hsa_wavefront_t wavefront, void *data), void *data)
Iterate over the different wavefronts supported by an instruction set architecture,...
hsa_status_t HSA_API HSA_DEPRECATED hsa_isa_compatible(hsa_isa_t code_object_isa, hsa_isa_t agent_isa, bool *result)
Check if the instruction set architecture of a code object can be executed on an agent associated wit...
hsa_status_t HSA_API hsa_wavefront_get_info(hsa_wavefront_t wavefront, hsa_wavefront_info_t attribute, void *value)
Get the current value of a wavefront attribute.
hsa_status_t HSA_API hsa_isa_get_exception_policies(hsa_isa_t isa, hsa_profile_t profile, uint16_t *mask)
Retrieve the exception policy support for a given combination of instruction set architecture and pro...
hsa_flush_mode_t
Flush to zero modes.
hsa_round_method_t
Round methods.
hsa_status_t HSA_API hsa_isa_get_round_method(hsa_isa_t isa, hsa_fp_type_t fp_type, hsa_flush_mode_t flush_mode, hsa_round_method_t *round_method)
Retrieve the round method (single or double) used to implement the floating-point multiply add instru...
hsa_fp_type_t
Floating-point types.
@ HSA_WAVEFRONT_INFO_SIZE
Number of work-items in the wavefront.
@ HSA_ISA_INFO_GRID_MAX_SIZE
Maximum total number of work-items in a grid.
@ HSA_ISA_INFO_FAST_F16_OPERATION
Flag indicating that the f16 HSAIL operation is at least as fast as the f32 operation in the instruct...
@ HSA_ISA_INFO_DEFAULT_FLOAT_ROUNDING_MODES
Default floating-point rounding modes supported by the instruction set architecture.
@ HSA_ISA_INFO_BASE_PROFILE_DEFAULT_FLOAT_ROUNDING_MODES
Default floating-point rounding modes supported by the instruction set architecture in the Base profi...
@ HSA_ISA_INFO_MACHINE_MODELS
Machine models supported by the instruction set architecture.
@ HSA_ISA_INFO_CALL_CONVENTION_INFO_WAVEFRONT_SIZE
@ HSA_ISA_INFO_WORKGROUP_MAX_SIZE
Maximum total number of work-items in a work-group.
@ HSA_ISA_INFO_GRID_MAX_DIM
Maximum number of work-items of each dimension of a grid.
@ HSA_ISA_INFO_WORKGROUP_MAX_DIM
Maximum number of work-items of each dimension of a work-group.
@ HSA_ISA_INFO_FBARRIER_MAX_SIZE
Maximum number of fbarriers per work-group.
@ HSA_ISA_INFO_NAME
Human-readable description.
@ HSA_ISA_INFO_CALL_CONVENTION_COUNT
@ HSA_ISA_INFO_CALL_CONVENTION_INFO_WAVEFRONTS_PER_COMPUTE_UNIT
@ HSA_ISA_INFO_NAME_LENGTH
The length of the ISA name in bytes, not including the NUL terminator.
@ HSA_ISA_INFO_PROFILES
Profiles supported by the instruction set architecture.
@ HSA_FLUSH_MODE_FTZ
Flush to zero.
@ HSA_FLUSH_MODE_NON_FTZ
Do not flush to zero.
@ HSA_ROUND_METHOD_SINGLE
Single round method.
@ HSA_ROUND_METHOD_DOUBLE
Double round method.
@ HSA_FP_TYPE_32
32-bit floating-point type.
@ HSA_FP_TYPE_64
64-bit floating-point type.
@ HSA_FP_TYPE_16
16-bit floating-point type.
hsa_status_t HSA_API hsa_memory_register(void *ptr, size_t size)
Register a global, fine-grained buffer.
hsa_status_t HSA_API hsa_memory_allocate(hsa_region_t region, size_t size, void **ptr)
Allocate a block of memory in a given region.
hsa_status_t HSA_API hsa_memory_copy(void *dst, const void *src, size_t size)
Copy a block of memory from the location pointed to by src to the memory block pointed to by dst.
hsa_region_segment_t
Memory segments associated with a region.
struct hsa_region_s hsa_region_t
A memory region represents a block of virtual memory with certain properties.
hsa_status_t HSA_API hsa_region_get_info(hsa_region_t region, hsa_region_info_t attribute, void *value)
Get the current value of an attribute of a region.
hsa_status_t HSA_API hsa_memory_assign_agent(void *ptr, hsa_agent_t agent, hsa_access_permission_t access)
Change the ownership of a global, coarse-grained buffer.
hsa_region_global_flag_t
Global region flags.
hsa_region_info_t
Attributes of a memory region.
hsa_status_t HSA_API hsa_agent_iterate_regions(hsa_agent_t agent, hsa_status_t(*callback)(hsa_region_t region, void *data), void *data)
Iterate over the memory regions associated with a given agent, and invoke an application-defined call...
hsa_status_t HSA_API hsa_memory_deregister(void *ptr, size_t size)
Deregister memory previously registered using hsa_memory_register.
hsa_status_t HSA_API hsa_memory_free(void *ptr)
Deallocate a block of memory previously allocated using hsa_memory_allocate.
@ HSA_REGION_SEGMENT_KERNARG
Kernarg segment.
@ HSA_REGION_SEGMENT_PRIVATE
Private segment.
@ HSA_REGION_SEGMENT_READONLY
Read-only segment.
@ HSA_REGION_SEGMENT_GROUP
Group segment.
@ HSA_REGION_SEGMENT_GLOBAL
Global segment.
@ HSA_REGION_GLOBAL_FLAG_COARSE_GRAINED
Updates to memory in this region can be performed by a single agent at a time.
@ HSA_REGION_GLOBAL_FLAG_FINE_GRAINED
Updates to memory in this region are immediately visible to all the agents under the terms of the HSA...
@ HSA_REGION_GLOBAL_FLAG_KERNARG
The application can use memory in the region to store kernel arguments, and provide the values for th...
@ HSA_REGION_INFO_SIZE
Size of this region, in bytes.
@ HSA_REGION_INFO_GLOBAL_FLAGS
Flag mask.
@ HSA_REGION_INFO_ALLOC_MAX_PRIVATE_WORKGROUP_SIZE
Maximum size (per work-group) of private memory that can be requested for a specific kernel dispatch.
@ HSA_REGION_INFO_RUNTIME_ALLOC_GRANULE
Allocation granularity of buffers allocated by hsa_memory_allocate in this region.
@ HSA_REGION_INFO_SEGMENT
Segment where memory in the region can be used.
@ HSA_REGION_INFO_RUNTIME_ALLOC_ALIGNMENT
Alignment of buffers allocated by hsa_memory_allocate in this region.
@ HSA_REGION_INFO_ALLOC_MAX_SIZE
Maximum allocation size in this region, in bytes.
@ HSA_REGION_INFO_RUNTIME_ALLOC_ALLOWED
Indicates whether memory in this region can be allocated using hsa_memory_allocate.
uint64_t HSA_API hsa_queue_load_write_index_relaxed(const hsa_queue_t *queue)
Atomically load the write index of a queue.
hsa_queue_feature_t
Queue features.
uint64_t HSA_API hsa_queue_cas_write_index_scacq_screl(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
Atomically set the write index of a queue if the observed value is equal to the expected value.
hsa_status_t HSA_API hsa_queue_destroy(hsa_queue_t *queue)
Destroy a user mode queue.
uint64_t HSA_API hsa_queue_cas_write_index_scacquire(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
Atomically set the write index of a queue if the observed value is equal to the expected value.
uint64_t HSA_API hsa_queue_load_write_index_scacquire(const hsa_queue_t *queue)
Atomically load the write index of a queue.
hsa_status_t HSA_API hsa_soft_queue_create(hsa_region_t region, uint32_t size, hsa_queue_type32_t type, uint32_t features, hsa_signal_t doorbell_signal, hsa_queue_t **queue)
Create a queue for which the application or a kernel is responsible for processing the AQL packets.
uint64_t HSA_API hsa_queue_cas_write_index_relaxed(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
Atomically set the write index of a queue if the observed value is equal to the expected value.
void HSA_API hsa_queue_store_read_index_screlease(const hsa_queue_t *queue, uint64_t value)
Atomically set the read index of a queue.
uint64_t HSA_API hsa_queue_add_write_index_screlease(const hsa_queue_t *queue, uint64_t value)
Atomically increment the write index of a queue by an offset.
uint32_t hsa_queue_type32_t
A fixed-size type used to represent hsa_queue_type_t constants.
uint64_t HSA_API hsa_queue_add_write_index_scacq_screl(const hsa_queue_t *queue, uint64_t value)
Atomically increment the write index of a queue by an offset.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_cas_write_index_acquire(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
hsa_status_t HSA_API hsa_queue_create(hsa_agent_t agent, uint32_t size, hsa_queue_type32_t type, void(*callback)(hsa_status_t status, hsa_queue_t *source, void *data), void *data, uint32_t private_segment_size, uint32_t group_segment_size, hsa_queue_t **queue)
Create a user mode queue.
void HSA_API HSA_DEPRECATED hsa_queue_store_write_index_release(const hsa_queue_t *queue, uint64_t value)
void HSA_API hsa_queue_store_write_index_relaxed(const hsa_queue_t *queue, uint64_t value)
Atomically set the write index of a queue.
uint64_t HSA_API hsa_queue_load_read_index_relaxed(const hsa_queue_t *queue)
Atomically load the read index of a queue.
uint64_t HSA_API hsa_queue_cas_write_index_screlease(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
Atomically set the write index of a queue if the observed value is equal to the expected value.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_add_write_index_acq_rel(const hsa_queue_t *queue, uint64_t value)
uint64_t HSA_API HSA_DEPRECATED hsa_queue_cas_write_index_release(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
struct hsa_queue_s hsa_queue_t
User mode queue.
uint64_t HSA_API hsa_queue_add_write_index_relaxed(const hsa_queue_t *queue, uint64_t value)
Atomically increment the write index of a queue by an offset.
uint64_t HSA_API hsa_queue_add_write_index_scacquire(const hsa_queue_t *queue, uint64_t value)
Atomically increment the write index of a queue by an offset.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_cas_write_index_acq_rel(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
hsa_status_t HSA_API hsa_queue_inactivate(hsa_queue_t *queue)
Inactivate a queue.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_add_write_index_release(const hsa_queue_t *queue, uint64_t value)
void HSA_API hsa_queue_store_write_index_screlease(const hsa_queue_t *queue, uint64_t value)
Atomically set the write index of a queue.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_load_read_index_acquire(const hsa_queue_t *queue)
uint64_t HSA_API HSA_DEPRECATED hsa_queue_add_write_index_acquire(const hsa_queue_t *queue, uint64_t value)
uint64_t HSA_API HSA_DEPRECATED hsa_queue_load_write_index_acquire(const hsa_queue_t *queue)
void HSA_API hsa_queue_store_read_index_relaxed(const hsa_queue_t *queue, uint64_t value)
Atomically set the read index of a queue.
hsa_queue_type_t
Queue type.
void HSA_API HSA_DEPRECATED hsa_queue_store_read_index_release(const hsa_queue_t *queue, uint64_t value)
uint64_t HSA_API hsa_queue_load_read_index_scacquire(const hsa_queue_t *queue)
Atomically load the read index of a queue.
@ HSA_QUEUE_FEATURE_KERNEL_DISPATCH
Queue supports kernel dispatch packets.
@ HSA_QUEUE_FEATURE_AGENT_DISPATCH
Queue supports agent dispatch packets.
@ HSA_QUEUE_TYPE_SINGLE
Queue only supports a single producer.
@ HSA_QUEUE_TYPE_MULTI
Queue supports multiple producers.
struct hsa_signal_s hsa_signal_t
Signal handle.
void HSA_API hsa_signal_xor_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise XOR operation between the value of a signal and a given value.
hsa_signal_value_t HSA_API hsa_signal_exchange_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal and return its previous value.
void HSA_API HSA_DEPRECATED hsa_signal_add_acquire(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API hsa_signal_store_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal.
void HSA_API hsa_signal_and_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise AND operation between the value of a signal and a given value.
void HSA_API hsa_signal_add_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically increment the value of a signal by a given amount.
hsa_signal_value_t HSA_API hsa_signal_load_relaxed(hsa_signal_t signal)
Atomically read the current value of a signal.
void HSA_API hsa_signal_xor_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise XOR operation between the value of a signal and a given value.
void HSA_API HSA_DEPRECATED hsa_signal_or_release(hsa_signal_t signal, hsa_signal_value_t value)
hsa_status_t HSA_API hsa_signal_destroy(hsa_signal_t signal)
Destroy a signal previous created by hsa_signal_create.
void HSA_API hsa_signal_or_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise OR operation between the value of a signal and a given value.
hsa_signal_value_t HSA_API hsa_signal_cas_relaxed(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
Atomically set the value of a signal if the observed value is equal to the expected value.
void HSA_API hsa_signal_or_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise OR operation between the value of a signal and a given value.
void HSA_API HSA_DEPRECATED hsa_signal_subtract_release(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API hsa_signal_wait_relaxed(hsa_signal_t signal, hsa_signal_condition_t condition, hsa_signal_value_t compare_value, uint64_t timeout_hint, hsa_wait_state_t wait_state_hint)
Wait until a signal value satisfies a specified condition, or a certain amount of time has elapsed.
void HSA_API HSA_DEPRECATED hsa_signal_or_acquire(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API hsa_signal_cas_scacq_screl(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
Atomically set the value of a signal if the observed value is equal to the expected value.
void HSA_API HSA_DEPRECATED hsa_signal_and_release(hsa_signal_t signal, hsa_signal_value_t value)
hsa_status_t HSA_API hsa_signal_group_wait_any_relaxed(hsa_signal_group_t signal_group, const hsa_signal_condition_t *conditions, const hsa_signal_value_t *compare_values, hsa_wait_state_t wait_state_hint, hsa_signal_t *signal, hsa_signal_value_t *value)
Wait until the value of at least one of the signals in a signal group satisfies its associated condit...
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_cas_acq_rel(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
void HSA_API hsa_signal_subtract_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically decrement the value of a signal by a given amount.
void HSA_API hsa_signal_subtract_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically decrement the value of a signal by a given amount.
void HSA_API HSA_DEPRECATED hsa_signal_and_acquire(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_exchange_release(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API hsa_signal_xor_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise XOR operation between the value of a signal and a given value.
int32_t hsa_signal_value_t
Signal value.
void HSA_API hsa_signal_or_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise OR operation between the value of a signal and a given value.
void HSA_API hsa_signal_silent_store_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal without necessarily notifying the the agents waiting on it.
void HSA_API hsa_signal_subtract_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically decrement the value of a signal by a given amount.
void HSA_API HSA_DEPRECATED hsa_signal_store_release(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_subtract_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API hsa_signal_xor_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise XOR operation between the value of a signal and a given value.
hsa_status_t HSA_API hsa_signal_group_create(uint32_t num_signals, const hsa_signal_t *signals, uint32_t num_consumers, const hsa_agent_t *consumers, hsa_signal_group_t *signal_group)
Create a signal group.
void HSA_API hsa_signal_add_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically increment the value of a signal by a given amount.
void HSA_API hsa_signal_add_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically increment the value of a signal by a given amount.
hsa_signal_value_t HSA_API hsa_signal_cas_scacquire(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
Atomically set the value of a signal if the observed value is equal to the expected value.
void HSA_API hsa_signal_silent_store_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal without necessarily notifying the the agents waiting on it.
void HSA_API HSA_DEPRECATED hsa_signal_xor_release(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API hsa_signal_wait_scacquire(hsa_signal_t signal, hsa_signal_condition_t condition, hsa_signal_value_t compare_value, uint64_t timeout_hint, hsa_wait_state_t wait_state_hint)
Wait until a signal value satisfies a specified condition, or a certain amount of time has elapsed.
hsa_signal_value_t HSA_API hsa_signal_load_scacquire(hsa_signal_t signal)
Atomically read the current value of a signal.
void HSA_API hsa_signal_and_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise AND operation between the value of a signal and a given value.
hsa_signal_value_t HSA_API hsa_signal_exchange_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal and return its previous value.
void HSA_API HSA_DEPRECATED hsa_signal_or_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
hsa_status_t HSA_API hsa_signal_group_wait_any_scacquire(hsa_signal_group_t signal_group, const hsa_signal_condition_t *conditions, const hsa_signal_value_t *compare_values, hsa_wait_state_t wait_state_hint, hsa_signal_t *signal, hsa_signal_value_t *value)
Wait until the value of at least one of the signals in a signal group satisfies its associated condit...
void HSA_API hsa_signal_and_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise AND operation between the value of a signal and a given value.
hsa_signal_condition_t
Wait condition operator.
void HSA_API HSA_DEPRECATED hsa_signal_add_release(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_subtract_acquire(hsa_signal_t signal, hsa_signal_value_t value)
hsa_wait_state_t
State of the application thread during a signal wait.
hsa_status_t HSA_API hsa_signal_group_destroy(hsa_signal_group_t signal_group)
Destroy a signal group previous created by hsa_signal_group_create.
hsa_status_t HSA_API hsa_signal_create(hsa_signal_value_t initial_value, uint32_t num_consumers, const hsa_agent_t *consumers, hsa_signal_t *signal)
Create a signal.
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_exchange_acquire(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_xor_acquire(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API hsa_signal_and_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise AND operation between the value of a signal and a given value.
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_cas_acquire(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_add_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_wait_acquire(hsa_signal_t signal, hsa_signal_condition_t condition, hsa_signal_value_t compare_value, uint64_t timeout_hint, hsa_wait_state_t wait_state_hint)
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_exchange_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_and_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API hsa_signal_exchange_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal and return its previous value.
void HSA_API hsa_signal_subtract_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically decrement the value of a signal by a given amount.
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_load_acquire(hsa_signal_t signal)
hsa_signal_value_t HSA_API hsa_signal_exchange_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal and return its previous value.
void HSA_API hsa_signal_store_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal.
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_cas_release(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
void HSA_API hsa_signal_or_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise OR operation between the value of a signal and a given value.
struct hsa_signal_group_s hsa_signal_group_t
Group of signals.
hsa_signal_value_t HSA_API hsa_signal_cas_screlease(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
Atomically set the value of a signal if the observed value is equal to the expected value.
void HSA_API hsa_signal_add_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically increment the value of a signal by a given amount.
void HSA_API HSA_DEPRECATED hsa_signal_xor_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
@ HSA_SIGNAL_CONDITION_NE
The two operands are not equal.
@ HSA_SIGNAL_CONDITION_EQ
The two operands are equal.
@ HSA_SIGNAL_CONDITION_LT
The first operand is less than the second operand.
@ HSA_SIGNAL_CONDITION_GTE
The first operand is greater than or equal to the second operand.
@ HSA_WAIT_STATE_ACTIVE
The application thread stays active while waiting on a signal.
@ HSA_WAIT_STATE_BLOCKED
The application thread may be rescheduled while waiting on the signal.
hsa_status_t HSA_API hsa_status_string(hsa_status_t status, const char **status_string)
Query additional information about a status code.
hsa_status_t
Status codes.
@ HSA_STATUS_ERROR_INVALID_FILE
The file descriptor is invalid.
@ HSA_STATUS_ERROR_INVALID_RUNTIME_STATE
The HSA runtime is not in the configuration state.
@ HSA_STATUS_ERROR_INVALID_CODE_OBJECT
The code object is invalid.
@ HSA_STATUS_ERROR_OUT_OF_RESOURCES
The HSA runtime failed to allocate the necessary resources.
@ HSA_STATUS_ERROR_INVALID_EXECUTABLE_SYMBOL
The executable symbol is invalid.
@ HSA_STATUS_ERROR_FROZEN_EXECUTABLE
The executable is frozen.
@ HSA_STATUS_ERROR_NOT_INITIALIZED
An API other than hsa_init has been invoked while the reference count of the HSA runtime is 0.
@ HSA_STATUS_ERROR_INVALID_AGENT
The agent is invalid.
@ HSA_STATUS_ERROR_INVALID_PACKET_FORMAT
The AQL packet is malformed.
@ HSA_STATUS_ERROR_INVALID_ISA_NAME
The instruction set architecture name is invalid.
@ HSA_STATUS_ERROR_VARIABLE_UNDEFINED
The variable is undefined.
@ HSA_STATUS_ERROR_INVALID_CODE_SYMBOL
The code object symbol is invalid.
@ HSA_STATUS_ERROR
A generic error has occurred.
@ HSA_STATUS_ERROR_RESOURCE_FREE
An error has been detected while releasing a resource.
@ HSA_STATUS_ERROR_INVALID_ISA
The instruction set architecture is invalid.
@ HSA_STATUS_ERROR_INVALID_WAVEFRONT
The wavefront is invalid.
@ HSA_STATUS_ERROR_INVALID_SYMBOL_NAME
There is no symbol with the given name.
@ HSA_STATUS_ERROR_INVALID_QUEUE_CREATION
The requested queue creation is not valid.
@ HSA_STATUS_ERROR_INVALID_SIGNAL
The signal is invalid.
@ HSA_STATUS_ERROR_INVALID_INDEX
The index is invalid.
@ HSA_STATUS_INFO_BREAK
A traversal over a list of elements has been interrupted by the application before completing.
@ HSA_STATUS_ERROR_INCOMPATIBLE_ARGUMENTS
The arguments passed to a functions are not compatible.
@ HSA_STATUS_ERROR_INVALID_QUEUE
The queue is invalid.
@ HSA_STATUS_ERROR_REFCOUNT_OVERFLOW
The maximum reference count for the object has been reached.
@ HSA_STATUS_ERROR_INVALID_SIGNAL_GROUP
The signal group is invalid.
@ HSA_STATUS_ERROR_INVALID_CODE_OBJECT_READER
The code object reader is invalid.
@ HSA_STATUS_ERROR_VARIABLE_ALREADY_DEFINED
The variable is already defined.
@ HSA_STATUS_ERROR_EXCEPTION
An HSAIL operation resulted in a hardware exception.
@ HSA_STATUS_ERROR_INVALID_ARGUMENT
One of the actual arguments does not meet a precondition stated in the documentation of the correspon...
@ HSA_STATUS_ERROR_INVALID_ALLOCATION
The requested allocation is not valid.
@ HSA_STATUS_ERROR_INVALID_CACHE
The cache is invalid.
@ HSA_STATUS_ERROR_INVALID_REGION
The memory region is invalid.
@ HSA_STATUS_ERROR_INVALID_EXECUTABLE
The executable is invalid.
@ HSA_STATUS_SUCCESS
The function has been executed successfully.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint32_t reserved0
Reserved.
uint64_t reserved2
Reserved.
hsa_signal_t completion_signal
Signal used to indicate completion of the job.
uint16_t type
Application-defined function to be performed by the destination agent.
uint16_t header
Packet header.
Struct containing an opaque handle to an agent, a device that participates in the HSA memory model.
uint64_t handle
Opaque handle.
uint32_t reserved1
Reserved.
uint64_t reserved2
Reserved.
hsa_signal_t completion_signal
Signal used to indicate completion of the job.
uint16_t reserved0
Reserved.
uint16_t header
Packet header.
hsa_signal_t completion_signal
Signal used to indicate completion of the job.
uint32_t reserved1
Reserved.
uint16_t reserved0
Reserved.
uint64_t reserved2
Reserved.
uint16_t header
Packet header.
uint64_t handle
Opaque handle.
Application data handle that is passed to the serialization and deserialization functions.
uint64_t handle
Opaque handle.
Code object reader handle.
uint64_t handle
Opaque handle.
Struct containing an opaque handle to a code object, which contains ISA for finalized kernels and ind...
uint64_t handle
Opaque handle.
Code object symbol handle.
uint64_t handle
Opaque handle.
Three-dimensional coordinate.
Struct containing an opaque handle to an executable, which contains ISA for finalized kernels and ind...
uint64_t handle
Opaque handle.
Executable symbol handle.
uint64_t handle
Opaque handle.
Instruction set architecture.
uint64_t handle
Opaque handle.
AQL kernel dispatch packet.
uint64_t reserved2
Reserved.
uint16_t header
Packet header.
uint32_t grid_size_z
Z dimension of grid, in work-items.
uint32_t group_segment_size
Size in bytes of group memory allocation request (per work-group).
uint16_t reserved0
Reserved.
uint64_t kernel_object
Opaque handle to a code object that includes an implementation-defined executable code for the kernel...
hsa_signal_t completion_signal
Signal used to indicate completion of the job.
uint16_t workgroup_size_y
Y dimension of work-group, in work-items.
uint16_t setup
Dispatch setup parameters.
uint32_t grid_size_x
X dimension of grid, in work-items.
uint16_t workgroup_size_z
Z dimension of work-group, in work-items.
uint16_t workgroup_size_x
X dimension of work-group, in work-items.
uint32_t private_segment_size
Size in bytes of private memory allocation request (per work-item).
uint32_t grid_size_y
Y dimension of grid, in work-items.
Loaded code object handle.
uint64_t handle
Opaque handle.
uint32_t size
Maximum number of packets the queue can hold.
hsa_queue_type32_t type
Queue type.
uint64_t id
Queue identifier, which is unique over the lifetime of the application.
uint32_t reserved1
Reserved.
uint32_t features
Queue features mask.
hsa_signal_t doorbell_signal
Signal object used by the application to indicate the ID of a packet that is ready to be processed.
A memory region represents a block of virtual memory with certain properties.
uint64_t handle
Opaque handle.
uint64_t handle
Opaque handle.
uint64_t handle
Opaque handle.
uint64_t handle
Opaque handle.
const std::string & name()