SWDEV-265003 - update HIP document

Change-Id: I1e8ec3ad380330b48d164a2ca60b0a70f7e54ae6
This commit is contained in:
jujiang
2021-01-19 19:28:16 -05:00
committed by Julia Jiang
parent ecdbaf73cf
commit 6084d0da2d
+6 -4
View File
@@ -147,9 +147,11 @@ directory names.
### Identifying HIP Target Platform ### Identifying HIP Target Platform
All HIP projects target either AMD or NVIDIA platform. The platform affects which headers are included and which libraries are used for linking. All HIP projects target either AMD or NVIDIA platform. The platform affects which headers are included and which libraries are used for linking.
- `HIP_PLATFORM_AMD` is defined if the HIP platform targets AMD - `HIP_PLATFORM_AMD` is defined if the HIP platform targets AMD.
Note, `HIP_PLATFORM_HCC` was previously defined if the HIP platform targeted AMD, it is deprecated.
- `HIP_PLATFORM_NVIDA` is defined if the HIP platform targets NVIDIA - `HIP_PLATFORM_NVIDA` is defined if the HIP platform targets NVIDIA.
Note, `HIP_PLATFORM_NVCC` was previously defined if the HIP platform targeted NVIDIA, it is deprecated.
### Identifying the Compiler: hip-clang or nvcc ### Identifying the Compiler: hip-clang or nvcc
Often, it's useful to know whether the underlying compiler is HIP-Clang or nvcc. This knowledge can guard platform-specific code or aid in platform-specific performance tuning. Often, it's useful to know whether the underlying compiler is HIP-Clang or nvcc. This knowledge can guard platform-specific code or aid in platform-specific performance tuning.
@@ -189,7 +191,6 @@ HIP-Clang will have multiple passes over the code: one for the host code, and on
Unlike `__CUDA_ARCH__`, the `__HIP_DEVICE_COMPILE__` value is 1 or undefined, and it doesn't represent the feature capability of the target device. Unlike `__CUDA_ARCH__`, the `__HIP_DEVICE_COMPILE__` value is 1 or undefined, and it doesn't represent the feature capability of the target device.
### Compiler Defines: Summary ### Compiler Defines: Summary
|Define | HIP-Clang | nvcc | Other (GCC, ICC, Clang, etc.) |Define | HIP-Clang | nvcc | Other (GCC, ICC, Clang, etc.)
|--- | --- | --- |---| |--- | --- | --- |---|
@@ -286,9 +287,10 @@ HIP can depend on ROCclr, or NVCC as runtime
- AMD platform - AMD platform
On AMD platform, HIP uses Radeon Open Compute Common Language Runtime, called ROCclr. On AMD platform, HIP uses Radeon Open Compute Common Language Runtime, called ROCclr.
ROCclr is a virtual device interface that HIP runtimes interact with different backends which allows runtimes to work on Linux , as well as Windows without much efforts. ROCclr is a virtual device interface that HIP runtimes interact with different backends which allows runtimes to work on Linux , as well as Windows without much efforts.
Note, `HIP_ROCclr` needed to be defined on AMD platform that HIP used ROCclr, only when platform was defined as deprecated `HIP_PLATFORM_HCC`.
- NVIDIA platform - NVIDIA platform
On Nvidia platform, HIP is just a thin layer on top of CUDA. On Nvidia platform, HIP is just a thin layer on top of CUDA.
On non-AMD platform, HIP runtime determines if nvcc is available and can be used. If available, HIP_PLATFORM is set to nvcc and underneath CUDA path is used. On non-AMD platform, HIP runtime determines if nvcc is available and can be used. If available, HIP_PLATFORM is set to nvcc and underneath CUDA path is used.