gem5  v20.1.0.0
Classes | Typedefs | Enumerations | Functions
Code Objects (deprecated).

Classes

struct  hsa_code_object_s
 Struct containing an opaque handle to a code object, which contains ISA for finalized kernels and indirect functions together with information about the global or readonly segment variables they reference. More...
 
struct  hsa_callback_data_s
 Application data handle that is passed to the serialization and deserialization functions. More...
 
struct  hsa_code_symbol_s
 Code object symbol handle. More...
 

Typedefs

typedef 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 indirect functions together with information about the global or readonly segment variables they reference. More...
 
typedef struct hsa_callback_data_s hsa_callback_data_t
 Application data handle that is passed to the serialization and deserialization functions. More...
 
typedef struct hsa_code_symbol_s hsa_code_symbol_t
 Code object symbol handle. More...
 

Enumerations

enum  hsa_code_object_type_t { HSA_CODE_OBJECT_TYPE_PROGRAM = 0 }
 Code object type. More...
 
enum  hsa_code_object_info_t {
  HSA_CODE_OBJECT_INFO_VERSION = 0, HSA_CODE_OBJECT_INFO_TYPE = 1, HSA_CODE_OBJECT_INFO_ISA = 2, HSA_CODE_OBJECT_INFO_MACHINE_MODEL = 3,
  HSA_CODE_OBJECT_INFO_PROFILE = 4, HSA_CODE_OBJECT_INFO_DEFAULT_FLOAT_ROUNDING_MODE = 5
}
 Code object attributes. More...
 
enum  hsa_code_symbol_info_t {
  HSA_CODE_SYMBOL_INFO_TYPE = 0, HSA_CODE_SYMBOL_INFO_NAME_LENGTH = 1, HSA_CODE_SYMBOL_INFO_NAME = 2, HSA_CODE_SYMBOL_INFO_MODULE_NAME_LENGTH = 3,
  HSA_CODE_SYMBOL_INFO_MODULE_NAME = 4, HSA_CODE_SYMBOL_INFO_LINKAGE = 5, HSA_CODE_SYMBOL_INFO_IS_DEFINITION = 17, HSA_CODE_SYMBOL_INFO_VARIABLE_ALLOCATION = 6,
  HSA_CODE_SYMBOL_INFO_VARIABLE_SEGMENT = 7, HSA_CODE_SYMBOL_INFO_VARIABLE_ALIGNMENT = 8, HSA_CODE_SYMBOL_INFO_VARIABLE_SIZE = 9, HSA_CODE_SYMBOL_INFO_VARIABLE_IS_CONST = 10,
  HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE = 11, HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_ALIGNMENT = 12, HSA_CODE_SYMBOL_INFO_KERNEL_GROUP_SEGMENT_SIZE = 13, HSA_CODE_SYMBOL_INFO_KERNEL_PRIVATE_SEGMENT_SIZE = 14,
  HSA_CODE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK = 15, HSA_CODE_SYMBOL_INFO_KERNEL_CALL_CONVENTION = 18, HSA_CODE_SYMBOL_INFO_INDIRECT_FUNCTION_CALL_CONVENTION = 16
}
 Code object symbol attributes. More...
 

Functions

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. More...
 
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. More...
 
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_destroy (hsa_code_object_t code_object)
 Destroy a code object. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 iteration. More...
 

Detailed Description

Typedef Documentation

◆ hsa_callback_data_t

Application data handle that is passed to the serialization and deserialization functions.

Deprecated:

◆ hsa_code_object_t

Struct containing an opaque handle to a code object, which contains ISA for finalized kernels and indirect functions together with information about the global or readonly segment variables they reference.

Deprecated:

◆ hsa_code_symbol_t

Code object symbol handle.

Deprecated:

The lifetime of a code object symbol matches that of the code object associated with it. An operation on a symbol whose associated code object has been destroyed results in undefined behavior.

Enumeration Type Documentation

◆ hsa_code_object_info_t

