diff --git a/E4S-rocm/amrex-rocm b/E4S-rocm/amrex-rocm new file mode 120000 index 00000000..bfa1026e --- /dev/null +++ b/E4S-rocm/amrex-rocm @@ -0,0 +1 @@ +../validation_tests/amrex-rocm \ No newline at end of file diff --git a/validation_tests/amrex-rocm/clean.sh b/validation_tests/amrex-rocm/clean.sh new file mode 100755 index 00000000..3d3e17e4 --- /dev/null +++ b/validation_tests/amrex-rocm/clean.sh @@ -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 diff --git a/validation_tests/amrex-rocm/compile.sh b/validation_tests/amrex-rocm/compile.sh new file mode 100755 index 00000000..15c4df2e --- /dev/null +++ b/validation_tests/amrex-rocm/compile.sh @@ -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 - diff --git a/validation_tests/amrex-rocm/run.sh b/validation_tests/amrex-rocm/run.sh new file mode 100755 index 00000000..eda3a2e1 --- /dev/null +++ b/validation_tests/amrex-rocm/run.sh @@ -0,0 +1,3 @@ +#!/bin/bash -e +./build/Basic/HelloWorld_C/HelloWorld_C +./build/Basic/main_C/main_C diff --git a/validation_tests/amrex-rocm/setup.sh b/validation_tests/amrex-rocm/setup.sh new file mode 100755 index 00000000..11899f16 --- /dev/null +++ b/validation_tests/amrex-rocm/setup.sh @@ -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 cmake@3.22.2: +fi