11#ifndef AMDKERNELCODET_H
12#define AMDKERNELCODET_H
43#define AMD_HSA_BITS_SET(dst, mask, val) \
44 dst &= (~(1 << mask ## _SHIFT) & ~mask); \
45 dst |= (((val) << mask ## _SHIFT) & mask)
48#define AMD_HSA_BITS_GET(src, mask) \
49 ((src & mask) >> mask ## _SHIFT) \
amd_element_byte_size_t
The values used to define the number of bytes to use for the swizzle element size.
uint64_t hsa_ext_control_directive_present64_t
uint8_t hsa_ext_brig_profile8_t
uint8_t hsa_ext_brig_machine_model8_t
uint64_t amd_compute_pgm_resource_register64_t
Shader program settings for CS.
uint32_t amd_code_property32_t
Every amd_*_code_t has the following properties, which are composed of a number of bit fields.
uint32_t hsa_ext_code_kind_t
struct hsa_dim3_s hsa_dim3_t
@ AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_X_SHIFT
@ AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_Y
@ AMD_CODE_PROPERTY_IS_PTR64_WIDTH
@ AMD_CODE_PROPERTY_IS_DYNAMIC_CALLSTACK_SHIFT
Indicate if the generated ISA is using a dynamically sized call stack.
@ AMD_CODE_PROPERTY_RESERVED1
@ AMD_CODE_PROPERTY_ENABLE_SGPR_KERNARG_SEGMENT_PTR_WIDTH
@ AMD_CODE_PROPERTY_RESERVED2_WIDTH
@ AMD_CODE_PROPERTY_PRIVATE_ELEMENT_SIZE_WIDTH
@ AMD_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_ID
@ AMD_CODE_PROPERTY_RESERVED1_WIDTH
@ AMD_CODE_PROPERTY_PRIVATE_ELEMENT_SIZE_SHIFT
The interleave (swizzle) element size in bytes required by the code for private memory.
@ AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_Y_SHIFT
@ AMD_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32
@ AMD_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_PTR_WIDTH
@ AMD_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_SIZE_SHIFT
@ AMD_CODE_PROPERTY_IS_DYNAMIC_CALLSTACK_WIDTH
@ AMD_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_ID_SHIFT
@ AMD_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32_WIDTH
@ AMD_CODE_PROPERTY_PRIVATE_ELEMENT_SIZE
@ AMD_CODE_PROPERTY_ENABLE_SGPR_FLAT_SCRATCH_INIT_SHIFT
@ AMD_CODE_PROPERTY_RESERVED2
@ AMD_CODE_PROPERTY_RESERVED2_SHIFT
@ AMD_CODE_PROPERTY_ENABLE_SGPR_KERNARG_SEGMENT_PTR
@ AMD_CODE_PROPERTY_ENABLE_SGPR_QUEUE_PTR
@ AMD_CODE_PROPERTY_IS_DEBUG_SUPPORTED
@ AMD_CODE_PROPERTY_ENABLE_ORDERED_APPEND_GDS_WIDTH
@ AMD_CODE_PROPERTY_IS_PTR64_SHIFT
Are global memory addresses 64 bits.
@ AMD_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_SIZE
@ AMD_CODE_PROPERTY_ENABLE_ORDERED_APPEND_GDS
@ AMD_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_PTR_SHIFT
@ AMD_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_BUFFER
@ AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_Y_WIDTH
@ AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_X
@ AMD_CODE_PROPERTY_ENABLE_SGPR_QUEUE_PTR_SHIFT
@ AMD_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32_SHIFT
@ AMD_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_BUFFER_SHIFT
Enable the setup of the SGPR user data registers (AMD_CODE_PROPERTY_ENABLE_SGPR_*),...
@ AMD_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_BUFFER_WIDTH
@ AMD_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_PTR
@ AMD_CODE_PROPERTY_IS_XNACK_SUPPORTED
@ AMD_CODE_PROPERTY_ENABLE_ORDERED_APPEND_GDS_SHIFT
Control wave ID base counter for GDS ordered-append.
@ AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_Z_WIDTH
@ AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_Z
@ AMD_CODE_PROPERTY_ENABLE_SGPR_KERNARG_SEGMENT_PTR_SHIFT
@ AMD_CODE_PROPERTY_IS_DEBUG_SUPPORTED_WIDTH
@ AMD_CODE_PROPERTY_ENABLE_SGPR_QUEUE_PTR_WIDTH
@ AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_Z_SHIFT
@ AMD_CODE_PROPERTY_RESERVED1_SHIFT
@ AMD_CODE_PROPERTY_ENABLE_SGPR_FLAT_SCRATCH_INIT_WIDTH
@ AMD_CODE_PROPERTY_ENABLE_SGPR_FLAT_SCRATCH_INIT
@ AMD_CODE_PROPERTY_IS_PTR64
@ AMD_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_ID_WIDTH
@ AMD_CODE_PROPERTY_IS_XNACK_SUPPORTED_WIDTH
@ AMD_CODE_PROPERTY_IS_DYNAMIC_CALLSTACK
@ AMD_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_SIZE_WIDTH
@ AMD_CODE_PROPERTY_IS_XNACK_SUPPORTED_SHIFT
@ AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_X_WIDTH
@ AMD_CODE_PROPERTY_IS_DEBUG_SUPPORTED_SHIFT
Indicate if code generated has support for debugging.
uint32_t amd_code_version32_t
The version of the amd_*_code_t struct.
struct hsa_ext_control_directives_s hsa_ext_control_directives_t
The hsa_ext_control_directives_t specifies the values for the HSAIL control directives.
uint32_t hsa_ext_code_kind32_t
uint16_t hsa_ext_exception_kind16_t
AMD Kernel Code Object (amd_kernel_code_t).
uint16_t amd_machine_version_minor
uint16_t workitem_vgpr_count
Number of vector registers used by each work-item.
uint16_t amd_machine_kind
uint16_t reserved_vgpr_first
If reserved_vgpr_count is 0 then must be 0.
uint64_t runtime_loader_kernel_symbol
uint8_t group_segment_alignment
uint32_t code_properties
Code properties.
uint8_t private_segment_alignment
uint32_t amd_kernel_code_version_major
uint16_t reserved_vgpr_count
The number of consecutive VGPRs reserved by the client.
uint8_t kernarg_segment_alignment
The maximum byte alignment of variables used by the kernel in the specified memory segment.
uint8_t wavefront_size
Wavefront size expressed as a power of two.
uint16_t reserved_sgpr_first
If reserved_sgpr_count is 0 then must be 0.
uint16_t amd_machine_version_major
uint32_t workgroup_group_segment_byte_size
The amount of group segment memory required by a work-group in bytes.
uint16_t wavefront_sgpr_count
Number of scalar registers used by a wavefront.
uint32_t gds_segment_byte_size
Number of byte of GDS required by kernel dispatch.
int64_t kernel_code_entry_byte_offset
Byte offset (possibly negative) from start of amd_kernel_code_t object to kernel's entry point instru...
int64_t kernel_code_prefetch_byte_offset
Range of bytes to consider prefetching expressed as an offset and size.
uint16_t amd_machine_version_stepping
uint32_t workitem_private_segment_byte_size
The amount of memory required for the combined private, spill and arg segments for a work-item in byt...
uint64_t reserved0
Reserved. Must be 0.
uint64_t kernarg_segment_byte_size
The size in bytes of the kernarg segment that holds the values of the arguments to the kernel.
uint64_t kernel_code_prefetch_byte_size
uint64_t control_directives[16]
uint16_t debug_private_segment_buffer_sgpr
If is_debug_supported is 0 then must be 0.
uint32_t workgroup_fbarrier_count
Number of fbarrier's used in the kernel and all functions it calls.
uint32_t amd_kernel_code_version_minor
uint16_t debug_wavefront_private_segment_offset_sgpr
If is_debug_supported is 0 then must be 0.
uint16_t reserved_sgpr_count
The number of consecutive SGPRs reserved by the client.
uint64_t compute_pgm_resource_registers
Shader program settings for CS.
The hsa_ext_control_directives_t specifies the values for the HSAIL control directives.
uint8_t reserved[75]
Reserved. Must be 0.
hsa_ext_exception_kind16_t enable_detect_exceptions
If enableDetectExceptions is not enabled then must be 0, otherwise must be non-0 and specifies the se...
hsa_ext_control_directive_present64_t enabled_control_directives
This is a bit set indicating which control directives have been specified.
uint32_t max_dynamic_group_size
If maxDynamicGroupSize is not enabled then must be 0, and any amount of dynamic group segment can be ...
uint32_t requested_workgroups_per_cu
If requestedWorkgroupsPerCu is not enabled then must be 0, and the finalizer is free to generate ISA ...
hsa_ext_exception_kind16_t enable_break_exceptions
If enableBreakExceptions is not enabled then must be 0, otherwise must be non-0 and specifies the set...
uint32_t max_flat_grid_size
If maxFlatGridSize is not enabled then must be 0, otherwise must be greater than 0.
hsa_dim3_t required_grid_size
If not enabled then all elements for Dim3 must be 0, otherwise every element must be greater than 0.
hsa_dim3_t required_workgroup_size
If requiredWorkgroupSize is not enabled then all elements for Dim3 must be 0, and the produced code c...
uint8_t required_dim
If requiredDim is not enabled then must be 0 and the produced kernel code can be dispatched with 1,...
uint32_t max_flat_workgroup_size
If maxFlatWorkgroupSize is not enabled then must be 0, otherwise must be greater than 0.