Code object attributes.

Deprecated:
Enumerator
HSA_CODE_OBJECT_INFO_VERSION 

The version of the code object.

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_CODE_OBJECT_INFO_TYPE 

Type of code object.

The type of this attribute is hsa_code_object_type_t.

HSA_CODE_OBJECT_INFO_ISA 

Instruction set architecture this code object is produced for.

The type of this attribute is hsa_isa_t.

HSA_CODE_OBJECT_INFO_MACHINE_MODEL 

Machine model this code object is produced for.

The type of this attribute is hsa_machine_model_t.

HSA_CODE_OBJECT_INFO_PROFILE 

Profile this code object is produced for.

The type of this attribute is hsa_profile_t.

HSA_CODE_OBJECT_INFO_DEFAULT_FLOAT_ROUNDING_MODE 

Default floating-point rounding mode used when the code object is produced.

The type of this attribute is hsa_default_float_rounding_mode_t.

Definition at line 5231 of file hsa.h.

◆ hsa_code_object_type_t

Code object type.

Deprecated:
Enumerator
HSA_CODE_OBJECT_TYPE_PROGRAM 

Produces code object that contains ISA for all kernels and indirect functions in HSA source.

Definition at line 5218 of file hsa.h.

◆ hsa_code_symbol_info_t

Code object symbol attributes.

Deprecated:
Enumerator
HSA_CODE_SYMBOL_INFO_TYPE 

The type of the symbol.

The type of this attribute is hsa_symbol_kind_t.

HSA_CODE_SYMBOL_INFO_NAME_LENGTH 

The length of the symbol name in bytes, not including the NUL terminator.

The type of this attribute is uint32_t.

HSA_CODE_SYMBOL_INFO_NAME 

The name of the symbol.

The type of this attribute is character array with the length equal to the value of HSA_CODE_SYMBOL_INFO_NAME_LENGTH attribute.

HSA_CODE_SYMBOL_INFO_MODULE_NAME_LENGTH 

The length of the module name in bytes (not including the NUL terminator) to which this symbol belongs if this symbol has module linkage, otherwise 0 is returned.

The type of this attribute is uint32_t.

HSA_CODE_SYMBOL_INFO_MODULE_NAME 

The module name to which this symbol belongs if this symbol has module linkage, otherwise an empty string is returned.

The type of this attribute is character array with the length equal to the value of HSA_CODE_SYMBOL_INFO_MODULE_NAME_LENGTH attribute.

HSA_CODE_SYMBOL_INFO_LINKAGE 

The linkage kind of the symbol.

The type of this attribute is hsa_symbol_linkage_t.

HSA_CODE_SYMBOL_INFO_IS_DEFINITION 

Indicates whether the symbol corresponds to a definition.

The type of this attribute is bool.

HSA_CODE_SYMBOL_INFO_VARIABLE_ALLOCATION 

The allocation kind of the variable.

The value of this attribute is undefined if the symbol is not a variable. The type of this attribute is hsa_variable_allocation_t.

HSA_CODE_SYMBOL_INFO_VARIABLE_SEGMENT 

The segment kind of the variable.

The value of this attribute is undefined if the symbol is not a variable. The type of this attribute is hsa_variable_segment_t.

HSA_CODE_SYMBOL_INFO_VARIABLE_ALIGNMENT 

Alignment of the symbol in memory.

The value of this attribute is undefined if the symbol is not a variable. The type of this attribute is uint32_t.

The current alignment of the variable in memory may be greater than the value specified in the source program variable declaration.

HSA_CODE_SYMBOL_INFO_VARIABLE_SIZE 

Size of the variable.

The value of this attribute is undefined if the symbol is not a variable. The type of this attribute is uint32_t.

A size of 0 is returned if the variable is an external variable and has an unknown dimension.

HSA_CODE_SYMBOL_INFO_VARIABLE_IS_CONST 

Indicates whether the variable is constant.

