Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
neon60 committed May 23, 2024
1 parent 9444143 commit ef47c06
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
24 changes: 12 additions & 12 deletions docs/how-to/hip_porting_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,20 @@ Unlike `__CUDA_ARCH__`, the `__HIP_DEVICE_COMPILE__` value is 1 or undefined, an
|Define | HIP-Clang | NVCC | Other (GCC, ICC, Clang, etc.)
|--- | --- | --- |--- |
|HIP-related defines: |
|`__HIP_PLATFORM_AMD__` | Defined | Undefined | Defined if targeting AMD platform; undefined otherwise |
|HIP-related defines:|
|`__HIP_PLATFORM_AMD__` | Defined | Undefined | Defined if targeting AMD platform; undefined otherwise |
|`__HIP_PLATFORM_NVIDIA__` | Undefined | Defined | Defined if targeting NVIDIA platform; undefined otherwise |
|`__HIP_DEVICE_COMPILE__` | 1 if compiling for device; undefined if compiling for host | 1 if compiling for device; undefined if compiling for host | Undefined
|`__HIPCC__` | Defined | Defined | Undefined
|`__HIP_ARCH_*` | 0 or 1 depending on feature support (see below) | 0 or 1 depending on feature support (see below) | 0
|nvcc-related defines: |
|`__CUDACC__` | Defined if source code is compiled by nvcc; undefined otherwise | Undefined
|`__NVCC__` | Undefined | Defined | Undefined
|`__CUDA_ARCH__` | Undefined | Unsigned representing compute capability (e.g., "130") if in device code; 0 if in host code | Undefined
|`__HIP_DEVICE_COMPILE__` | 1 if compiling for device; undefined if compiling for host | 1 if compiling for device; undefined if compiling for host | Undefined
|`__HIPCC__` | Defined | Defined | Undefined
|`__HIP_ARCH_*` | 0 or 1 depending on feature support (see below) | 0 or 1 depending on feature support (see below) | 0
|nvcc-related defines:|
|`__CUDACC__` | Defined if source code is compiled by nvcc; undefined otherwise | Undefined
|`__NVCC__` Undefined | Defined | Undefined
|`__CUDA_ARCH__` | Undefined | Unsigned representing compute capability (e.g., "130") if in device code; 0 if in host code | Undefined
|hip-clang-related defines:|
|`__HIP__` | Defined | Undefined | Undefined
|`__HIP__` | Defined | Undefined | Undefined
|HIP-Clang common defines: |
|`__clang__` | Defined | Defined | Undefined | Defined if using Clang; otherwise undefined
|`__clang__` | Defined | Defined | Undefined | Defined if using Clang; otherwise undefined
## Identifying Architecture Features
Expand Down Expand Up @@ -370,7 +370,7 @@ Code should not assume a warp size of 32 or 64. See [Warp Cross-Lane Functions]
### Kernel launch with group size > 256
Kernel code should use ``` __attribute__((amdgpu_flat_work_group_size(<min>,<max>)))```.
Kernel code should use ```__attribute__((amdgpu_flat_work_group_size(<min>,<max>)))```.
For example:
Expand Down
4 changes: 3 additions & 1 deletion docs/how-to/hip_rtc.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ int main() {
## HIPRTC specific options

HIPRTC provides a few HIPRTC specific flags

* ```--gpu-architecture``` : This flag can guide the code object generation for a specific gpu arch. Example: ```--gpu-architecture=gfx906:sramecc+:xnack-```, its equivalent to ```--offload-arch```.
* This option is compulsory if compilation is done on a system without AMD GPUs supported by HIP runtime.
* Otherwise, HIPRTC will load the hip runtime and gather the current device and its architecture info and use it as option.
Expand Down Expand Up @@ -407,7 +408,7 @@ std::cout << "hiprtcCompileProgram fails with error " << hiprtcGetErrorString(re

HIPRTC provides the following API for querying the version.

hiprtcVersion(int* major, int* minor) - This sets the output parameters major and minor with the HIP Runtime compilation major version and minor version number respectively.
```hiprtcVersion(int* major, int* minor)``` - This sets the output parameters major and minor with the HIP Runtime compilation major version and minor version number respectively.

Check failure on line 411 in docs/how-to/hip_rtc.md

View workflow job for this annotation

GitHub Actions / Documentation / Markdown

Spaces inside emphasis markers

docs/how-to/hip_rtc.md:411:21 MD037/no-space-in-emphasis Spaces inside emphasis markers [Context: "* major, int*"] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md037.md

Currently, it returns hardcoded value. This should be implemented to return HIP runtime major and minor version in the future releases.

Expand Down Expand Up @@ -493,6 +494,7 @@ Please have a look at hiprtcGetLoweredName.cpp for the detailed example.
## Versioning

HIPRTC follows the below versioning.

* Linux
* HIPRTC follows the same versioning as HIP runtime library.
* The `so` name field for the shared library is set to MAJOR version. For example, for HIP 5.3 the `so` name is set to 5 (hiprtc.so.5).
Expand Down
2 changes: 1 addition & 1 deletion docs/install/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Install HIP
*******************************************

HIP can be installed on AMD (ROCm with HIP-Clang) and NVIDIA (CUDA with nvcc) platforms.
HIP can be installed on AMD (ROCm with HIP-Clang) and NVIDIA (CUDA with NVCC) platforms.

Note: The version definition for the HIP runtime is different from CUDA. On an AMD platform, the
``hipRuntimeGerVersion`` function returns the HIP runtime version; on an NVIDIA platform, this function
Expand Down

0 comments on commit ef47c06

Please sign in to comment.