Skip to content
rcclay edited this page Jul 13, 2018 · 1 revision

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
-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
-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.

Clone this wiki locally