|
|
|
# Hipify the code
|
|
|
|
To be able to use the toolkit with AMD ROCm you need to first hipify the code.
|
|
|
|
Use provided script
|
|
|
|
To use the toolkit with AMD ROCm, you need to first hipify the code.
|
|
|
|
Use the provided script
|
|
|
|
[hipify.sh](https://gitlab.fizyka.pw.edu.pl/wtools/wslda/-/blob/public/hipify.sh).
|
|
|
|
The script uses `hipify-perl` conversion tool. You can download it from [here](https://github.com/ROCm-Developer-Tools/HIPIFY).
|
|
|
|
The script uses the `hipify-perl` conversion tool. You can download it from [here](https://github.com/ROCm-Developer-Tools/HIPIFY).
|
|
|
|
In the script you need to set correctly invocation of the `hipify-perl` tool.
|
|
|
|
```bash
|
|
|
|
# SETTINGS
|
|
|
|
HIPIFY_CMD="hipify-perl -hip-kernel-execution-syntax"
|
|
|
|
```
|
|
|
|
The script must be executed from the main folder of W-SLDA Toolkit:
|
|
|
|
The script must be executed from the main folder of the W-SLDA Toolkit:
|
|
|
|
```
|
|
|
|
gawlazlo@uan02:/project/project_465000150/share/wslda> ./hipify.sh
|
|
|
|
---> Converting WSLDA to HIP environment
|
| ... | ... | @@ -23,7 +23,7 @@ gawlazlo@uan02:/project/project_465000150/share/wslda> ./hipify.sh |
|
|
|
```
|
|
|
|
|
|
|
|
# Compiling the code with HIP
|
|
|
|
In order to activate compilation with `hipcc` compiler (analog of `nvcc` compiler) add to Makefile flags `HIPCC` and `HIPCCFLAGS`. For example:
|
|
|
|
In order to activate compilation with the `hipcc` compiler (analog of the `nvcc` compiler), add to the Makefile flags `HIPCC` and `HIPCCFLAGS`. For example:
|
|
|
|
```make
|
|
|
|
# COMPILERS
|
|
|
|
CXX=cc
|
| ... | ... | @@ -38,7 +38,7 @@ OBJDIR=./obj/ |
|
|
|
BINDIR=./
|
|
|
|
|
|
|
|
# COMPILER FLAGS
|
|
|
|
# You may need to add also info about the platform
|
|
|
|
# You may also need to add info about the platform
|
|
|
|
# and path to HIP include files for C compiler
|
|
|
|
CFLAGS=-D__HIP_PLATFORM_AMD__ -I$(HIP_PATH)/include
|
|
|
|
# NVCCFLAGS= commented intentionally, it is replaced by HIPCCFLAGS below
|
| ... | ... | |