-
Notifications
You must be signed in to change notification settings - Fork 35
KOKKOS Branch
To build with Kokkos, first checkout github.com/kokkos/kokkos.git . Let's assume you've placed the top level Kokkos directory in ${KOKKOS_ROOT}. Then, navigate to the miniqmc/build directory. The following cmake command will build for a Power8 based CPU with OpenMP threading, assuming the GCC compiler is used:
> cmake -DQMC_USE_KOKKOS=1 \
-DKOKKOS_PREFIX=${KOKKOS_ROOT} \
-DKOKKOS_ARCH="Power8" \
-DKOKKOS_ENABLE_OPENMP=true \
-DKOKKOS_ENABLE_EXPLICIT_INSTANTIATION=false \
-DCMAKE_CXX_FLAGS="-Drestrict=__restrict__ -D__forceinline=inline" ..
The CMAKE_CXX_FLAGS are to deal with the handling of the "restrict" and "__forceinline" keywords that appear in miniqmc. Analogous flags for different compilers can be found in their reference.
For CUDA, assuming a Power8 host and a P100 Nvidia Card, we use the following:
> cmake -DQMC_USE_KOKKOS=1 \
-DKOKKOS_PREFIX=${KOKKOS_ROOT} \
-DKOKKOS_ENABLE_CUDA=true \
-DKOKKOS_ENABLE_OPENMP=false \
-DKOKKOS_ARCH="Power8;Pascal60" \
-DKOKKOS_ENABLE_CUDA_UVM=true \
-DKOKKOS_ENABLE_CUDA_LAMBDA=true \
-DKOKKOS_ENABLE_EXPLICIT_INSTANTIATION=false \
-DCMAKE_CXX_COMPILER=${KOKKOS_ROOT}/bin/nvcc_wrapper \
-DCMAKE_CXX_FLAGS="-Drestrict=__restrict__ -D__forceinline=inline " ..
KOKKOS_ENABLE_CUDA=true and KOKKOS_ENABLE_CUDA_UVM=true must be set. Notice also that the compiler CMAKE_CXX_COMPILER is hijacked by the Kokkos nvcc wrapper.
Kokkos views do not exist to for single precision, thus you must use QMC_MIXED_PRECISION=0