Skip to content

Commit 0236a37

Browse files
authored
CI: oneAPI SYCL for AMD GPUs (#3341)
1 parent 4d6fdde commit 0236a37

File tree

5 files changed

+58
-3
lines changed

5 files changed

+58
-3
lines changed

.github/workflows/dependencies/dependencies_codeplay.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ set -eu -o pipefail
99
curl -o oneapi_nvidia.sh -L "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=nvidia&filters[]=linux&aat=$1"
1010
chmod +x oneapi_nvidia.sh
1111
sudo ./oneapi_nvidia.sh --yes
12+
13+
curl -o oneapi_amd.sh -L "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=amd&filters[]=linux&aat=$1"
14+
chmod +x oneapi_amd.sh
15+
sudo ./oneapi_amd.sh --yes

.github/workflows/dependencies/dependencies_hip.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
2020
# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu
2121
curl -O https://repo.radeon.com/rocm/rocm.gpg.key
2222
sudo apt-key add rocm.gpg.key
23-
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' \
23+
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-debian}/ ubuntu main" \
2424
| sudo tee /etc/apt/sources.list.d/rocm.list
2525
echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' \
2626
| sudo tee -a /etc/profile.d/rocm.sh

.github/workflows/intel.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,57 @@ jobs:
148148
ccache -s
149149
du -hs ~/.cache/ccache
150150
151+
no-tests-oneapi-sycl-amd:
152+
name: oneAPI SYCL for AMD GPUs
153+
runs-on: ubuntu-20.04
154+
env:
155+
CODEPLAYTOKEN: ${{ secrets.CODEPLAYTOKEN }}
156+
steps:
157+
- uses: actions/checkout@v3
158+
- name: Dependencies
159+
if: ${{ env.CODEPLAYTOKEN != '' }}
160+
run: |
161+
.github/workflows/dependencies/dependencies_hip.sh 5.4.6
162+
.github/workflows/dependencies/dependencies_dpcpp.sh
163+
.github/workflows/dependencies/dependencies_codeplay.sh ${{ env.CODEPLAYTOKEN }}
164+
.github/workflows/dependencies/dependencies_ccache.sh
165+
- name: Set Up Cache
166+
if: ${{ env.CODEPLAYTOKEN != '' }}
167+
uses: actions/cache@v3
168+
with:
169+
path: ~/.cache/ccache
170+
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
171+
restore-keys: |
172+
ccache-${{ github.workflow }}-${{ github.job }}-git-
173+
- name: Build & Install
174+
if: ${{ env.CODEPLAYTOKEN != '' }}
175+
# mkl/rng/device/detail/mrg32k3a_impl.hpp has a number of sign-compare error
176+
# mkl/rng/device/detail/mrg32k3a_impl.hpp has missing braces in array-array initalization
177+
env: {CXXFLAGS: "-fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx90a -fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -Wnon-virtual-dtor -Wno-sign-compare -Wno-missing-braces"}
178+
run: |
179+
export CCACHE_COMPRESS=1
180+
export CCACHE_COMPRESSLEVEL=10
181+
export CCACHE_MAXSIZE=55M
182+
export CCACHE_DEPEND=1
183+
ccache -z
184+
185+
set +e
186+
source /opt/intel/oneapi/setvars.sh --include-intel-llvm
187+
set -e
188+
cmake -S . -B build \
189+
-DCMAKE_VERBOSE_MAKEFILE=ON \
190+
-DAMReX_EB=OFF \
191+
-DAMReX_ENABLE_TESTS=OFF \
192+
-DAMReX_GPU_BACKEND=SYCL \
193+
-DAMReX_SYCL_SUB_GROUP_SIZE=64 \
194+
-DCMAKE_C_COMPILER=$(which icx) \
195+
-DCMAKE_CXX_COMPILER=$(which clang++) \
196+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
197+
cmake --build build --parallel 2
198+
199+
ccache -s
200+
du -hs ~/.cache/ccache
201+
151202
# "Classic" EDG Intel Compiler
152203
tests-icc:
153204
name: ICC [tests]

Docs/sphinx_documentation/source/GPU.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ Below is an example configuration for SYCL:
404404
+------------------------------+-------------------------------------------------+-------------+-----------------+
405405
| AMReX_SYCL_ONEDPL | Enable SYCL's oneDPL algorithms | NO | YES, NO |
406406
+------------------------------+-------------------------------------------------+-------------+-----------------+
407-
| AMReX_SYCL_SUB_GROUP_SIZE | Specify subgroup size | 32 | 32, 16 |
407+
| AMReX_SYCL_SUB_GROUP_SIZE | Specify subgroup size | 32 | 64, 32, 16 |
408408
+------------------------------+-------------------------------------------------+-------------+-----------------+
409409
.. raw:: latex
410410

Tools/CMake/AMReXOptions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ if (AMReX_SYCL)
169169
unset(_valid_sycl_compiler_ids)
170170

171171
set(AMReX_SYCL_SUB_GROUP_SIZE_DEFAULT 32)
172-
set(AMReX_SYCL_SUB_GROUP_SIZE_VALUES 16 32)
172+
set(AMReX_SYCL_SUB_GROUP_SIZE_VALUES 16 32 64)
173173
set(AMReX_SYCL_SUB_GROUP_SIZE ${AMReX_SYCL_SUB_GROUP_SIZE_DEFAULT} CACHE STRING
174174
"SYCL sub-group size")
175175
if (NOT AMReX_SYCL_SUB_GROUP_SIZE IN_LIST AMReX_SYCL_SUB_GROUP_SIZE_VALUES)

0 commit comments

Comments
 (0)