| 1 |
.. raw:: html |
| 2 |
|
| 3 |
<style type="text/css"> |
| 4 |
.none { background-color: #FFCCCC } |
| 5 |
.part { background-color: #FFFF99 } |
| 6 |
.good { background-color: #CCFF99 } |
| 7 |
</style> |
| 8 |
|
| 9 |
.. role:: none |
| 10 |
.. role:: part |
| 11 |
.. role:: good |
| 12 |
|
| 13 |
.. contents:: |
| 14 |
:local: |
| 15 |
|
| 16 |
============== |
| 17 |
AMDGPU Support |
| 18 |
============== |
| 19 |
|
| 20 |
Clang supports OpenCL, HIP and OpenMP on AMD GPU targets. |
| 21 |
|
| 22 |
|
| 23 |
Predefined Macros |
| 24 |
================= |
| 25 |
|
| 26 |
|
| 27 |
.. list-table:: |
| 28 |
:header-rows: 1 |
| 29 |
|
| 30 |
* - Macro |
| 31 |
- Description |
| 32 |
* - ``__AMDGPU__`` |
| 33 |
- Indicates that the code is being compiled for an AMD GPU. |
| 34 |
* - ``__AMDGCN__`` |
| 35 |
- Defined if the GPU target is AMDGCN. |
| 36 |
* - ``__R600__`` |
| 37 |
- Defined if the GPU target is R600. |
| 38 |
* - ``__<ArchName>__`` |
| 39 |
- Defined with the name of the architecture (e.g., ``__gfx906__`` for the gfx906 architecture). |
| 40 |
* - ``__<GFXN>__`` |
| 41 |
- Defines the GFX family (e.g., for gfx906, this macro would be ``__GFX9__``). |
| 42 |
* - ``__amdgcn_processor__`` |
| 43 |
- Defined with the processor name as a string (e.g., ``"gfx906"``). |
| 44 |
* - ``__amdgcn_target_id__`` |
| 45 |
- Defined with the target ID as a string. |
| 46 |
* - ``__amdgcn_feature_<feature-name>__`` |
| 47 |
- Defined for each supported target feature. The value is 1 if the feature is enabled and 0 if it is disabled. Allowed feature names are sramecc and xnack. |
| 48 |
* - ``__AMDGCN_CUMODE__`` |
| 49 |
- Defined as 1 if the CU mode is enabled and 0 if the WGP mode is enabled. |
| 50 |
* - ``__AMDGCN_UNSAFE_FP_ATOMICS__`` |
| 51 |
- Defined if unsafe floating-point atomics are allowed. |
| 52 |
* - ``__HAS_FMAF__`` |
| 53 |
- Defined if FMAF instruction is available (deprecated). |
| 54 |
* - ``__HAS_LDEXPF__`` |
| 55 |
- Defined if LDEXPF instruction is available (deprecated). |
| 56 |
* - ``__HAS_FP64__`` |
| 57 |
- Defined if FP64 instruction is available (deprecated). |
| 58 |
|
| 59 |
Please note that the specific architecture and feature names will vary depending on the GPU. Also, some macros are deprecated and may be removed in future releases. |