Simple code to assemble the Poisson equation on manycore architectures using Dolfinx and SYCL.
- FEniCS/DOLFIN-X installation (development version of dolfinx required)
- A SYCL implementation
- Eigen3 (development version of eigen required)
Supported (tested) SYCL implementation:
- hipSYCL
- LLVM
- LLVM-CUDA
Modify the problem.ufl
file and then run the following command:
ffcx --sycl_defines=TRUE problem.ufl -o src/
Building for CPUs:
export HIPSYCL_PLATFORM=omp
mkdir build
cd build
cmake -DSYCL_IMPL=hipSYCL ..
make -j8
Building with CUDA and Nvidia Tesla P100 GPU accelerator:
export HIPSYCL_PLATFORM=cuda
export HIPSYCL_GPU_ARCH=sm_60
mkdir build
cd build
cmake -DSYCL_IMPL=hipSYCL -DCUDA_PATH=${CUDA_PATH} ..
make -j8
** Runnning Dolfinx.sycl with hipsycl + CUDA requires eigen@master.
export CXX=clang++
mkdir build
cd build
cmake -DSYCL_IMPL=LLVM ..
make -j8
Using Intel SYCL with CUDA:
export CXX=clang++
export CC=gcc
mkdir build
cd build
cmake -DSYCL_IMPL=LLVM-CUDA -DCUDA_PATH=${CUDA_PATH} ..
make -j8
./dolfinx_sycl {Ncells} {platform}
{platform} - Platform to run on [cpu or gpu].
{Ncells} - Number of cells in each direction (
Too many to mention ...
- Assemble on cells only
docker run --gpus all -v $(pwd):/home/fenics/shared --name sycl igorbaratta/dolfinx_sycl:latest nvidia-smi
singularity pull --arch amd64 library://igorbaratta/default/dolfinx_sycl:latest
singularity run --nv dolfinx_sycl_latest.sif