Skip to content

Commit 079967c

Browse files
committed
[NFC][AMDGPU] Document target ID syntax for code object V2 to V3
Differential Revision: https://reviews.llvm.org/D95018
1 parent 7b5d7c7 commit 079967c

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

llvm/docs/AMDGPUUsage.rst

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,13 +524,35 @@ description. The AMDGPU target specific information is:
524524
**target-feature**
525525
Is a target feature name specified in :ref:`amdgpu-target-features-table` that
526526
is supported by the processor. The target features supported by each processor
527-
is specified in :ref:`amdgpu-processor-table`. Those that can be specifeid in
527+
is specified in :ref:`amdgpu-processor-table`. Those that can be specified in
528528
a target ID are marked as being controlled by ``-mcpu`` and
529529
``--offload-arch``. Each target feature must appear at most once in a target
530530
ID. The non-canonical form target ID allows the target features to be
531531
specified in any order. The canonical form target ID requires the target
532532
features to be specified in alphabetic order.
533533

534+
.. _amdgpu-target-id-v2-v3:
535+
536+
Code Object V2 to V3 Target ID
537+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
538+
539+
The target ID syntax for code object V2 to V3 is the same as defined in `Clang
540+
Offload Bundler <https://clang.llvm.org/docs/ClangOffloadBundler.html>`_ except
541+
when used in the :ref:`amdgpu-assembler-directive-amdgcn-target` assembler
542+
directive and the bundle entry ID. In those cases it has the following BNF
543+
syntax:
544+
545+
.. code::
546+
547+
<target-id> ::== <processor> ( "+" <target-feature> )*
548+
549+
Where a target feature is omitted if *Off* and present if *On* or *Any*.
550+
551+
.. note::
552+
553+
The code object V2 to V3 cannot represent *Any* and treats it the same as
554+
*On*.
555+
534556
.. _amdgpu-embedding-bundled-objects:
535557

536558
Embedding Bundled Code Objects
@@ -540,6 +562,11 @@ AMDGPU supports the HIP and OpenMP languages that perform code object embedding
540562
as described in `Clang Offload Bundler
541563
<https://clang.llvm.org/docs/ClangOffloadBundler.html>`_.
542564

565+
.. note::
566+
567+
The target ID syntax used for code object V2 to V3 for a bundle entry ID
568+
differs from that used elsewhere. See :ref:`amdgpu-target-id-v2-v3`.
569+
543570
.. _amdgpu-address-spaces:
544571

545572
Address Spaces
@@ -9196,6 +9223,8 @@ architecture processors, and are not OS-specific. Directives which begin with
91969223
``amdhsa`` OS is specified. See :ref:`amdgpu-target-triples` and
91979224
:ref:`amdgpu-processors`.
91989225

9226+
.. _amdgpu-assembler-directive-amdgcn-target:
9227+
91999228
.amdgcn_target <target-triple> "-" <target-id>
92009229
++++++++++++++++++++++++++++++++++++++++++++++
92019230

@@ -9205,6 +9234,11 @@ command-line options such as ``-triple``, ``-mcpu``, and
92059234
``--offload-arch=<target-id>``. A non-canonical target ID is allowed. See
92069235
:ref:`amdgpu-target-triples` and :ref:`amdgpu-target-id`.
92079236

9237+
.. note::
9238+
9239+
The target ID syntax used for code object V2 to V3 for this directive differs
9240+
from that used elsewhere. See :ref:`amdgpu-target-id-v2-v3`.
9241+
92089242
.amdhsa_kernel <name>
92099243
+++++++++++++++++++++
92109244

0 commit comments

Comments
 (0)