The plug-in works with DPC++ and Open SYCL, so you can choose to install either or both depending on your needs by following these instructions.
Once you have a working compiler and runtime framework, make sure you have a copy of the oneMKL development headers on your system. Then, get AMReX and its tutorials in a directory of your choice:
git clone https://github.com/AMReX-Codes/amrex
git clone https://github.com/AMReX-Codes/amrex-tutorials
Copy the contents of this repository and place them alongside the source files of the ElectromagneticPIC tutorial:
git clone https://github.com/farscape-project/amrex-sycl.git
cp -r amrex-sycl/SYCL amrex-tutorials/ExampleCodes/Particles/ElectromagneticPIC/Exec
If you wish to use an existing AMReX installation, set the AMREX_HOME
environment variable or change its value at the top of build.sh
to point to
the desired location.
If at any point you wish to clean leftovers from previous builds, you can simply run:
./build.sh clean
or ./build.sh realclean
And to build the tutorial or probe the build system:
./build.sh compiler gpu_arch [amrex_make_opts]
-
compiler
is eitherdpcpp
(alsodpc++
) oropensycl
(alsohipsycl
); -
gpu_arch
is an architecture or compute capability specification, for example:sm_70
for the Nvidia V100 orsm_80
for the Nvidia A100;gfx908
for the AMD MI100 orgfx90a
for the AMD MI200 series;
see the Nvidia developer pages or the ROCm documentation for other Nvidia or AMD GPUs, respectively;
-
amrex_make_opts
is any valid variable or command listed in AMReX's documentation.
To learn more about how build.sh
works, see this
supporting document.
To build the tutorial for the Nvidia A100 using DPC++ with six parallel jobs:
./build.sh dpcpp sm_80 -j6
To print the compiler flags for Open SYCL and the AMD MI200 series:
./build.sh opensycl gfx90a print-CXXFLAGS
To run the tutorial, simply do:
./main3d.sycl.TPROF.ex inputs