diff --git a/cmake/presets/kokkos-sycl.cmake b/cmake/presets/kokkos-sycl.cmake new file mode 100644 index 0000000000..01abe7762f --- /dev/null +++ b/cmake/presets/kokkos-sycl.cmake @@ -0,0 +1,15 @@ +# preset that enables KOKKOS and selects SYCL compilation with OpenMP +# enabled as well. Also sets some performance related compiler flags. +set(PKG_KOKKOS ON CACHE BOOL "" FORCE) +set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE) +set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE) +set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE) +set(Kokkos_ENABLE_SYCL ON CACHE BOOL "" FORCE) +set(Kokkos_ARCH_MAXWELL50 on CACHE BOOL "" FORCE) +set(BUILD_OMP ON CACHE BOOL "" FORCE) + +set(CMAKE_CXX_COMPILER clang++ CACHE STRING "" FORCE) +set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) +set(CMAKE_CXX_STANDARD 17 CACHE STRING "" FORCE) +set(CMAKE_SHARED_LINKER_FLAGS "-Xsycl-target-frontend -O3" CACHE STRING "" FORCE) +set(CMAKE_TUNE_FLAGS "-fgpu-inline-threshold=100000 -Xsycl-target-frontend -O3 -Xsycl-target-frontend -ffp-contract=on -Wno-unknown-cuda-version" CACHE STRING "" FORCE) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 9648df402f..f3af36c0bb 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -638,13 +638,14 @@ This list was last updated for version 3.5.0 of the Kokkos library. -D CMAKE_CXX_COMPILER=${HOME}/lammps/lib/kokkos/bin/nvcc_wrapper - To simplify compilation, three preset files are included in the + To simplify compilation, four preset files are included in the ``cmake/presets`` folder, ``kokkos-serial.cmake``, - ``kokkos-openmp.cmake``, and ``kokkos-cuda.cmake``. They will - enable the KOKKOS package and enable some hardware choice. So to - compile with OpenMP host parallelization, CUDA device - parallelization (for GPUs with CC 5.0 and up) with some common - packages enabled, you can do the following: + ``kokkos-openmp.cmake``, ``kokkos-cuda.cmake``, and + ``kokkos-sycl.cmake``. They will enable the KOKKOS package and + enable some hardware choice. So to compile with OpenMP host + parallelization, CUDA device parallelization (for GPUs with CC 5.0 + and up) with some common packages enabled, you can do the + following: .. code-block:: bash