Skip to content

Commit c9e7669

Browse files
committed
ROCm: make ROCm targets available to other externals
1 parent 4b776a4 commit c9e7669

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

rocm-flags.file

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### FILE rocm-flags
2+
# define the ROCm compilation flags in a way that can be shared by SCRAM-based and regular tools
3+
4+
# build support for Instinct MI100 (gfx908), Instinct MI210/MI250X (gfx90a), Instinct MI300X (gfx942), Radeon Pro W6800 (gfx1030), Radeon Pro W7800/W7900 (gfx1100), and Radeon Pro W7600 (gfx1102)
5+
%define rocm_archs gfx908:sramecc+:xnack- gfx90a:sramecc+:xnack- gfx942:sramecc+:xnack- gfx1030 gfx1100 gfx1102
6+
7+
# LLVM/hipcc style for listing the supported ROCm compute architectures
8+
%define hipcc_flags_rocm_archs %(echo $(for ARCH in %rocm_archs; do echo "--offload-arch=$ARCH"; done))
9+
10+
# all ROCm flags
11+
%define rocm_flags %{hipcc_flags_rocm_archs}

scram-tools.file/tool-env.file

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export COMPILER_WARNINGS="%{?warning_flags}"
1313
export ORACLE_ENV_ROOT=""
1414
export CUDA_FLAGS="%{nvcc_cuda_flags}"
1515
export CUDA_HOST_CXXFLAGS="%{nvcc_flags_stdcxx}"
16+
export ROCM_FLAGS="%{rocm_flags}"
1617
export LTO_FLAGS="%{?lto_build_flags}"
1718
export PGO_FLAGS="%{?pgo_build_flags}"
1819
if [ $(echo ' %requiredtools ' | grep ' python3 ' |wc -l) -gt 0 ] ; then export PYTHON3_LIB_SITE_PACKAGES ; fi

scram-tools.file/tools/rocm/rocm.xml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<tool name="rocm" version="@TOOL_VERSION@" revision="3">
2-
<info url="https://docs.amd.com/"/>
1+
<tool name="rocm" version="@TOOL_VERSION@" revision="4">
2+
<info url="https://rocm.docs.amd.com/en/docs-@TOOL_VERSION@/"/>
33
<lib name="amdhip64"/>
44
<lib name="hsa-runtime64"/>
55
<lib name="rocm_smi64"/>
@@ -11,12 +11,7 @@
1111
<environment name="INCLUDE" default="$ROCM_BASE/include"/>
1212
</client>
1313
<flags CPPDEFINES="__HIP_PLATFORM_HCC__ __HIP_PLATFORM_AMD__"/>
14-
<flags ROCM_FLAGS="--offload-arch=gfx908:sramecc+:xnack-"/> <!-- Instinct MI100 -->
15-
<flags ROCM_FLAGS="--offload-arch=gfx90a:sramecc+:xnack-"/> <!-- Instinct MI210/MI250 -->
16-
<flags ROCM_FLAGS="--offload-arch=gfx942:sramecc+:xnack-"/> <!-- Instinct MI300X -->
17-
<flags ROCM_FLAGS="--offload-arch=gfx1030"/> <!-- Radeon Pro W6800 -->
18-
<flags ROCM_FLAGS="--offload-arch=gfx1100"/> <!-- Radeon Pro W7800/W7900 -->
19-
<flags ROCM_FLAGS="--offload-arch=gfx1102"/> <!-- Radeon Pro W7600 -->
14+
<flags ROCM_FLAGS="@ROCM_FLAGS@"/>
2015
<flags ROCM_FLAGS="-fgpu-rdc --target=@COMPILER_HOST@ --gcc-toolchain=$(COMPILER_PATH)"/>
2116
%if "%{default_microarch_name}"
2217
%if "%{default_microarch_name}" != "%{min_microarch_name}"

toolflags.file

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## INCLUDE compilation_flags
22
## INCLUDE compilation_flags_lto
33
## INCLUDE cuda-flags
4+
## INCLUDE rocm-flags
45
## INCLUDE cpp-standard
56
## INCLUDE warning-flags
67
## INCLUDE vecgeom-opt

0 commit comments

Comments
 (0)