]> git.ipfire.org Git - thirdparty/gcc.git/blob
15034deea282934fe537d093312cd41ace41b572
[thirdparty/gcc.git] /
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. _amd-gcn-function-attributes:
7
8 AMD GCN Function Attributes
9 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
11 These function attributes are supported by the AMD GCN back end:
12
13 .. index:: amdgpu_hsa_kernel function attribute, AMD GCN
14
15 .. amd-gcn-fn-attr:: amdgpu_hsa_kernel
16
17 This attribute indicates that the corresponding function should be compiled as
18 a kernel function, that is an entry point that can be invoked from the host
19 via the HSA runtime library. By default functions are only callable only from
20 other GCN functions.
21
22 This attribute is implicitly applied to any function named ``main``, using
23 default parameters.
24
25 Kernel functions may return an integer value, which will be written to a
26 conventional place within the HSA "kernargs" region.
27
28 The attribute parameters configure what values are passed into the kernel
29 function by the GPU drivers, via the initial register state. Some values are
30 used by the compiler, and therefore forced on. Enabling other options may
31 break assumptions in the compiler and/or run-time libraries.
32
33 ``private_segment_buffer``
34 Set ``enable_sgpr_private_segment_buffer`` flag. Always on (required to
35 locate the stack).
36
37 ``dispatch_ptr``
38 Set ``enable_sgpr_dispatch_ptr`` flag. Always on (required to locate the
39 launch dimensions).
40
41 ``queue_ptr``
42 Set ``enable_sgpr_queue_ptr`` flag. Always on (required to convert address
43 spaces).
44
45 ``kernarg_segment_ptr``
46 Set ``enable_sgpr_kernarg_segment_ptr`` flag. Always on (required to
47 locate the kernel arguments, "kernargs").
48
49 ``dispatch_id``
50 Set ``enable_sgpr_dispatch_id`` flag.
51
52 ``flat_scratch_init``
53 Set ``enable_sgpr_flat_scratch_init`` flag.
54
55 ``private_segment_size``
56 Set ``enable_sgpr_private_segment_size`` flag.
57
58 ``grid_workgroup_count_X``
59 Set ``enable_sgpr_grid_workgroup_count_x`` flag. Always on (required to
60 use OpenACC/OpenMP).
61
62 ``grid_workgroup_count_Y``
63 Set ``enable_sgpr_grid_workgroup_count_y`` flag.
64
65 ``grid_workgroup_count_Z``
66 Set ``enable_sgpr_grid_workgroup_count_z`` flag.
67
68 ``workgroup_id_X``
69 Set ``enable_sgpr_workgroup_id_x`` flag.
70
71 ``workgroup_id_Y``
72 Set ``enable_sgpr_workgroup_id_y`` flag.
73
74 ``workgroup_id_Z``
75 Set ``enable_sgpr_workgroup_id_z`` flag.
76
77 ``workgroup_info``
78 Set ``enable_sgpr_workgroup_info`` flag.
79
80 ``private_segment_wave_offset``
81 Set ``enable_sgpr_private_segment_wave_byte_offset`` flag. Always on
82 (required to locate the stack).
83
84 ``work_item_id_X``
85 Set ``enable_vgpr_workitem_id`` parameter. Always on (can't be disabled).
86
87 ``work_item_id_Y``
88 Set ``enable_vgpr_workitem_id`` parameter. Always on (required to enable
89 vectorization.)
90
91 ``work_item_id_Z``
92 Set ``enable_vgpr_workitem_id`` parameter. Always on (required to use
93 OpenACC/OpenMP).