The value of this attribute is undefined if the symbol is not a variable. The type of this attribute is bool.

HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE 

Size of kernarg segment memory that is required to hold the values of the kernel arguments, in bytes.

Must be a multiple of 16. The value of this attribute is undefined if the symbol is not a kernel. The type of this attribute is uint32_t.

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 and the maximum alignment of any of the kernel arguments.

The value of this attribute is undefined if the symbol is not a kernel. The type of this attribute is uint32_t.

HSA_CODE_SYMBOL_INFO_KERNEL_GROUP_SEGMENT_SIZE 

Size of static group segment memory required by the kernel (per work-group), in bytes.

The value of this attribute is undefined if the symbol is not a kernel. The type of this attribute is uint32_t.

The reported amount does not include any dynamically allocated group segment memory that may be requested by the application when a kernel is dispatched.

HSA_CODE_SYMBOL_INFO_KERNEL_PRIVATE_SEGMENT_SIZE 

Size of static private, spill, and arg segment memory required by this kernel (per work-item), in bytes.

The value of this attribute is undefined if the symbol is not a kernel. The type of this attribute is uint32_t.

If the value of HSA_CODE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK is true, the kernel may use more private memory than the reported value, and the application must add the dynamic call stack usage to private_segment_size when populating a kernel dispatch packet.

HSA_CODE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK 

Dynamic callstack flag.

The value of this attribute is undefined if the symbol is not a kernel. The type of this attribute is bool.

If this flag is set (the value is true), the kernel uses a dynamically sized call stack. This can happen if recursive calls, calls to indirect functions, or the HSAIL alloca instruction are present in the kernel.

HSA_CODE_SYMBOL_INFO_KERNEL_CALL_CONVENTION 

Call convention of the kernel.

The value of this attribute is undefined if the symbol is not a kernel. The type of this attribute is uint32_t.

HSA_CODE_SYMBOL_INFO_INDIRECT_FUNCTION_CALL_CONVENTION 

Call convention of the indirect function.

The value of this attribute is undefined if the symbol is not an indirect function. The type of this attribute is uint32_t.

Definition at line 5438 of file hsa.h.

Function Documentation

◆ hsa_code_object_deserialize()

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.

Deprecated:
Parameters
[in]serialized_code_objectA serialized code object. Must not be NULL.
[in]serialized_code_object_sizeThe size (in bytes) of serialized_code_object. Must not be 0.
[in]optionsStandard and vendor-specific options. Unknown options are ignored. A standard option begins with the "-hsa_" prefix. Options beginning with the "-hsa_ext_<extension_name>_" prefix are reserved for extensions. A vendor-specific option begins with the "-<vendor_name>_" prefix. Must be a NUL-terminated string. May be NULL.
[out]code_objectMemory location where the HSA runtime stores the deserialized code object.
Return values
HSA_STATUS_SUCCESSThe function has been executed successfully.
HSA_STATUS_ERROR_NOT_INITIALIZEDThe HSA runtime has not been initialized.
HSA_STATUS_ERROR_OUT_OF_RESOURCESThe HSA runtime failed to allocate the required resources.
HSA_STATUS_ERROR_INVALID_ARGUMENTserialized_code_object, or code_object are NULL, or serialized_code_object_size is 0.

◆ hsa_code_object_destroy()

hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_destroy ( hsa_code_object_t  code_object)

Destroy a code object.

Deprecated:

The lifetime of a code object must exceed that of any executable where it has been loaded. If an executable that loaded code_object has not been destroyed, the behavior is undefined.

Parameters
[in]code_objectCode object. The handle becomes invalid after it has been destroyed.
Return values
HSA_STATUS_SUCCESSThe function has been executed successfully.
HSA_STATUS_ERROR_NOT_INITIALIZEDThe HSA runtime has not been initialized.
HSA_STATUS_ERROR_INVALID_CODE_OBJECTcode_object is invalid.

◆ hsa_code_object_get_info()

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.

