Skip to content

Commit

Permalink
Add amrex-rocm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PlatinumCD committed Apr 27, 2022
1 parent cce10ec commit b64df9a
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions E4S-rocm/amrex-rocm
7 changes: 7 additions & 0 deletions validation_tests/amrex-rocm/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
rm -rf Amr Basic Blueprint EB \
ForkJoin FortranInterface \
GPU LinearSolvers ML MUI \
Particles SDC SENSEI SWFFT \
cmake CMakeLists.txt build \
plt* plot* amrex-tutorials
20 changes: 20 additions & 0 deletions validation_tests/amrex-rocm/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -e
. ./setup.sh
set -x

printenv

git clone https://github.com/AMReX-Codes/amrex-tutorials.git
mv amrex-tutorials/ExampleCodes/* .

mkdir -p build
cd build

HIPFLAG=""
if [ $USEROCM = 1 ];then
HIPFLAG="-DAMReX_GPU_BACKEND=HIP -DAMReX_AMD_ARCH=${HCC_AMDGPU_TARGET} -DCMAKE_CXX_COMPILER=hipcc"
fi

cmake -DAMReX_ROOT=${AMREX_ROOT} ${HIPFLAG} ..
make -j16
cd -
3 changes: 3 additions & 0 deletions validation_tests/amrex-rocm/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash -e
./build/Basic/HelloWorld_C/HelloWorld_C
./build/Basic/main_C/main_C
20 changes: 20 additions & 0 deletions validation_tests/amrex-rocm/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
. ../../setup.sh

THISDIR=`basename "$PWD"`
USECUDA=0
USEROCM=0

if [ "$THISDIR" = "amrex-cuda" ];then
spackLoadUnique amrex+cuda #cuda_arch=80
USECUDA=1
elif [ "$THISDIR" = "amrex-rocm" ];then
spackLoadUnique amrex+rocm
USEROCM=1
else
spackLoadUnique amrex~rocm~cuda
fi

if ! command -v cmake >/dev/null 2>&1 ; then
spackLoadUnique [email protected]:
fi

0 comments on commit b64df9a

Please sign in to comment.