Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Dec 26, 2023
1 parent cf62b69 commit fccbe2b
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion benchmarks/union_find/union_find.cpp
Expand Up @@ -106,7 +106,7 @@ auto buildUnionFind(ExecutionSpace const &exec_space, int n)

Kokkos::View<int *, MemorySpace> labels(
Kokkos::view_alloc(Kokkos::WithoutInitializing, "Benchmark::labels"), n);
ArborX::iota(exec_space, labels);
ArborX::Details::KokkosExt::iota(exec_space, labels);
#ifdef KOKKOS_ENABLE_SERIAL
if constexpr (std::is_same_v<ExecutionSpace, Kokkos::Serial>)
return ArborX::Details::UnionFind<MemorySpace, /*DoSerial*/ true>(labels);
Expand Down
4 changes: 2 additions & 2 deletions src/ArborX_DBSCAN.hpp
Expand Up @@ -288,7 +288,7 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives,
// water mark
Kokkos::resize(Kokkos::view_alloc(exec_space, Kokkos::WithoutInitializing),
labels, n);
ArborX::iota(exec_space, labels);
KokkosExt::iota(exec_space, labels);

Kokkos::Profiling::pushRegion("ArborX::DBSCAN::clusters");
if (is_special_case)
Expand Down Expand Up @@ -404,7 +404,7 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives,

Kokkos::resize(Kokkos::view_alloc(exec_space, Kokkos::WithoutInitializing),
labels, n);
ArborX::iota(exec_space, labels);
KokkosExt::iota(exec_space, labels);

Details::unionFindWithinEachDenseCell(exec_space, dense_sorted_cell_indices,
permute, UnionFind{labels});
Expand Down
4 changes: 2 additions & 2 deletions src/details/ArborX_DetailsDendrogram.hpp
Expand Up @@ -12,9 +12,9 @@
#ifndef ARBORX_DETAILS_DENDROGRAM_HPP
#define ARBORX_DETAILS_DENDROGRAM_HPP

#include <ArborX_DetailsKokkosExtStdAlgorithms.hpp> // iota
#include <ArborX_DetailsKokkosExtViewHelpers.hpp>
#include <ArborX_DetailsUnionFind.hpp>
#include <ArborX_DetailsUtils.hpp> // iota

#include <Kokkos_Core.hpp>

Expand Down Expand Up @@ -44,7 +44,7 @@ void dendrogramUnionFindHost(Edges sorted_edges_host, Parents &parents_host)
Kokkos::view_alloc(Kokkos::WithoutInitializing,
"ArborX::Dendrogram::dendrogram_union_find::labels"),
num_vertices);
iota(host_space, labels);
KokkosExt::iota(host_space, labels);
UnionFind<Kokkos::HostSpace, true> union_find(labels);

Kokkos::View<int *, Kokkos::HostSpace> set_edges_host(
Expand Down
6 changes: 3 additions & 3 deletions src/details/ArborX_DetailsSortUtils.hpp
Expand Up @@ -14,8 +14,8 @@

#include <ArborX_DetailsKokkosExtAccessibilityTraits.hpp> // is_accessible_from
#include <ArborX_DetailsKokkosExtSort.hpp>
#include <ArborX_DetailsKokkosExtViewHelpers.hpp> // clone
#include <ArborX_DetailsUtils.hpp> // iota
#include <ArborX_DetailsKokkosExtStdAlgorithms.hpp> // iota
#include <ArborX_DetailsKokkosExtViewHelpers.hpp> // clone
#include <ArborX_Exception.hpp>

#include <Kokkos_Core.hpp>
Expand All @@ -34,7 +34,7 @@ auto sortObjects(ExecutionSpace const &space, ViewType &view)
Kokkos::view_alloc(space, Kokkos::WithoutInitializing,
"ArborX::Sorting::permute"),
view.extent(0));
ArborX::iota(space, permute);
KokkosExt::iota(space, permute);

KokkosExt::sortByKey(space, view, permute);

Expand Down
3 changes: 2 additions & 1 deletion src/details/ArborX_MinimumSpanningTree.hpp
Expand Up @@ -112,7 +112,8 @@ struct MinimumSpanningTree
Kokkos::view_alloc(space, Kokkos::WithoutInitializing,
"ArborX::MST::labels"),
2 * n - 1);
iota(space, Kokkos::subview(labels, std::make_pair((decltype(n))0, n)));
KokkosExt::iota(space,
Kokkos::subview(labels, std::make_pair((decltype(n))0, n)));
Kokkos::Profiling::popRegion();

Kokkos::View<DirectedEdge *, MemorySpace> component_out_edges(
Expand Down
2 changes: 1 addition & 1 deletion test/tstDetailsCrsGraphWrapperImpl.cpp
Expand Up @@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(query_impl, DeviceType, ARBORX_DEVICE_TYPES)
Kokkos::View<unsigned int *, DeviceType> permute(
Kokkos::view_alloc(Kokkos::WithoutInitializing, "Testing::permute"), n);
ExecutionSpace space;
ArborX::iota(space, permute);
KokkosExt::iota(space, permute);

KokkosExt::exclusive_scan(space, offset);
Kokkos::realloc(indices, KokkosExt::lastElement(space, offset));
Expand Down
2 changes: 1 addition & 1 deletion test/tstDetailsDistributedTreeImpl.cpp
Expand Up @@ -400,7 +400,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(send_across_network, DeviceType,
});

