1"""Enum values for HSA 2 3Note that Python namespacing could be used to avoid the C-like 4prefixing, but we choose to keep the same names as found in the C 5enums, in order to match the documentation. 6""" 7 8import ctypes 9 10HSA_LARGE_MODEL = ctypes.sizeof(ctypes.c_void_p) == 8 11 12# hsa_status_t 13 14# The function has been executed successfully. 15HSA_STATUS_SUCCESS = 0x0 16# A traversal over a list of elements has been interrupted by the 17# application before completing. 18HSA_STATUS_INFO_BREAK = 0x1 19# A generic error has occurred. 20HSA_STATUS_ERROR = 0x1000 21# One of the actual arguments does not meet a precondition stated in the 22# documentation of the corresponding formal argument. 23HSA_STATUS_ERROR_INVALID_ARGUMENT = 0x1001 24# The requested queue creation is not valid. 25HSA_STATUS_ERROR_INVALID_QUEUE_CREATION = 0x1002 26# The requested allocation is not valid. 27HSA_STATUS_ERROR_INVALID_ALLOCATION = 0x1003 28# The agent is invalid. 29HSA_STATUS_ERROR_INVALID_AGENT = 0x1004 30# The memory region is invalid. 31HSA_STATUS_ERROR_INVALID_REGION = 0x1005 32# The signal is invalid. 33HSA_STATUS_ERROR_INVALID_SIGNAL = 0x1006 34# The queue is invalid. 35HSA_STATUS_ERROR_INVALID_QUEUE = 0x1007 36# The HSA runtime failed to allocate the necessary resources. This error 37# may also occur when the HSA runtime needs to spawn threads or create 38# internal OS-specific events. 39HSA_STATUS_ERROR_OUT_OF_RESOURCES = 0x1008 40# The AQL packet is malformed. 41HSA_STATUS_ERROR_INVALID_PACKET_FORMAT = 0x1009 42# An error has been detected while releasing a resource. 43HSA_STATUS_ERROR_RESOURCE_FREE = 0x100A 44# An API other than ::hsa_init has been invoked while the reference count 45# of the HSA runtime is 0. 46HSA_STATUS_ERROR_NOT_INITIALIZED = 0x100B 47# The maximum reference count for the object has been reached. 48HSA_STATUS_ERROR_REFCOUNT_OVERFLOW = 0x100C 49# The arguments passed to a functions are not compatible. 50HSA_STATUS_ERROR_INCOMPATIBLE_ARGUMENTS = 0x100D 51# The index is invalid.\ 52HSA_STATUS_ERROR_INVALID_INDEX = 0x100E 53# The instruction set architecture is invalid. 54HSA_STATUS_ERROR_INVALID_ISA = 0x100F, 55# The instruction set architecture name is invalid. 56HSA_STATUS_ERROR_INVALID_ISA_NAME = 0x1017 57# The code object is invalid. 58HSA_STATUS_ERROR_INVALID_CODE_OBJECT = 0x1010 59# The executable is invalid. 60HSA_STATUS_ERROR_INVALID_EXECUTABLE = 0x1011 61# The executable is frozen. 62HSA_STATUS_ERROR_FROZEN_EXECUTABLE = 0x1012 63# There is no symbol with the given name. 64HSA_STATUS_ERROR_INVALID_SYMBOL_NAME = 0x1013 65# The variable is already defined. 66HSA_STATUS_ERROR_VARIABLE_ALREADY_DEFINED = 0x1014 67# The variable is undefined. 68HSA_STATUS_ERROR_VARIABLE_UNDEFINED = 0x1015 69# An HSAIL operation resulted on a hardware exception. 70HSA_STATUS_ERROR_EXCEPTION = 0x1016 71 72# hsa_packet_type_t 73HSA_PACKET_TYPE_VENDOR_SPECIFIC = 0 74# The packet has been processed in the past, but has not been reassigned to 75# the packet processor. A packet processor must not process a packet of this 76# type. All queues support this packet type. 77HSA_PACKET_TYPE_INVALID = 1 78# Packet used by agents for dispatching jobs to kernel agents. Not all 79# queues support packets of this type (see ::hsa_queue_feature_t). 80HSA_PACKET_TYPE_KERNEL_DISPATCH = 2 81# Packet used by agents to delay processing of subsequent packets, and to 82# express complex dependencies between multiple packets. All queues support 83# this packet type. 84HSA_PACKET_TYPE_BARRIER_AND = 3 85# Packet used by agents for dispatching jobs to agents. Not all 86# queues support packets of this type (see ::hsa_queue_feature_t). 87HSA_PACKET_TYPE_AGENT_DISPATCH = 4 88# Packet used by agents to delay processing of subsequent packets, and to 89# express complex dependencies between multiple packets. All queues support 90# this packet type. 91HSA_PACKET_TYPE_BARRIER_OR = 5 92 93# hsa_queue_type_t 94HSA_QUEUE_TYPE_MULTI = 0 95HSA_QUEUE_TYPE_SINGLE = 1 96 97# hsa_queue_feature_t 98HSA_QUEUE_FEATURE_KERNEL_DISPATCH = 1 99HSA_QUEUE_FEATURE_AGENT_DISPATCH = 2 100 101# hsa_fence_scope_t 102HSA_FENCE_SCOPE_NONE = 0 103HSA_FENCE_SCOPE_AGENT = 1 104HSA_FENCE_SCOPE_SYSTEM = 2 105 106# hsa_wait_state_t 107# The application thread may be rescheduled while waiting on the signal. 108HSA_WAIT_STATE_BLOCKED = 0 109# The application thread stays active while waiting on a signal. 110HSA_WAIT_STATE_ACTIVE = 1 111 112# hsa_signal_condition_t 113HSA_SIGNAL_CONDITION_EQ = 0 114HSA_SIGNAL_CONDITION_NE = 1 115HSA_SIGNAL_CONDITION_LT = 2 116HSA_SIGNAL_CONDITION_GTE = 3 117 118# # hsa_dim_t 119# HSA_DIM_X = 0 120# HSA_DIM_Y = 1 121# HSA_DIM_Z = 2 122 123# hsa_extension_t 124HSA_EXTENSION_FINALIZER = 0 125HSA_EXTENSION_IMAGES = 1 126HSA_EXTENSION_AMD_PROFILER = 2 127 128# hsa_agent_feature_t 129HSA_AGENT_FEATURE_KERNEL_DISPATCH = 1 130HSA_AGENT_FEATURE_AGENT_DISPATCH = 2 131 132# hsa_device_type_t 133HSA_DEVICE_TYPE_CPU = 0 134HSA_DEVICE_TYPE_GPU = 1 135HSA_DEVICE_TYPE_DSP = 2 136 137# hsa_system_info_t 138HSA_SYSTEM_INFO_VERSION_MAJOR = 0 139HSA_SYSTEM_INFO_VERSION_MINOR = 1 140HSA_SYSTEM_INFO_TIMESTAMP = 2 141HSA_SYSTEM_INFO_TIMESTAMP_FREQUENCY = 3 142HSA_SYSTEM_INFO_SIGNAL_MAX_WAIT = 4 143HSA_SYSTEM_INFO_ENDIANNESS = 5 144HSA_SYSTEM_INFO_MACHINE_MODEL = 6 145HSA_SYSTEM_INFO_EXTENSIONS = 7 146 147# hsa_agent_info_t 148 149# Agent name. The type of this attribute is a NUL-terminated char[64]. If 150# the name of the agent uses less than 63 characters, the rest of the 151# array must be filled with NULs. 152HSA_AGENT_INFO_NAME = 0 153# Name of vendor. The type of this attribute is a NUL-terminated char[64]. If 154# the name of the vendor uses less than 63 characters, the rest of the array 155# must be filled with NULs. 156HSA_AGENT_INFO_VENDOR_NAME = 1 157# Agent capability. The type of this attribute is ::hsa_agent_feature_t. 158HSA_AGENT_INFO_FEATURE = 2 159# Machine model supported by the agent. The type of this attribute is 160# ::hsa_machine_model_t. 161HSA_AGENT_INFO_MACHINE_MODEL = 3 162# Profile supported by the agent. The type of this attribute is 163# ::hsa_profile_t. 164HSA_AGENT_INFO_PROFILE = 4 165# Default floating-point rounding mode. The type of this attribute is 166# ::hsa_default_float_rounding_mode_t, but the value 167# ::HSA_DEFAULT_FLOAT_ROUNDING_MODE_DEFAULT is not allowed. 168HSA_AGENT_INFO_DEFAULT_FLOAT_ROUNDING_MODE = 5 169# Default floating-point rounding modes supported by the agent in the Base 170# profile. The type of this attribute is a mask of 171# ::hsa_default_float_rounding_mode_t. The default floating-point rounding 172# mode (::HSA_AGENT_INFO_DEFAULT_FLOAT_ROUNDING_MODE) bit must not be set. 173HSA_AGENT_INFO_BASE_PROFILE_DEFAULT_FLOAT_ROUNDING_MODES = 23 174# Flag indicating that the f16 HSAIL operation is at least as fast as the 175# f32 operation in the current agent. The value of this attribute is 176# undefined if the agent is not a kernel agent. The type of this 177# attribute is bool. 178HSA_AGENT_INFO_FAST_F16_OPERATION = 24 179# Number of work-items in a wavefront. Must be a power of 2 in the range 180# [1,256]. The value of this attribute is undefined if the agent is not 181# a kernel agent. The type of this attribute is uint32_t. 182HSA_AGENT_INFO_WAVEFRONT_SIZE = 6 183# Maximum number of work-items of each dimension of a work-group. Each 184# maximum must be greater than 0. No maximum can exceed the value of 185# ::HSA_AGENT_INFO_WORKGROUP_MAX_SIZE. The value of this attribute is 186# undefined if the agent is not a kernel agent. The type of this 187# attribute is uint16_t[3]. 188HSA_AGENT_INFO_WORKGROUP_MAX_DIM = 7 189# Maximum total number of work-items in a work-group. The value of this 190# attribute is undefined if the agent is not a kernel agent. The type 191# of this attribute is uint32_t. 192HSA_AGENT_INFO_WORKGROUP_MAX_SIZE = 8 193# Maximum number of work-items of each dimension of a grid. Each maximum must 194# be greater than 0, and must not be smaller than the corresponding value in 195# ::HSA_AGENT_INFO_WORKGROUP_MAX_DIM. No maximum can exceed the value of 196# ::HSA_AGENT_INFO_GRID_MAX_SIZE. The value of this attribute is undefined if 197# the agent is not a kernel agent. The type of this attribute is 198# ::hsa_dim3_t. 199HSA_AGENT_INFO_GRID_MAX_DIM = 9 200# Maximum total number of work-items in a grid. The value of this attribute 201# is undefined if the agent is not a kernel agent. The type of this 202# attribute is uint32_t. 203HSA_AGENT_INFO_GRID_MAX_SIZE = 10 204# Maximum number of fbarriers per work-group. Must be at least 32. The value 205# of this attribute is undefined if the agent is not a kernel agent. The 206# type of this attribute is uint32_t. 207HSA_AGENT_INFO_FBARRIER_MAX_SIZE = 11 208# Maximum number of queues that can be active (created but not destroyed) at 209# one time in the agent. The type of this attribute is uint32_t. 210HSA_AGENT_INFO_QUEUES_MAX = 12 211# Minimum number of packets that a queue created in the agent 212# can hold. Must be a power of 2 greater than 0. Must not exceed 213# the value of ::HSA_AGENT_INFO_QUEUE_MAX_SIZE. The type of this 214# attribute is uint32_t. 215HSA_AGENT_INFO_QUEUE_MIN_SIZE = 13 216# Maximum number of packets that a queue created in the agent can 217# hold. Must be a power of 2 greater than 0. The type of this attribute 218# is uint32_t. 219HSA_AGENT_INFO_QUEUE_MAX_SIZE = 14 220# Type of a queue created in the agent. The type of this attribute is 221# ::hsa_queue_type_t. 222HSA_AGENT_INFO_QUEUE_TYPE = 15 223# Identifier of the NUMA node associated with the agent. The type of this 224# attribute is uint32_t. 225HSA_AGENT_INFO_NODE = 16 226# Type of hardware device associated with the agent. The type of this 227# attribute is ::hsa_device_type_t. 228HSA_AGENT_INFO_DEVICE = 17 229# Array of data cache sizes (L1..L4). Each size is expressed in bytes. A size 230# of 0 for a particular level indicates that there is no cache information 231# for that level. The type of this attribute is uint32_t[4]. 232HSA_AGENT_INFO_CACHE_SIZE = 18 233# Instruction set architecture of the agent. The type of this attribute 234# is ::hsa_isa_t. 235HSA_AGENT_INFO_ISA = 19 236# Bit-mask indicating which extensions are supported by the agent. An 237# extension with an ID of @p i is supported if the bit at position @p i is 238# set. The type of this attribute is uint8_t[128]. 239HSA_AGENT_INFO_EXTENSIONS = 20 240# Major version of the HSA runtime specification supported by the 241# agent. The type of this attribute is uint16_t. 242HSA_AGENT_INFO_VERSION_MAJOR = 21 243# Minor version of the HSA runtime specification supported by the 244# agent. The type of this attribute is uint16_t. 245HSA_AGENT_INFO_VERSION_MINOR = 22 246 247# hsa_region_segment_t 248# Global segment. Used to hold data that is shared by all agents. 249HSA_REGION_SEGMENT_GLOBAL = 0 250# Read-only segment. Used to hold data that remains constant during the 251# execution of a kernel. 252HSA_REGION_SEGMENT_READONLY = 1 253# Private segment. Used to hold data that is local to a single work-item. 254HSA_REGION_SEGMENT_PRIVATE = 2 255# Group segment. Used to hold data that is shared by the work-items of a 256# work-group. 257HSA_REGION_SEGMENT_GROUP = 3 258 259# hsa_region_global_flag_t 260# The application can use memory in the region to store kernel arguments, and 261# provide the values for the kernarg segment of a kernel dispatch. If this 262# flag is set, then ::HSA_REGION_GLOBAL_FLAG_FINE_GRAINED must be set. 263HSA_REGION_GLOBAL_FLAG_KERNARG = 1 264# Updates to memory in this region are immediately visible to all the 265# agents under the terms of the HSA memory model. If this 266# flag is set, then ::HSA_REGION_GLOBAL_FLAG_COARSE_GRAINED must not be set. 267HSA_REGION_GLOBAL_FLAG_FINE_GRAINED = 2 268# Updates to memory in this region can be performed by a single agent at 269# a time. If a different agent in the system is allowed to access the 270# region, the application must explicitely invoke ::hsa_memory_assign_agent 271# in order to transfer ownership to that agent for a particular buffer. 272HSA_REGION_GLOBAL_FLAG_COARSE_GRAINED = 4 273 274# hsa_region_info_t 275 276# Segment where memory in the region can be used. The type of this 277# attribute is ::hsa_region_segment_t. 278HSA_REGION_INFO_SEGMENT = 0 279# Flag mask. The value of this attribute is undefined if the value of 280# ::HSA_REGION_INFO_SEGMENT is not ::HSA_REGION_SEGMENT_GLOBAL. The type of 281# this attribute is uint32_t, a bit-field of ::hsa_region_global_flag_t 282# values. 283HSA_REGION_INFO_GLOBAL_FLAGS = 1 284# Size of this region, in bytes. The type of this attribute is size_t. 285HSA_REGION_INFO_SIZE = 2 286# Maximum allocation size in this region, in bytes. Must not exceed the value 287# of ::HSA_REGION_INFO_SIZE. The type of this attribute is size_t. 288# 289# If the region is in the global or readonly segments, this is the maximum 290# size that the application can pass to ::hsa_memory_allocate. If the region 291# is in the group segment, this is the maximum size (per work-group) that can 292# be requested for a given kernel dispatch. If the region is in the private 293# segment, this is the maximum size (per work-item) that can be request for a 294# specific kernel dispatch. 295HSA_REGION_INFO_ALLOC_MAX_SIZE = 4 296# Indicates whether memory in this region can be allocated using 297# ::hsa_memory_allocate. The type of this attribute is bool. 298# 299# The value of this flag is always false for regions in the group and private 300# segments. 301HSA_REGION_INFO_RUNTIME_ALLOC_ALLOWED = 5 302# Allocation granularity of buffers allocated by ::hsa_memory_allocate in 303# this region. The size of a buffer allocated in this region is a multiple of 304# the value of this attribute. The value of this attribute is only defined if 305# ::HSA_REGION_INFO_RUNTIME_ALLOC_ALLOWED is true for this region. The type 306# of this attribute is size_t. 307HSA_REGION_INFO_RUNTIME_ALLOC_GRANULE = 6 308# Alignment of buffers allocated by ::hsa_memory_allocate in this region. The 309# value of this attribute is only defined if 310# ::HSA_REGION_INFO_RUNTIME_ALLOC_ALLOWED is true for this region, and must 311# be a power of 2. The type of this attribute is size_t. 312HSA_REGION_INFO_RUNTIME_ALLOC_ALIGNMENT = 7 313 314 315# hsa_profile_t 316HSA_PROFILE_BASE = 0 317HSA_PROFILE_FULL = 1 318 319# hsa_machine_model_t 320HSA_MACHINE_MODEL_SMALL = 0 321HSA_MACHINE_MODEL_LARGE = 1 322 323 324# hsa_executable_symbol_info_t 325 326 327# The kind of the symbol. The type of this attribute is ::hsa_symbol_kind_t. 328HSA_EXECUTABLE_SYMBOL_INFO_TYPE = 0 329# The length of the symbol name. The type of this attribute is uint32_t. 330HSA_EXECUTABLE_SYMBOL_INFO_NAME_LENGTH = 1 331# The name of the symbol. The type of this attribute is character array with 332# the length equal to the value of ::HSA_EXECUTABLE_SYMBOL_INFO_NAME_LENGTH 333# attribute 334HSA_EXECUTABLE_SYMBOL_INFO_NAME = 2 335# The length of the module name to which this symbol belongs if this symbol 336# has module linkage, otherwise 0 is returned. The type of this attribute is 337# uint32_t. 338HSA_EXECUTABLE_SYMBOL_INFO_MODULE_NAME_LENGTH = 3 339# The module name to which this symbol belongs if this symbol has module 340# linkage, otherwise empty string is returned. The type of this attribute is 341# character array with the length equal to the value of 342# ::HSA_EXECUTABLE_SYMBOL_INFO_MODULE_NAME_LENGTH attribute. 343HSA_EXECUTABLE_SYMBOL_INFO_MODULE_NAME = 4 344# Agent associated with this symbol. If the symbol is a variable, the 345# value of this attribute is only defined if 346# ::HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ALLOCATION is 347# ::HSA_VARIABLE_ALLOCATION_AGENT. The type of this attribute is hsa_agent_t. 348HSA_EXECUTABLE_SYMBOL_INFO_AGENT = 20 349# The address of the variable. The value of this attribute is undefined if 350# the symbol is not a variable. The type of this attribute is uint64_t. 351# If executable's state is ::HSA_EXECUTABLE_STATE_UNFROZEN, then 0 is 352# returned. 353HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ADDRESS = 21 354# The linkage kind of the symbol. The type of this attribute is 355# ::hsa_symbol_linkage_t. 356HSA_EXECUTABLE_SYMBOL_INFO_LINKAGE = 5 357# Indicates whether the symbol corresponds to a definition. The type of this 358# attribute is bool. 359HSA_EXECUTABLE_SYMBOL_INFO_IS_DEFINITION = 17 360# The allocation kind of the variable. The value of this attribute is 361# undefined if the symbol is not a variable. The type of this attribute is 362# ::hsa_variable_allocation_t. 363HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ALLOCATION = 6 364# The segment kind of the variable. The value of this attribute is undefined 365# if the symbol is not a variable. The type of this attribute is 366# ::hsa_variable_segment_t. 367HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_SEGMENT = 7 368# Alignment of the variable. The value of this attribute is undefined if 369# the symbol is not a variable. The type of this attribute is uint32_t. 370HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ALIGNMENT = 8 371# Size of the variable. The value of this attribute is undefined if 372# the symbol is not a variable. The type of this attribute is uint32_t. 373# 374# A value of 0 is returned if the variable is an external variable and has an 375# unknown dimension. 376HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_SIZE = 9 377# Indicates whether the variable is constant. The value of this attribute is 378# undefined if the symbol is not a variable. The type of this attribute is 379# bool. 380HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_IS_CONST = 10 381 382# Kernel object handle, used in the kernel dispatch packet. The value of this 383# attribute is undefined if the symbol is not a kernel. The type of this 384# attribute is uint64_t. 385# 386# If the state of the executable is ::HSA_EXECUTABLE_STATE_UNFROZEN, then 0 387# is returned. 388HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_OBJECT = 22 389# Size of kernarg segment memory that is required to hold the values of the 390# kernel arguments, in bytes. The value of this attribute is undefined if the 391# symbol is not a kernel. The type of this attribute is uint32_t. 392HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE = 11 393# Alignment (in bytes) of the buffer used to pass arguments to the kernel, 394# which is the maximum of 16 and the maximum alignment of any of the kernel 395# arguments. The value of this attribute is undefined if the symbol is not a 396# kernel. The type of this attribute is uint32_t. 397HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_ALIGNMENT = 12 398# Size of static group segment memory required by the kernel (per 399# work-group), in bytes. The value of this attribute is undefined 400# if the symbol is not a kernel. The type of this attribute is uint32_t. 401# 402# The reported amount does not include any dynamically allocated group 403# segment memory that may be requested by the application when a kernel is 404# dispatched. 405HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_GROUP_SEGMENT_SIZE = 13 406# Size of static private, spill, and arg segment memory required by 407# this kernel (per work-item), in bytes. The value of this attribute is 408# undefined if the symbol is not a kernel. The type of this attribute is 409# uint32_t. 410# 411# If the value of ::HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK is 412# true, the kernel may use more private memory than the reported value, and 413# the application must add the dynamic call stack usage to @a 414# private_segment_size when populating a kernel dispatch packet. 415HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_PRIVATE_SEGMENT_SIZE = 14 416# Dynamic callstack flag. The value of this attribute is undefined if the 417# symbol is not a kernel. The type of this attribute is bool. 418# 419# If this flag is set (the value is true), the kernel uses a dynamically 420# sized call stack. This can happen if recursive calls, calls to indirect 421# functions, or the HSAIL alloca instruction are present in the kernel. 422HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK = 15 423# Indirect function object handle. The value of this attribute is undefined 424# if the symbol is not an indirect function, or the associated agent does 425# not support the Full Profile. The type of this attribute depends on the 426# machine model: if machine model is small, then the type is uint32_t, if 427# machine model is large, then the type is uint64_t. 428# 429# If the state of the executable is ::HSA_EXECUTABLE_STATE_UNFROZEN, then 0 430# is returned. 431HSA_EXECUTABLE_SYMBOL_INFO_INDIRECT_FUNCTION_OBJECT = 23 432# Call convention of the indirect function. The value of this attribute is 433# undefined if the symbol is not an indirect function, or the associated 434# agent does not support the Full Profile. The type of this attribute is 435# uint32_t. 436HSA_EXECUTABLE_SYMBOL_INFO_INDIRECT_FUNCTION_CALL_CONVENTION = 16 437 438 439# hsa_default_float_rounding_mode_t 440 441# Use a default floating-point rounding mode specified elsewhere. 442HSA_DEFAULT_FLOAT_ROUNDING_MODE_DEFAULT = 0 443# Operations that specify the default floating-point mode are rounded to zero 444# by default. 445HSA_DEFAULT_FLOAT_ROUNDING_MODE_ZERO = 1 446# Operations that specify the default floating-point mode are rounded to the 447# nearest representable number and that ties should be broken by selecting 448# the value with an even least significant bit. 449HSA_DEFAULT_FLOAT_ROUNDING_MODE_NEAR = 2 450 451# hsa_code_object_type_t 452HSA_CODE_OBJECT_TYPE_PROGRAM = 0 453 454 455# hsa_executable_state_t 456 457# Executable state, which allows the user to load code objects and define 458# external variables. Variable addresses, kernel code handles, and 459# indirect function code handles are not available in query operations until 460# the executable is frozen (zero always returned). 461 462HSA_EXECUTABLE_STATE_UNFROZEN = 0 463 464# Executable state, which allows the user to query variable addresses, 465# kernel code handles, and indirect function code handles using query 466# operation. Loading new code objects, as well as defining external variables 467# is not allowed in this state. 468 469HSA_EXECUTABLE_STATE_FROZEN = 1 470 471 472# hsa_kernel_dispatch_packet_setup_t 473HSA_KERNEL_DISPATCH_PACKET_SETUP_DIMENSIONS = 0 474 475 476 477# hsa_packet_header_t 478HSA_PACKET_HEADER_TYPE = 0 479HSA_PACKET_HEADER_BARRIER = 8 480HSA_PACKET_HEADER_ACQUIRE_FENCE_SCOPE = 9 481HSA_PACKET_HEADER_RELEASE_FENCE_SCOPE = 11 482 483