Skip to content

Commit

Permalink
fix paths for cuda and hip install test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Jan 19, 2024
1 parent e93632b commit ccbdf9b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 47 deletions.
40 changes: 18 additions & 22 deletions install_test/bin/install_cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,34 @@ export KokkosFFT_DIR=${KOKKOSFFT_INSTALL_PREFIX}/lib/cmake/kokkos-fft
export KOKKOSFFT_BUILD_DIR=build_KokkosFFT_${TARGET}

export EXAMPLE_BUILD_DIR=build_example_${TARGET}
export CXX_COMPILER=${WK_DIR}/${KOKKOS_BUILD_DIR}/kokkos/bin/nvcc_wrapper

# Install Kokkos
cd ${WK_DIR}
mkdir ${KOKKOS_BUILD_DIR} && cd ${KOKKOS_BUILD_DIR}
# Install Kokkos if not exist
if [ ! -d ${Kokkos_DIR} ]; then
cd ${WK_DIR}
mkdir ${KOKKOS_BUILD_DIR} && cd ${KOKKOS_BUILD_DIR}

# Get Kokkos from github repo and build
git clone https://github.com/kokkos/kokkos.git
cmake -DCMAKE_CXX_COMPILER=kokkos/bin/nvcc_wrapper \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} kokkos
# Get Kokkos from github repo and build
git clone https://github.com/kokkos/kokkos.git
cmake -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} kokkos

cmake --build . -j 8
cmake --install .
cmake --build . -j 8
cmake --install .
fi

# Install KokkosFFT
cd ${WK_DIR}
mkdir ${KOKKOSFFT_BUILD_DIR} && cd ${KOKKOSFFT_BUILD_DIR}
if [ $TARGET == "CUDA" ]; then
cmake -DCMAKE_CXX_COMPILER=kokkos/bin/nvcc_wrapper \
cmake -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} ..
-DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} ..
else
cmake -DCMAKE_CXX_COMPILER=kokkos/bin/nvcc_wrapper \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON ..
-DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON ..
fi
cmake --build . -j 8
cmake --install .
Expand All @@ -49,15 +52,8 @@ cmake --install .
# Build KokkosFFT code using installed KokkosFFT
cd ${WK_DIR}
mkdir ${EXAMPLE_BUILD_DIR} && cd ${EXAMPLE_BUILD_DIR}
if [ $TARGET == "CUDA" ]; then
cmake -DCMAKE_CXX_COMPILER=kokkos/bin/nvcc_wrapper \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} ../install_test/src
else
cmake -DCMAKE_CXX_COMPILER=kokkos/bin/nvcc_wrapper \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON ../install_test/src
fi
cmake -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON ../install_test/src
cmake --build . -j 8

if [ $? -eq 0 ]; then
Expand Down
46 changes: 21 additions & 25 deletions install_test/bin/install_hip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,32 @@ export KOKKOSFFT_BUILD_DIR=build_KokkosFFT_${TARGET}

export EXAMPLE_BUILD_DIR=build_example_${TARGET}

# Install Kokkos
cd ${WK_DIR}
mkdir ${KOKKOS_BUILD_DIR} && cd ${KOKKOS_BUILD_DIR}
# Install Kokkos if not exist
if [ ! -d ${Kokkos_DIR} ]; then
cd ${WK_DIR}
mkdir ${KOKKOS_BUILD_DIR} && cd ${KOKKOS_BUILD_DIR}

# Get Kokkos from github repo and build
git clone https://github.com/kokkos/kokkos.git
cmake -DCMAKE_CXX_COMPILER=hipcc \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} kokkos
# Get Kokkos from github repo and build
git clone https://github.com/kokkos/kokkos.git
cmake -DCMAKE_CXX_COMPILER=hipcc \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} kokkos

cmake --build . -j 8
cmake --install .
cmake --build . -j 8
cmake --install .
fi

# Install KokkosFFT
cd ${WK_DIR}
mkdir ${KOKKOSFFT_BUILD_DIR} && cd ${KOKKOSFFT_BUILD_DIR}
if [ $TARGET == "HIP" ]; then
cmake -DCMAKE_CXX_COMPILER=kokkos/bin/nvcc_wrapper \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_VEGA90A=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} ..
cmake -DCMAKE_CXX_COMPILER=hipcc \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} ..
else
cmake -DCMAKE_CXX_COMPILER=kokkos/bin/nvcc_wrapper \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_VEGA90A=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON ..
cmake -DCMAKE_CXX_COMPILER=hipcc \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON ..
fi
cmake --build . -j 8
cmake --install .
Expand All @@ -49,15 +51,9 @@ cmake --install .
# Build KokkosFFT code using installed KokkosFFT
cd ${WK_DIR}
mkdir ${EXAMPLE_BUILD_DIR} && cd ${EXAMPLE_BUILD_DIR}
if [ $TARGET == "HIP" ]; then
cmake -DCMAKE_CXX_COMPILER=kokkos/bin/nvcc_wrapper \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_VEGA90A=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} ../install_test/src
else
cmake -DCMAKE_CXX_COMPILER=kokkos/bin/nvcc_wrapper \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_VEGA90A=ON \
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON ../install_test/src
fi
cmake -DCMAKE_CXX_COMPILER=hipcc \
-DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \
../install_test/src
cmake --build . -j 8

if [ $? -eq 0 ]; then
Expand Down

0 comments on commit ccbdf9b

Please sign in to comment.