Kokkos::View<int *, DeviceType> ranks_u("", comm_size);
ArborX::iota(ExecutionSpace{}, ranks_u, 0);
ArborX::Details::KokkosExt::iota(ExecutionSpace{}, ranks_u, 0);

Kokkos::View<int **, DeviceType> u_ref("u_ref", comm_size, DIM);
Kokkos::parallel_for(
Expand Down
2 changes: 1 addition & 1 deletion test/tstDetailsTreeConstruction.cpp
Expand Up @@ -165,7 +165,7 @@ void generateHierarchy(Primitives primitives, MortonCodes sorted_morton_codes,

Kokkos::View<unsigned int *, DeviceType> permutation_indices(
"Testing::indices", n);
ArborX::iota(space, permutation_indices);
ArborX::Details::KokkosExt::iota(space, permutation_indices);

using BoundingVolume =
typename InternalNodes::value_type::bounding_volume_type;
Expand Down
23 changes: 14 additions & 9 deletions test/tstDetailsUtils.cpp
Expand Up @@ -32,26 +32,29 @@ namespace tt = boost::test_tools;
BOOST_AUTO_TEST_CASE_TEMPLATE(iota, DeviceType, ARBORX_DEVICE_TYPES)
{
using ExecutionSpace = typename DeviceType::execution_space;
namespace KokkosExt = ArborX::Details::KokkosExt;

ExecutionSpace space{};
int const n = 10;
double const val = 3.;

Kokkos::View<double *, DeviceType> v("v", n);
ArborX::iota(space, v, val);
KokkosExt::iota(space, v, val);
std::vector<double> v_ref(n);
std::iota(v_ref.begin(), v_ref.end(), val);
auto v_host = Kokkos::create_mirror_view(v);
Kokkos::deep_copy(v_host, v);
BOOST_TEST(v_ref == v_host, tt::per_element());

Kokkos::View<int[3], DeviceType> w("w");
ArborX::iota(space, w);
KokkosExt::iota(space, w);
std::vector<int> w_ref = {0, 1, 2};
auto w_host = Kokkos::create_mirror_view(w);
Kokkos::deep_copy(w_host, w);
BOOST_TEST(w_ref == w_host, tt::per_element());
}

BOOST_AUTO_TEST_CASE_TEMPLATE(prefix_sum, DeviceType, ARBORX_DEVICE_TYPES)
BOOST_AUTO_TEST_CASE_TEMPLATE(exclusive_scan, DeviceType, ARBORX_DEVICE_TYPES)
{
namespace KokkosExt = ArborX::Details::KokkosExt;
using ExecutionSpace = typename DeviceType::execution_space;
Expand Down Expand Up @@ -163,15 +166,15 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(reduce, DeviceType, ARBORX_DEVICE_TYPES)
using ExecutionSpace = typename DeviceType::execution_space;
ExecutionSpace space{};

using ArborX::Details::KokkosExt::reduce;
namespace KokkosExt = ArborX::Details::KokkosExt;

Kokkos::View<int[6], DeviceType> v("v");
Kokkos::deep_copy(v, 5);
BOOST_TEST(reduce(space, v, 3) == 33);
BOOST_TEST(KokkosExt::reduce(space, v, 3) == 33);

Kokkos::View<int *, DeviceType> w("w", 5);
ArborX::iota(space, w, 2);
BOOST_TEST(reduce(space, w, 4) == 24);
KokkosExt::iota(space, w, 2);
BOOST_TEST(KokkosExt::reduce(space, w, 4) == 24);
}

BOOST_AUTO_TEST_CASE_TEMPLATE(adjacent_difference, DeviceType,
Expand Down Expand Up @@ -219,13 +222,15 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(min_and_max, DeviceType, ARBORX_DEVICE_TYPES)
using ExecutionSpace = typename DeviceType::execution_space;
ExecutionSpace space{};

namespace KokkosExt = ArborX::Details::KokkosExt;

Kokkos::View<int[4], DeviceType> v("v");
ArborX::iota(space, v);
KokkosExt::iota(space, v);
BOOST_TEST(ArborX::min(space, v) == 0);
BOOST_TEST(ArborX::max(space, v) == 3);

Kokkos::View<int *, DeviceType> w("w", 7);
ArborX::iota(space, w, 2);
KokkosExt::iota(space, w, 2);
BOOST_TEST(ArborX::min(space, w) == 2);
BOOST_TEST(ArborX::max(space, w) == 8);

Expand Down
2 changes: 1 addition & 1 deletion test/tstUnionFind.cpp
Expand Up @@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(union_find, DeviceType, ARBORX_DEVICE_TYPES)
Kokkos::View<int *, MemorySpace> labels(
Kokkos::view_alloc(space, Kokkos::WithoutInitializing, "Test::labels"),
n);
ArborX::iota(space, labels);
ArborX::Details::KokkosExt::iota(space, labels);
UnionFind union_find(labels);

ARBORX_TEST_UNION_FIND_REPRESENTATIVES(space, union_find,
Expand Down

0 comments on commit fccbe2b

Please sign in to comment.