-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.sh
executable file
·323 lines (300 loc) · 19.4 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
#!/usr/bin/env bash
set -eu
export NVHPC_DIR="/opt/nvidia/hpc_sdk/Linux_x86_64/24.7"
export CUDA_DIR="$NVHPC_DIR/cuda/"
export PATH=$NVHPC_DIR/compilers/bin/:${PATH:-}
export KOKKOS_DIR="/home/tom/Downloads/kokkos-4.0.01/"
export HIPSYCL_DEBUG_LEVEL=1
export CPU_RANKS=$(($(nproc) / 2))
export GPU_RANKS=3
VERBOSE="ON"
PROBLEM="InputDecks/clover_bm16_very_short.in"
declare -A enabled_models=(
["serial"]=true
["omp"]=true
["omp-target"]=true
["kokkos"]=true
["cuda"]=true
["hip"]=true
["std-indices"]=true
["sycl-acc"]=true
["sycl-usm"]=true
["tbb"]=true
)
function test_mpi() {
if [[ "${enabled_models[$3]}" != true ]]; then
echo "# Skipping model $3"
return
fi
rm -rf "build_$3" # /CMakeCache.txt
echo "$2" "${@:4}"
cmake -DCMAKE_BUILD_TYPE=Release -S. -B "build_$3" -GNinja -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DENABLE_MPI=ON -DMODEL="$3" "${@:4}" # &>/dev/null
cmake --build "build_$3" # &>/dev/null
export OMP_PLACES=cores
export OMP_PROC_BIND=true
export OMP_NUM_THREADS=1
export OMP_TARGET_OFFLOAD=MANDATORY
# | grep -i -e "This run" -e "Timestep *" #
export ASAN_OPTIONS=detect_leaks=0
mkdir -p out
which mpirun
# ldd build_$3/*-cloverleaf
mpirun -np "$1" -bind-to core -map-by core sh -c "build_$3/*-cloverleaf --device $2 --file $PROBLEM --profile --staging-buffer auto"
# --mca pml ucx -x UCX_TLS=rc,sm,cuda_copy,gdr_copy,cuda_ipc
# konsole -e gdb -ex run --args
}
function test_nompi() {
if [[ "${enabled_models[$2]}" != true ]]; then
echo "# Skipping model $2"
return
fi
rm -rf "build_$2" # /CMakeCache.txt
echo "$2" "${@:3}"
cmake -DCMAKE_BUILD_TYPE=Release -S. -B "build_$2" -GNinja -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DENABLE_MPI=OFF -DMODEL="$2" "${@:3}" # &>/dev/null
cmake --build "build_$2" # &>/dev/null
export OMP_TARGET_OFFLOAD=MANDATORY
# export OMP_PLACES=cores
# export OMP_PROC_BIND=true
export OMP_NUM_THREADS=$(nproc)
# | grep -i -e "This run" -e "Timestep *" #
export ASAN_OPTIONS=detect_leaks=0
mkdir -p out
build_$2/*-cloverleaf --device "$1" --file "$PROBLEM" --profile --staging-buffer auto # --dump dump_sycl_omp
}
(
(
:
test_nompi "0" serial -DCXX_EXTRA_FLAGS="-Ofast" -DCMAKE_CXX_COMPILER=g++
test_nompi "0" serial -DCXX_EXTRA_FLAGS="-Ofast" -DCMAKE_CXX_COMPILER=clang++
)
(
:
test_nompi "0" std-indices -DCMAKE_CXX_COMPILER=g++ -DCXX_EXTRA_FLAGS="-Ofast" -DUSE_ONETBB=ON -DFETCH_ONETBB=ON -DCXX_EXTRA_LIBRARIES=tbb
test_nompi "0" std-indices -DCMAKE_CXX_COMPILER=g++ -DCXX_EXTRA_FLAGS="-Ofast" -DUSE_ONEDPL=OPENMP -DFETCH_ONEDPL=ON
test_nompi "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DCXX_EXTRA_FLAGS="-Ofast" -DUSE_ONETBB=ON -DFETCH_ONETBB=ON -DCXX_EXTRA_LIBRARIES=tbb
test_nompi "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DCXX_EXTRA_FLAGS="-Ofast" -DUSE_ONEDPL=OPENMP -DFETCH_ONEDPL=ON
test_nompi "0" std-indices -DCMAKE_CXX_COMPILER=nvc++ -DCXX_EXTRA_FLAGS="-Ofast;-stdpar;-target=multicore"
test_nompi "0" std-indices -DCMAKE_CXX_COMPILER=nvc++ -DCXX_EXTRA_FLAGS="-Ofast;-stdpar;-gpu=cc61"
)
(
:
test_nompi "0" omp -DCMAKE_CXX_COMPILER=g++ -DCXX_EXTRA_FLAGS="-Ofast"
test_nompi "0" omp -DCMAKE_CXX_COMPILER=clang++ # clang fails with -Ofast, solutions if off by 0.008%
)
(
:
test_nompi "0" tbb -DCMAKE_CXX_COMPILER=g++ -DCXX_EXTRA_FLAGS="-Ofast"
test_nompi "0" tbb -DCMAKE_CXX_COMPILER=clang++ -DCXX_EXTRA_FLAGS="-Ofast"
)
(
:
test_nompi "0" omp-target -DCMAKE_CXX_COMPILER=clang++ -DOFFLOAD=NVIDIA:sm_60 -DCXX_EXTRA_FLAGS="-Ofast;--cuda-path=$CUDA_DIR"
test_nompi "0" omp-target -DCMAKE_CXX_COMPILER=nvc++ -DCXX_EXTRA_FLAGS="-Ofast" -DOFFLOAD=ON -DOFFLOAD_FLAGS="-mp;-gpu=cc60"
)
(
:
test_nompi "0" kokkos -DCMAKE_CXX_COMPILER=g++ -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_OPENMP=ON -DKokkos_ARCH_ZEN3=ON -DCXX_EXTRA_FLAGS="-Ofast"
test_nompi "0" kokkos -DCMAKE_CXX_COMPILER=clang++ -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_OPENMP=ON -DKokkos_ARCH_ZEN3=ON -DCXX_EXTRA_FLAGS="-Ofast"
test_nompi "0" kokkos -DCMAKE_CXX_COMPILER=$KOKKOS_DIR/bin/nvcc_wrapper -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL61=ON
test_nompi "0" kokkos -DCMAKE_CXX_COMPILER=nvc++ -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL61=ON
)
(
:
test_nompi "0" cuda -DCXX_EXTRA_FLAGS="-O3" -DCMAKE_CUDA_COMPILER=nvcc -DCUDA_ARCH=sm_60
test_nompi "0" cuda -DMANAGED_ALLOC=ON -DCXX_EXTRA_FLAGS="-O3" -DCMAKE_CUDA_COMPILER=nvcc -DCUDA_ARCH=sm_60
test_nompi "0" cuda -DSYNC_ALL_KERNELS=ON -DCXX_EXTRA_FLAGS="-O3" -DCMAKE_CUDA_COMPILER=nvcc -DCUDA_ARCH=sm_60
)
(
:
test_nompi "0" hip -DCXX_EXTRA_FLAGS="-O1" -DCMAKE_CXX_COMPILER=hipcc
test_nompi "0" hip -DMANAGED_ALLOC=ON -DCXX_EXTRA_FLAGS="-O1" -DCMAKE_CXX_COMPILER=hipcc # fails validation at > O1 lol
test_nompi "0" hip -DSYNC_ALL_KERNELS=ON -DCXX_EXTRA_FLAGS="-Ofast" -DCMAKE_CXX_COMPILER=hipcc
)
(
:
export HIPSYCL_TARGETS="omp.library-only"
test_nompi "OpenMP" sycl-acc -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
test_nompi "OpenMP" sycl-usm -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
export HIPSYCL_TARGETS="cuda:sm_60"
test_nompi "NVIDIA" sycl-acc -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
test_nompi "NVIDIA" sycl-usm -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
export HSA_OVERRIDE_GFX_VERSION=10.1.2 # https://github.com/RadeonOpenCompute/ROCm/issues/1756#issuecomment-1160386571
export HIPSYCL_TARGETS="hip:gfx1012"
test_nompi "Radeon" sycl-acc -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
test_nompi "Radeon" sycl-usm -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
)
(
:
set +eu
source /opt/intel/oneapi/tbb/2021.13/env/vars.sh
source /opt/intel/oneapi/compiler/2024.2/env/vars.sh
set -eu
export DPCPP_CPU_NUM_CUS=1
export DPCPP_CPU_SCHEDULE=static
test_nompi "Ryzen" sycl-acc -DSYCL_COMPILER=ONEAPI-ICPX -DUSE_HOSTTASK=ON
test_nompi "Ryzen" sycl-acc -DSYCL_COMPILER=ONEAPI-ICPX -DUSE_HOSTTASK=OFF
test_nompi "Ryzen" sycl-usm -DSYCL_COMPILER=ONEAPI-ICPX -DUSE_HOSTTASK=ON
test_nompi "Ryzen" sycl-usm -DSYCL_COMPILER=ONEAPI-ICPX -DUSE_HOSTTASK=OFF
)
(
:
set +eu
source /opt/intel/oneapi/tbb/2021.13/env/vars.sh
source /opt/intel/oneapi/compiler/2024.2/env/vars.sh --include-intel-llvm
set -eu
cuda_sycl_flags="-fsycl-targets=nvptx64-nvidia-cuda;-Xsycl-target-backend;--cuda-gpu-arch=sm_60;--cuda-path=$CUDA_DIR"
test_nompi "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DUSE_ONEDPL=DPCPP -DCXX_EXTRA_FLAGS="-fsycl;$cuda_sycl_flags"
test_nompi "NVIDIA" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
test_nompi "NVIDIA" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=OFF -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
test_nompi "NVIDIA" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
test_nompi "NVIDIA" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=OFF -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
export LD_LIBRARY_PATH=/opt/rocm-5.4.3/lib:${LD_LIBRARY_PATH:-}
hip_sycl_flags="-fsycl;-fsycl-targets=amdgcn-amd-amdhsa;-Xsycl-target-backend;--offload-arch=gfx1012"
test_nompi "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DUSE_ONEDPL=DPCPP -DCXX_EXTRA_FLAGS="-fsycl;$hip_sycl_flags"
test_nompi "Radeon" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
test_nompi "Radeon" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=OFF -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
test_nompi "Radeon" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
test_nompi "Radeon" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=OFF -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
)
wait
)
#exit 0
(
source /etc/profile.d/modules.sh
module load mpi
test_mpi $CPU_RANKS "0" serial -DCMAKE_CXX_COMPILER=g++
test_mpi $CPU_RANKS "0" serial -DCMAKE_CXX_COMPILER=clang++
(
:
test_mpi $CPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=g++ -DUSE_ONETBB=ON -DFETCH_ONETBB=ON -DCXX_EXTRA_LIBRARIES=tbb
test_mpi $CPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=g++ -DUSE_ONEDPL=OPENMP -DFETCH_ONEDPL=ON
test_mpi $CPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DUSE_ONETBB=ON -DFETCH_ONETBB=ON -DCXX_EXTRA_LIBRARIES=tbb
test_mpi $CPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DUSE_ONEDPL=OPENMP -DFETCH_ONEDPL=ON
test_mpi $CPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=nvc++ -DCXX_EXTRA_FLAGS="-Ofast;-stdpar;-target=multicore"
test_mpi $GPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=nvc++ -DCXX_EXTRA_FLAGS="-Ofast;-stdpar;-gpu=cc61;--restrict"
)
(
:
test_mpi $CPU_RANKS "0" omp -DCMAKE_CXX_COMPILER=g++
test_mpi $CPU_RANKS "0" omp -DCMAKE_CXX_COMPILER=clang++
)
(
:
test_mpi $CPU_RANKS "0" tbb -DCMAKE_CXX_COMPILER=g++
test_mpi $CPU_RANKS "0" tbb -DCMAKE_CXX_COMPILER=clang++
)
(
:
test_mpi $GPU_RANKS "0" omp-target -DCMAKE_CXX_COMPILER=clang++ -DOFFLOAD=NVIDIA:sm_60 -DCXX_EXTRA_FLAGS="-Ofast;--cuda-path=$CUDA_DIR"
test_mpi $GPU_RANKS "0" omp-target -DCMAKE_CXX_COMPILER=nvc++ -DCXX_EXTRA_FLAGS="-Ofast" -DOFFLOAD=ON -DOFFLOAD_FLAGS="-mp;-gpu=cc60"
)
(
:
test_mpi $CPU_RANKS "0" kokkos -DCMAKE_CXX_COMPILER=g++ -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_OPENMP=ON -DKokkos_ARCH_ZEN3=ON
test_mpi $CPU_RANKS "0" kokkos -DCMAKE_CXX_COMPILER=clang++ -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_OPENMP=ON -DKokkos_ARCH_ZEN3=ON
test_mpi $GPU_RANKS "0" kokkos -DCMAKE_CXX_COMPILER=$KOKKOS_DIR/bin/nvcc_wrapper -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL61=ON
test_mpi $GPU_RANKS "0" kokkos -DCMAKE_CXX_COMPILER=nvc++ -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL61=ON
)
(
:
test_mpi $GPU_RANKS "0" cuda -DMANAGED_ALLOC=ON -DCXX_EXTRA_FLAGS="-Ofast" -DCMAKE_CUDA_COMPILER=nvcc -DCUDA_ARCH=sm_60
test_mpi $GPU_RANKS "0" cuda -DMANAGED_ALLOC=ON -DSYNC_ALL_KERNELS=ON -DCXX_EXTRA_FLAGS="-Ofast" -DCMAKE_CUDA_COMPILER=nvcc -DCUDA_ARCH=sm_60
)
(
:
test_mpi $GPU_RANKS "0" hip -DMANAGED_ALLOC=ON -DCXX_EXTRA_FLAGS="-O1" -DCMAKE_CXX_COMPILER=hipcc # fails validation at > O1 lol
test_mpi $GPU_RANKS "0" hip -DMANAGED_ALLOC=ON -DSYNC_ALL_KERNELS=ON -DCXX_EXTRA_FLAGS="-O1" -DCMAKE_CXX_COMPILER=hipcc
)
(
:
set +eu
module load mpi
source /opt/intel/oneapi/tbb/2021.13/env/vars.sh
source /opt/intel/oneapi/compiler/2024.2/env/vars.sh
set -eu
export DPCPP_CPU_NUM_CUS=1
export DPCPP_CPU_SCHEDULE=static
test_mpi $CPU_RANKS "Ryzen" sycl-acc -DSYCL_COMPILER=ONEAPI-ICPX -DUSE_HOSTTASK=ON
test_mpi $CPU_RANKS "Ryzen" sycl-acc -DSYCL_COMPILER=ONEAPI-ICPX -DUSE_HOSTTASK=OFF
test_mpi $CPU_RANKS "Ryzen" sycl-usm -DSYCL_COMPILER=ONEAPI-ICPX -DUSE_HOSTTASK=ON
test_mpi $CPU_RANKS "Ryzen" sycl-usm -DSYCL_COMPILER=ONEAPI-ICPX -DUSE_HOSTTASK=OFF
)
(
:
export HIPSYCL_TARGETS="omp.library-only"
test_mpi $GPU_RANKS "OpenMP" sycl-acc -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
test_mpi $GPU_RANKS "OpenMP" sycl-usm -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
export HIPSYCL_TARGETS="cuda:sm_60"
test_mpi $GPU_RANKS "NVIDIA" sycl-acc -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
test_mpi $GPU_RANKS "NVIDIA" sycl-usm -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
export HSA_OVERRIDE_GFX_VERSION=10.1.2 # https://github.com/RadeonOpenCompute/ROCm/issues/1756#issuecomment-1160386571
export HIPSYCL_TARGETS="hip:gfx1012"
test_mpi $GPU_RANKS "Radeon" sycl-acc -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
test_mpi $GPU_RANKS "Radeon" sycl-usm -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
)
(
:
set +eu
module load mpi
source /opt/intel/oneapi/tbb/2021.13/env/vars.sh
source /opt/intel/oneapi/compiler/2024.2/env/vars.sh --include-intel-llvm
set -eu
cuda_sycl_flags="-fsycl-targets=nvptx64-nvidia-cuda;-Xsycl-target-backend;--cuda-gpu-arch=sm_60;--cuda-path=$CUDA_DIR"
test_mpi $GPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DUSE_ONEDPL=DPCPP -DCXX_EXTRA_FLAGS="-fsycl;$cuda_sycl_flags"
test_mpi $GPU_RANKS "NVIDIA" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
test_mpi $GPU_RANKS "NVIDIA" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=OFF -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
test_mpi $GPU_RANKS "NVIDIA" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
test_mpi $GPU_RANKS "NVIDIA" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=OFF -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
export LD_LIBRARY_PATH=/opt/rocm-5.4.3/lib:${LD_LIBRARY_PATH:-}
hip_sycl_flags="-fsycl;-fsycl-targets=amdgcn-amd-amdhsa;-Xsycl-target-backend;--offload-arch=gfx1012"
test_mpi $GPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DUSE_ONEDPL=DPCPP -DCXX_EXTRA_FLAGS="-fsycl;$hip_sycl_flags"
test_mpi $GPU_RANKS "Radeon" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
test_mpi $GPU_RANKS "Radeon" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=OFF -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
test_mpi $GPU_RANKS "Radeon" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
test_mpi $GPU_RANKS "Radeon" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=OFF -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
)
wait
)
# exit 0
### CUDA-aware MPI ###
(
export MPI_HOME=/opt/nvidia/hpc_sdk/Linux_x86_64/24.7/comm_libs/openmpi/openmpi-3.1.5/
export PATH="/opt/nvidia/hpc_sdk/Linux_x86_64/24.7/comm_libs/openmpi/openmpi-3.1.5/bin/:${PATH:-}"
(
:
test_mpi $GPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=nvc++ -DCXX_EXTRA_FLAGS="-Ofast;-stdpar;-gpu=cc61;--restrict"
test_mpi $GPU_RANKS "0" omp-target -DCMAKE_CXX_COMPILER=clang++ -DOFFLOAD=NVIDIA:sm_60 -DCXX_EXTRA_FLAGS="-Ofast;--cuda-path=$CUDA_DIR"
test_mpi $GPU_RANKS "0" omp-target -DCMAKE_CXX_COMPILER=nvc++ -DCXX_EXTRA_FLAGS="-Ofast" -DOFFLOAD=ON -DOFFLOAD_FLAGS="-mp;-gpu=cc60"
test_mpi $GPU_RANKS "0" kokkos -DCMAKE_CXX_COMPILER=$KOKKOS_DIR/bin/nvcc_wrapper -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL61=ON
test_mpi $GPU_RANKS "0" kokkos -DCMAKE_CXX_COMPILER=nvc++ -DKOKKOS_IN_TREE="$KOKKOS_DIR" -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL61=ON
test_mpi $GPU_RANKS "0" cuda -DCXX_EXTRA_FLAGS="-Ofast" -DCMAKE_CUDA_COMPILER=nvcc -DCUDA_ARCH=sm_60
# test_mpi $GPU_RANKS "0" hip -DCXX_EXTRA_FLAGS="-Ofast" -DCMAKE_CXX_COMPILER=/usr/lib/aomp_17.0-1/bin/hipcc # doesn't work with NVHPC'S OpenMPI, segfaults at runtime
)
(
:
export HIPSYCL_TARGETS="cuda:sm_60"
test_mpi $GPU_RANKS "NVIDIA" sycl-acc -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
test_mpi $GPU_RANKS "NVIDIA" sycl-usm -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
export HSA_OVERRIDE_GFX_VERSION=10.1.2 # https://github.com/RadeonOpenCompute/ROCm/issues/1756#issuecomment-1160386571
export HIPSYCL_TARGETS="hip:gfx1012"
test_mpi $GPU_RANKS "Radeon" sycl-acc -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
test_mpi $GPU_RANKS "Radeon" sycl-usm -DSYCL_COMPILER=HIPSYCL -DSYCL_COMPILER_DIR="/opt/hipsycl/e7ec6ed" -DUSE_HOSTTASK=OFF
)
(
:
set +eu
source /opt/intel/oneapi/tbb/2021.13/env/vars.sh
source /opt/intel/oneapi/compiler/2024.2/env/vars.sh --include-intel-llvm
set -eu
cuda_sycl_flags="-fsycl-targets=nvptx64-nvidia-cuda;-Xsycl-target-backend;--cuda-gpu-arch=sm_60;--cuda-path=$CUDA_DIR"
test_mpi $GPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DUSE_ONEDPL=DPCPP -DCXX_EXTRA_FLAGS="-fsycl;$cuda_sycl_flags"
test_mpi $GPU_RANKS "NVIDIA" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
test_mpi $GPU_RANKS "NVIDIA" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$cuda_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$cuda_sycl_flags"
export LD_LIBRARY_PATH=/opt/rocm-5.4.3/lib:${LD_LIBRARY_PATH:-}
hip_sycl_flags="-fsycl;-fsycl-targets=amdgcn-amd-amdhsa;-Xsycl-target-backend;--offload-arch=gfx1012"
test_mpi $GPU_RANKS "0" std-indices -DCMAKE_CXX_COMPILER=clang++ -DUSE_ONEDPL=DPCPP -DCXX_EXTRA_FLAGS="-fsycl;$hip_sycl_flags;-O1" # again, needs -O1
test_mpi $GPU_RANKS "Radeon" sycl-acc -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
test_mpi $GPU_RANKS "Radeon" sycl-usm -DSYCL_COMPILER=ONEAPI-Clang -DUSE_HOSTTASK=ON -DSYCL_COMPILER_DIR=/opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/ -DCXX_EXTRA_FLAGS="$hip_sycl_flags" -DCXX_EXTRA_LINK_FLAGS="$hip_sycl_flags"
)
)
echo "All done!"