AMD GCN Function Attributes#
These function attributes are supported by the AMD GCN back end:
- amdgpu_hsa_kernel#
This attribute indicates that the corresponding function should be compiled as a kernel function, that is an entry point that can be invoked from the host via the HSA runtime library. By default functions are only callable only from other GCN functions.
This attribute is implicitly applied to any function named
main, using default parameters.Kernel functions may return an integer value, which will be written to a conventional place within the HSA “kernargs” region.
The attribute parameters configure what values are passed into the kernel function by the GPU drivers, via the initial register state. Some values are used by the compiler, and therefore forced on. Enabling other options may break assumptions in the compiler and/or run-time libraries.
private_segment_bufferSet
enable_sgpr_private_segment_bufferflag. Always on (required to locate the stack).dispatch_ptrSet
enable_sgpr_dispatch_ptrflag. Always on (required to locate the launch dimensions).queue_ptrSet
enable_sgpr_queue_ptrflag. Always on (required to convert address spaces).kernarg_segment_ptrSet
enable_sgpr_kernarg_segment_ptrflag. Always on (required to locate the kernel arguments, “kernargs”).dispatch_idSet
enable_sgpr_dispatch_idflag.flat_scratch_initSet
enable_sgpr_flat_scratch_initflag.private_segment_sizeSet
enable_sgpr_private_segment_sizeflag.grid_workgroup_count_XSet
enable_sgpr_grid_workgroup_count_xflag. Always on (required to use OpenACC/OpenMP).grid_workgroup_count_YSet
enable_sgpr_grid_workgroup_count_yflag.grid_workgroup_count_ZSet
enable_sgpr_grid_workgroup_count_zflag.workgroup_id_XSet
enable_sgpr_workgroup_id_xflag.workgroup_id_YSet
enable_sgpr_workgroup_id_yflag.workgroup_id_ZSet
enable_sgpr_workgroup_id_zflag.workgroup_infoSet
enable_sgpr_workgroup_infoflag.private_segment_wave_offsetSet
enable_sgpr_private_segment_wave_byte_offsetflag. Always on (required to locate the stack).work_item_id_XSet
enable_vgpr_workitem_idparameter. Always on (can’t be disabled).work_item_id_YSet
enable_vgpr_workitem_idparameter. Always on (required to enable vectorization.)work_item_id_ZSet
enable_vgpr_workitem_idparameter. Always on (required to use OpenACC/OpenMP).