diff --git a/exercise-instructions.md b/exercise-instructions.md index 61fae960..b51ec79f 100644 --- a/exercise-instructions.md +++ b/exercise-instructions.md @@ -184,10 +184,18 @@ CC -xhip ``` 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` .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 +``` +This is helpful when using make. #### HIPFORT The following modules are required: ```bash