Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Kokkos 4.0 #895

Merged
merged 5 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ BuildKokkos:
extends: .LoadModules
stage: buildDependencies
script:
- git clone --depth=1 --branch 3.7.01 https://github.com/kokkos/kokkos.git &&
- git clone --depth=1 --branch 4.0.00 https://github.com/kokkos/kokkos.git &&
cd kokkos &&
mkdir build &&
cd build &&
Expand Down
4 changes: 2 additions & 2 deletions .jenkins/continuous.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pipeline {
dockerfile {
filename "Dockerfile"
dir "docker"
additionalBuildArgs '--build-arg BASE=nvidia/cuda:11.5.2-devel-ubuntu20.04 --build-arg KOKKOS_VERSION=3.7.01 --build-arg KOKKOS_OPTIONS="-DCMAKE_CXX_EXTENSIONS=OFF -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ARCH_VOLTA70=ON" --build-arg CUDA_AWARE_MPI=1'
additionalBuildArgs '--build-arg BASE=nvidia/cuda:11.5.2-devel-ubuntu20.04 --build-arg KOKKOS_VERSION=4.1.00 --build-arg KOKKOS_OPTIONS="-DCMAKE_CXX_EXTENSIONS=OFF -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ARCH_VOLTA70=ON" --build-arg CUDA_AWARE_MPI=1'
args '-v /tmp/ccache:/tmp/ccache --env NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES}'
label 'NVIDIA_Tesla_V100-PCIE-32GB && nvidia-docker'
}
Expand Down Expand Up @@ -161,7 +161,7 @@ pipeline {
dockerfile {
filename "Dockerfile"
dir "docker"
additionalBuildArgs '--build-arg BASE=nvidia/cuda:11.0.3-devel-ubuntu18.04 --build-arg KOKKOS_VERSION="3.7.01" --build-arg KOKKOS_OPTIONS="-DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_COMPILER=clang++ -DKokkos_ENABLE_THREADS=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ARCH_VOLTA70=ON -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu"'
additionalBuildArgs '--build-arg BASE=nvidia/cuda:11.0.3-devel-ubuntu18.04 --build-arg KOKKOS_VERSION="4.1.00" --build-arg KOKKOS_OPTIONS="-DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_COMPILER=clang++ -DKokkos_ENABLE_THREADS=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ARCH_VOLTA70=ON -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu"'
args '-v /tmp/ccache:/tmp/ccache --env NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES}'
label 'NVIDIA_Tesla_V100-PCIE-32GB && nvidia-docker'
}
Expand Down
8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
cmake_minimum_required(VERSION 3.16)
project(ArborX CXX)

# Workaround to compile against Trilinos 14.0. That version
# of Trilinos does not set the compatibility mode for Kokkos correctly.
# FIXME: remove once we require Kokkos 4.0.1 or later.
find_package(Kokkos QUIET 3.7.01 CONFIG)
if (NOT Kokkos_FOUND)
find_package(Kokkos 4.0.00 REQUIRED CONFIG)
endif()
find_package(Kokkos 4.0 REQUIRED CONFIG)
message(STATUS "Found Kokkos: ${Kokkos_DIR} (version \"${Kokkos_VERSION}\")")
if(Kokkos_ENABLE_CUDA AND Kokkos_VERSION VERSION_LESS 4.1)
# CUDA_LAMBDA is deprecated starting 4.1
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/bvh_driver/bvh_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ void register_bvh_benchmarks(Spec const &spec)

#ifdef KOKKOS_ENABLE_HIP
if (spec.backends == "all" || spec.backends == "hip")
BVHBenchmarkRegistration<Kokkos::Experimental::HIP>(spec,
"ArborX::BVH<HIP>");
BVHBenchmarkRegistration<Kokkos::HIP>(spec, "ArborX::BVH<HIP>");
#else
if (spec.backends == "hip")
throw std::runtime_error("HIP backend not available!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,7 @@ int main(int argc, char *argv[])
if (node == "hip")
{
#ifdef KOKKOS_ENABLE_HIP
using Node = Kokkos::Device<Kokkos::Experimental::HIP,
Kokkos::Experimental::HIPSpace>;
using Node = Kokkos::Device<Kokkos::HIP, Kokkos::HIPSpace>;
main_<Node>(pass_further, comm);
#else
throw std::runtime_error("HIP node type is disabled");
Expand Down
2 changes: 0 additions & 2 deletions src/geometry/ArborX_Box.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
#include <ArborX_Point.hpp>

#include <Kokkos_Macros.hpp>
#if __has_include(<Kokkos_ReductionIdentity.hpp>) // FIXME requires Kokkos 4.0
#include <Kokkos_ReductionIdentity.hpp>
#endif

namespace ArborX
{
Expand Down
2 changes: 0 additions & 2 deletions src/geometry/ArborX_HyperBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
#include <ArborX_HyperPoint.hpp>

#include <Kokkos_Macros.hpp>
#if __has_include(<Kokkos_ReductionIdentity.hpp>) // FIXME requires Kokkos 4.0
#include <Kokkos_ReductionIdentity.hpp>
#endif

namespace ArborX::ExperimentalHyperGeometry
{
Expand Down
2 changes: 1 addition & 1 deletion src/kokkos_ext/ArborX_DetailsKokkosExtSort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void sortByKey(
#if defined(KOKKOS_ENABLE_CUDA)
Kokkos::Cuda const &space,
#else
Kokkos::Experimental::HIP const &space,
Kokkos::HIP const &space,
#endif
Keys &keys, Values &values)
{
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(Kokkos_ENABLE_THREADS)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::Threads::device_type)
endif()
if(Kokkos_ENABLE_HIP)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::Experimental::HIPSpace::device_type)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::HIPSpace::device_type)
endif()
if(Kokkos_ENABLE_OPENMPTARGET)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::Experimental::OpenMPTarget::device_type)
Expand Down
11 changes: 0 additions & 11 deletions test/tstUnionFind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,7 @@ build_representatives(ExecutionSpace const &space, UnionFind union_find)
"Test::find_representatives",
Kokkos::RangePolicy<ExecutionSpace>(space, 0, n), KOKKOS_LAMBDA(int i) {
auto r = union_find.representative(i);
#if KOKKOS_VERSION >= 30799
Kokkos::atomic_min(&map2smallest(r), i);
#else
// Workaround for undefined
// desul::atomic_min(int*, int, desul::MemoryOrderRelaxed,
// desul::MemoryScopeDevice)
// in older Kokkos versions.
auto v = map2smallest(r);
while (v > i) {
v = Kokkos::atomic_compare_exchange(&map2smallest(r), v, i);
}
#endif
representatives(i) = r;
});
// We want the representative values to not depend on a specific
Expand Down