Skip to content

Commit

Permalink
Update exercise-instructions.md
Browse files Browse the repository at this point in the history
  • Loading branch information
csccva authored Jul 1, 2024
1 parent 659d0ce commit c13615b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions exercise-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,18 @@ CC -xhip <source.cpp>
```
HIP codes can be compiled as well using the `hipcc` AMD compiler:
```
hipcc --offload-arch=gfx90a streams.cpp
hipcc --offload-arch=gfx90a `CC --cray-print-opts=cflags` <source>.cpp `CC --cray-print-opts=libs`
```
The flag `--offload-arch=gfx90a` indicates that we are targeting MI200 GPUs.
The flag `--offload-arch=gfx90a` indicates that we are targeting MI200 GPUs. If the code uses some libraries we need extract from the `CC` wrapers. This is doen via the flags `CC --cray-print-opts=cflags` and `CC --cray-print-opts=libs`.

A more elegant solution would be to use:
```
export HIPCC_COMPILE_FLAGS_APPEND="--offload-arch=gfx90a $(CC --cray-print-opts=cflags)"
export HIPCC_LINK_FLAGS_APPEND=$(CC --cray-print-opts=libs)
hipcc <source.cpp>
```
This is helpful when using make.
#### HIPFORT
The following modules are required:
```bash
Expand Down

0 comments on commit c13615b

Please sign in to comment.