Deprecated:
Parameters
[in]code_objectCode object.
[in]attributeAttribute to query.
[out]valuePointer 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.
Return values
HSA_STATUS_SUCCESSThe function has been executed successfully.
HSA_STATUS_ERROR_NOT_INITIALIZEDThe HSA runtime has not been initialized.
HSA_STATUS_ERROR_INVALID_CODE_OBJECTcode_object is invalid.
HSA_STATUS_ERROR_INVALID_ARGUMENTattribute is an invalid code object attribute, or value is NULL.

◆ hsa_code_object_get_symbol()

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.

Deprecated:
Parameters
[in]code_objectCode object.
[in]symbol_nameSymbol name.
[out]symbolMemory location where the HSA runtime stores the symbol handle.
Return values
HSA_STATUS_SUCCESSThe function has been executed successfully.
HSA_STATUS_ERROR_NOT_INITIALIZEDThe HSA runtime has not been initialized.
HSA_STATUS_ERROR_INVALID_CODE_OBJECTcode_object is invalid.
HSA_STATUS_ERROR_INVALID_SYMBOL_NAMEThere is no symbol with a name that matches symbol_name.
HSA_STATUS_ERROR_INVALID_ARGUMENTsymbol_name is NULL, or symbol is NULL.

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

Deprecated:
Parameters
[in]code_objectCode object.
[in]module_nameModule name. Must be NULL if the symbol has program linkage.
[in]symbol_nameSymbol name.
[out]symbolMemory location where the HSA runtime stores the symbol handle.
Return values
HSA_STATUS_SUCCESSThe function has been executed successfully.
HSA_STATUS_ERROR_NOT_INITIALIZEDThe HSA runtime has not been initialized.
HSA_STATUS_ERROR_INVALID_CODE_OBJECTcode_object is invalid.
HSA_STATUS_ERROR_INVALID_SYMBOL_NAMEThere is no symbol with a name that matches symbol_name.
HSA_STATUS_ERROR_INVALID_ARGUMENTsymbol_name is NULL, or symbol is NULL.

◆ hsa_code_object_iterate_symbols()

hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_iterate_symbols ( hsa_code_object_t  code_object,
hsa_status_t(*)(hsa_code_object_t code_object, hsa_code_symbol_t symbol, void *data callback,
void *  data 
)

Iterate over the symbols in a code object, and invoke an application-defined callback on every iteration.

Deprecated:
Parameters
[in]code_objectCode object.
[in]callbackCallback to be invoked once per code object symbol. The HSA runtime passes three arguments to the callback: the code object, a symbol, and the application data. If callback returns a status other than HSA_STATUS_SUCCESS for a particular iteration, the traversal stops and hsa_code_object_iterate_symbols returns that status value.
[in]dataApplication data that is passed to callback on every iteration. May be NULL.
Return values
HSA_STATUS_SUCCESSThe function has been executed successfully.
HSA_STATUS_ERROR_NOT_INITIALIZEDThe HSA runtime has not been initialized.
HSA_STATUS_ERROR_INVALID_CODE_OBJECTcode_object is invalid.
HSA_STATUS_ERROR_INVALID_ARGUMENTcallback is NULL.

◆ hsa_code_object_serialize()

hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_serialize ( hsa_code_object_t  code_object,
hsa_status_t(*)(size_t size, hsa_callback_data_t data, void **address)  alloc_callback,
hsa_callback_data_t  callback_data,
const char *  options,
void **  serialized_code_object,
size_t *  serialized_code_object_size 
)

Serialize a code object.

Deprecated:

Can be used for offline finalization, install-time finalization, disk code caching, etc.

Parameters
[in]code_objectCode object.
[in]alloc_callbackCallback function for memory allocation. Must not be NULL. The HSA runtime passes three arguments to the callback: the allocation size, the application data, and a pointer to a memory location where the application stores the allocation result. The HSA runtime invokes alloc_callback once to allocate a buffer that contains the serialized version of code_object. If the callback returns a status code other than HSA_STATUS_SUCCESS, this function returns the same code.
[in]callback_dataApplication data that is passed to alloc_callback. May be NULL.
[in]optionsStandard and vendor-specific options. Unknown options are ignored. A standard option begins with the "-hsa_" prefix. Options beginning with the "-hsa_ext_<extension_name>_" prefix are reserved for extensions. A vendor-specific option begins with the "-<vendor_name>_" prefix. Must be a NUL-terminated string. May be NULL.
[out]serialized_code_objectMemory location where the HSA runtime stores a pointer to the serialized code object. Must not be NULL.
[out]serialized_code_object_sizeMemory location where the HSA runtime stores the size (in bytes) of serialized_code_object. The returned value matches the allocation size passed by the HSA runtime to alloc_callback. Must not be NULL.
Return values
HSA_STATUS_SUCCESSThe function has been executed successfully.
HSA_STATUS_ERROR_NOT_INITIALIZEDThe HSA runtime has not been initialized.
HSA_STATUS_ERROR_OUT_OF_RESOURCESThe HSA runtime failed to allocate the required resources.
HSA_STATUS_ERROR_INVALID_CODE_OBJECTcode_object is invalid.
HSA_STATUS_ERROR_INVALID_ARGUMENTalloc_callback, serialized_code_object, or serialized_code_object_size are NULL.

◆ hsa_code_symbol_get_info()

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.

Deprecated:
Parameters
[in]code_symbolCode symbol.
[in]attributeAttribute to query.
[out]valuePointer 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.
Return values
HSA_STATUS_SUCCESSThe function has been executed successfully.
HSA_STATUS_ERROR_NOT_INITIALIZEDThe HSA runtime has not been initialized.
HSA_STATUS_ERROR_INVALID_CODE_SYMBOLThe code symbol is invalid.
HSA_STATUS_ERROR_INVALID_ARGUMENTattribute is an invalid code symbol attribute, or value is NULL.

◆ hsa_executable_load_code_object()

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.

Deprecated:

Every global or readonly variable that is external must be defined before loading the code object. An internal global or readonly variable is allocated once the code object, that is being loaded, references this variable and this variable is not allocated.

Any module linkage declaration must have been defined either by a define variable or by loading a code object that has a symbol with module linkage definition.

Parameters
[in]executableExecutable.
[in]agentAgent to load code object for. The agent must support the default floating-point rounding mode used by code_object.
[in]code_objectCode object to load. The lifetime of the code object must exceed that of the executable: if code_object is destroyed before executable, the behavior is undefined.
[in]optionsStandard and vendor-specific options. Unknown options are ignored. A standard option begins with the "-hsa_" prefix. Options beginning with the "-hsa_ext_<extension_name>_" prefix are reserved for extensions. A vendor-specific option begins with the "-<vendor_name>_" prefix. Must be a NUL-terminated string. May be NULL.
Return values
HSA_STATUS_SUCCESSThe function has been executed successfully.
HSA_STATUS_ERROR_NOT_INITIALIZEDThe HSA runtime has not been initialized.
HSA_STATUS_ERROR_OUT_OF_RESOURCESThe HSA runtime failed to allocate the required resources.
HSA_STATUS_ERROR_INVALID_EXECUTABLEThe executable is invalid.
HSA_STATUS_ERROR_INVALID_AGENTThe agent is invalid.
HSA_STATUS_ERROR_INVALID_CODE_OBJECTcode_object is invalid.
HSA_STATUS_ERROR_INCOMPATIBLE_ARGUMENTSagent is not compatible with code_object (for example, agent does not support the default floating-point rounding mode specified by code_object), or code_object is not compatible with executable (for example, code_object and executable have different machine models or profiles).
HSA_STATUS_ERROR_FROZEN_EXECUTABLEexecutable is frozen.

Generated on Wed Sep 30 2020 14:02:20 for gem5 by doxygen 1.8.17