Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/std-data/model.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ register_flag_optional(USE_ONEDPL
This requires the DPC++ compiler (other SYCL compilers are untested), required SYCL flags are added automatically."
"OFF")

register_flag_optional(AMDGPU_TARGET_OFFLOAD
"Enable offloading support (via the non-standard `-stdpar`) for
Clang/LLVM. The values are AMDGPU processors (https://www.llvm.org/docs/AMDGPUUsage.html#processors)
which will be passed in via `--offload-arch=` argument.

Example values are:
gfx906 - Compile for Vega20 GPUs
gfx908 - Compile for CDNA1 GPUs
gfx90a - Compile for CDNA2 GPUs
gfx942 - Compile for CDNA3 GPUs
gfx1030 - Compile for RDNA2 NV21 GPUs
gfx1100 - Compile for RDNA3 NV31 GPUs"
"")


macro(setup)
set(CMAKE_CXX_STANDARD 17)
if (NVHPC_OFFLOAD)
Expand All @@ -50,4 +65,13 @@ macro(setup)
register_definitions(USE_ONEDPL)
register_link_library(oneDPL)
endif ()
if (AMDGPU_TARGET_OFFLOAD)
set(AMDGPU_TARGET_OFFLOAD_FLAGS --hipstdpar --offload-arch=${AMDGPU_TARGET_OFFLOAD})
if (NOT AMDGPU_TARGET_OFFLOAD MATCHES "^gfx9")
list(APPEND AMDGPU_TARGET_OFFLOAD_FLAGS --hipstdpar-interpose-alloc)
endif ()

register_append_cxx_flags(ANY ${AMDGPU_TARGET_OFFLOAD_FLAGS})
register_append_link_flags(--hipstdpar)
endif ()
endmacro()
25 changes: 25 additions & 0 deletions src/std-indices/model.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ register_flag_optional(USE_ONEDPL
This requires the DPC++ compiler (other SYCL compilers are untested), required SYCL flags are added automatically."
"OFF")

register_flag_optional(AMDGPU_TARGET_OFFLOAD
"Enable offloading support (via the non-standard `-stdpar`) for
Clang/LLVM. The values are AMDGPU processors (https://www.llvm.org/docs/AMDGPUUsage.html#processors)
which will be passed in via `--offload-arch=` argument.

Example values are:
gfx906 - Compile for Vega20 GPUs
gfx908 - Compile for CDNA1 GPUs
gfx90a - Compile for CDNA2 GPUs
gfx942 - Compile for CDNA3 GPUs
gfx1030 - Compile for RDNA2 NV21 GPUs
gfx1100 - Compile for RDNA3 NV31 GPUs"
"")



macro(setup)
set(CMAKE_CXX_STANDARD 17)
if (NVHPC_OFFLOAD)
Expand All @@ -50,4 +66,13 @@ macro(setup)
register_definitions(USE_ONEDPL)
register_link_library(oneDPL)
endif ()
if (AMDGPU_TARGET_OFFLOAD)
set(AMDGPU_TARGET_OFFLOAD_FLAGS --hipstdpar --offload-arch=${AMDGPU_TARGET_OFFLOAD})
if (NOT AMDGPU_TARGET_OFFLOAD MATCHES "^gfx9")
list(APPEND AMDGPU_TARGET_OFFLOAD_FLAGS --hipstdpar-interpose-alloc)
endif ()

register_append_cxx_flags(ANY ${AMDGPU_TARGET_OFFLOAD_FLAGS})
register_append_link_flags(--hipstdpar)
endif ()
endmacro()