diff --git a/benchmarks/dbscan/ArborX_DBSCANVerification.hpp b/benchmarks/dbscan/ArborX_DBSCANVerification.hpp index 78fa1eff9..f3a624148 100644 --- a/benchmarks/dbscan/ArborX_DBSCANVerification.hpp +++ b/benchmarks/dbscan/ArborX_DBSCANVerification.hpp @@ -290,8 +290,8 @@ bool verifyDBSCAN(ExecutionSpace exec_space, Primitives const &primitives, static_assert(std::is_same{}); static_assert(std::is_same{}); - ARBORX_ASSERT(eps > 0); - ARBORX_ASSERT(core_min_size >= 2); + KOKKOS_ASSERT(eps > 0); + KOKKOS_ASSERT(core_min_size >= 2); Points points{primitives}; // NOLINT diff --git a/benchmarks/dbscan/data.hpp b/benchmarks/dbscan/data.hpp index 0e30c8808..f10c35c03 100644 --- a/benchmarks/dbscan/data.hpp +++ b/benchmarks/dbscan/data.hpp @@ -13,7 +13,6 @@ #define DATA_HPP #include -#include #include #include @@ -65,7 +64,8 @@ std::vector> loadData(std::string const &filename, input.open(filename); else input.open(filename, std::ifstream::binary); - ARBORX_ASSERT(input.good()); + if (!input.good()) + Kokkos::abort("Could not load data"); std::vector> v; @@ -82,7 +82,8 @@ std::vector> loadData(std::string const &filename, input.read(reinterpret_cast(&dim), sizeof(int)); } - ARBORX_ASSERT(dim == DIM); + if (dim != DIM) + Kokkos::abort("Mismatching dimensions"); if (max_num_points > 0 && max_num_points < num_points) num_points = max_num_points; diff --git a/benchmarks/dbscan/dbscan_timpl.hpp b/benchmarks/dbscan/dbscan_timpl.hpp index 6acd3f20d..8348baf4c 100644 --- a/benchmarks/dbscan/dbscan_timpl.hpp +++ b/benchmarks/dbscan/dbscan_timpl.hpp @@ -32,7 +32,8 @@ void writeLabelsData(std::string const &filename, Kokkos::View labels) { std::ofstream out(filename, std::ofstream::binary); - ARBORX_ASSERT(out.good()); + if (!out.good()) + Kokkos::abort("Could not open file"); auto labels_host = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace{}, labels); @@ -70,7 +71,7 @@ void sortAndFilterClusters(ExecutionSpace const &exec_space, static_assert( std::is_same{}); - ARBORX_ASSERT(cluster_min_size >= 1); + KOKKOS_ASSERT(cluster_min_size >= 1); int const n = labels.extent_int(0); diff --git a/examples/viz/tree_visualization.cpp b/examples/viz/tree_visualization.cpp index c66a401c4..691fa9113 100644 --- a/examples/viz/tree_visualization.cpp +++ b/examples/viz/tree_visualization.cpp @@ -37,7 +37,7 @@ void loadPointCloud(std::string const &filename, Points &random_points) { int size = -1; file >> size; - ARBORX_ASSERT(size > 0); + KOKKOS_ASSERT(size > 0); Kokkos::realloc(random_points, size); auto random_points_host = Kokkos::create_mirror_view(random_points); for (int i = 0; i < size; ++i) diff --git a/src/ArborX.hpp b/src/ArborX.hpp index 28335e2a7..cfc6fee25 100644 --- a/src/ArborX.hpp +++ b/src/ArborX.hpp @@ -25,7 +25,6 @@ #include #include #include -#include // FIXME: we include ArborX_Utils.hpp only for backward compatibility for // users using deprecated functions in ArborX namespace (min, max, // adjacentDifference, ...). This header should be removed when we remove those diff --git a/src/cluster/ArborX_DBSCAN.hpp b/src/cluster/ArborX_DBSCAN.hpp index 94dc2e6d9..e88d424d3 100644 --- a/src/cluster/ArborX_DBSCAN.hpp +++ b/src/cluster/ArborX_DBSCAN.hpp @@ -26,6 +26,8 @@ #include #include // sortObjects +#include + namespace ArborX { @@ -217,8 +219,17 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives, KokkosExt::is_accessible_from::value, "Primitives must be accessible from the execution space"); - ARBORX_ASSERT(eps > 0); - ARBORX_ASSERT(core_min_size >= 2); + if (eps <= 0) + Kokkos::abort((std::string("ArborX: DBSCAN parameter eps must be positive " + "(provided value is ") + + std::to_string(eps) + ")") + .c_str()); + + if (core_min_size < 2) + Kokkos::abort((std::string("ArborX: DBSCAN parameter core_min_size must be " + "greater than 1 (provided value is ") + + std::to_string(core_min_size) + ")") + .c_str()); #ifdef KOKKOS_ENABLE_SERIAL using UnionFind = Details::UnionFind< diff --git a/src/cluster/detail/ArborX_BoruvkaHelpers.hpp b/src/cluster/detail/ArborX_BoruvkaHelpers.hpp index ff31da940..d5c6224b6 100644 --- a/src/cluster/detail/ArborX_BoruvkaHelpers.hpp +++ b/src/cluster/detail/ArborX_BoruvkaHelpers.hpp @@ -134,9 +134,9 @@ struct FindComponentNearestNeighbors , _lower_bounds(lower_bounds) { int const n = bvh.size(); - ARBORX_ASSERT(labels.extent_int(0) == 2 * n - 1); - ARBORX_ASSERT(edges.extent_int(0) == n); - ARBORX_ASSERT(radii.extent_int(0) == n); + KOKKOS_ASSERT(labels.extent_int(0) == 2 * n - 1); + KOKKOS_ASSERT(edges.extent_int(0) == n); + KOKKOS_ASSERT(radii.extent_int(0) == n); #ifdef KOKKOS_ENABLE_SERIAL if (std::is_same{}) @@ -479,7 +479,7 @@ void finalizeEdges(ExecutionSpace const &space, BVH const &bvh, Edges const &edges) { int const n = bvh.size(); - ARBORX_ASSERT(edges.extent_int(0) == n - 1); + KOKKOS_ASSERT(edges.extent_int(0) == n - 1); Kokkos::parallel_for( "ArborX::MST::finalize_edges", Kokkos::RangePolicy(space, 0, n - 1), KOKKOS_LAMBDA(int i) { diff --git a/src/cluster/detail/ArborX_CartesianGrid.hpp b/src/cluster/detail/ArborX_CartesianGrid.hpp index 01b623acc..3243d4310 100644 --- a/src/cluster/detail/ArborX_CartesianGrid.hpp +++ b/src/cluster/detail/ArborX_CartesianGrid.hpp @@ -14,12 +14,13 @@ #include #include -#include #include // KOKKOS_ASSERT #include #include // floor +#include + namespace ArborX::Details { @@ -32,7 +33,8 @@ struct CartesianGrid CartesianGrid(Box const &bounds, float h) : _bounds(bounds) { - ARBORX_ASSERT(h > 0); + KOKKOS_ASSERT(h > 0); + for (int d = 0; d < DIM; ++d) _h[d] = h; buildGrid(); @@ -42,7 +44,7 @@ struct CartesianGrid { for (int d = 0; d < DIM; ++d) { - ARBORX_ASSERT(_h[d] > 0); + KOKKOS_ASSERT(_h[d] > 0); _h[d] = h[d]; } buildGrid(); @@ -101,7 +103,7 @@ struct CartesianGrid if (delta != 0) { _n[d] = std::ceil(delta / _h[d]); - ARBORX_ASSERT(_n[d] > 0); + KOKKOS_ASSERT(_n[d] > 0); } else { @@ -117,7 +119,8 @@ struct CartesianGrid for (int d = 1; d < DIM; ++d) { m /= _n[d - 1]; - ARBORX_ASSERT(_n[d] < m); + if (_n[d] >= m) + Kokkos::abort("ArborX: potential overflow detected in CartesianGrid"); } // Catch a potential loss of precision that may happen in cellBox() and can @@ -131,7 +134,7 @@ struct CartesianGrid for (int d = 0; d < DIM; ++d) { if (std::abs(_h[d] / min_corner[d]) < eps) - throw std::runtime_error( + Kokkos::abort( "ArborX exception: FDBSCAN-DenseBox algorithm will experience loss " "of precision, undetectably producing wrong results. Please switch " "to using FDBSCAN."); diff --git a/src/distributed/detail/ArborX_Distributor.hpp b/src/distributed/detail/ArborX_Distributor.hpp index ce05fd4c4..fcff27dcb 100644 --- a/src/distributed/detail/ArborX_Distributor.hpp +++ b/src/distributed/detail/ArborX_Distributor.hpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -44,10 +43,10 @@ determineBufferLayout(ExecutionSpace const &space, InputView batched_ranks, Kokkos::Profiling::ScopedRegion guard( "ArborX::Distributor::determineBufferLayout"); - ARBORX_ASSERT(unique_ranks.empty()); - ARBORX_ASSERT(offsets.empty()); - ARBORX_ASSERT(permutation_indices.extent_int(0) == 0); - ARBORX_ASSERT(batched_ranks.size() + 1 == batched_offsets.size()); + KOKKOS_ASSERT(unique_ranks.empty()); + KOKKOS_ASSERT(offsets.empty()); + KOKKOS_ASSERT(permutation_indices.extent_int(0) == 0); + KOKKOS_ASSERT(batched_ranks.size() + 1 == batched_offsets.size()); static_assert(std::is_same_v); static_assert(std::is_same_v); @@ -140,9 +139,9 @@ static void sortAndDetermineBufferLayout(ExecutionSpace const &space, Kokkos::Profiling::ScopedRegion guard( "ArborX::Distributor::sortAndDetermineBufferLayout"); - ARBORX_ASSERT(unique_ranks.empty()); - ARBORX_ASSERT(offsets.empty()); - ARBORX_ASSERT(permutation_indices.extent_int(0) == ranks.extent_int(0)); + KOKKOS_ASSERT(unique_ranks.empty()); + KOKKOS_ASSERT(offsets.empty()); + KOKKOS_ASSERT(permutation_indices.extent_int(0) == ranks.extent_int(0)); static_assert(std::is_same_v); static_assert(std::is_same_v); @@ -195,7 +194,7 @@ static void sortAndDetermineBufferLayout(ExecutionSpace const &space, offsets.push_back(offset); } Kokkos::deep_copy(space, permutation_indices, device_permutation_indices); - ARBORX_ASSERT(offsets.back() == static_cast(ranks.size())); + KOKKOS_ASSERT(offsets.back() == static_cast(ranks.size())); } template @@ -307,9 +306,9 @@ class Distributor bool const permutation_necessary = _permute.size() != 0; - ARBORX_ASSERT(!permutation_necessary || exports.size() == _permute.size()); - ARBORX_ASSERT(exports.size() == getTotalSendLength()); - ARBORX_ASSERT(imports.size() == getTotalReceiveLength()); + KOKKOS_ASSERT(!permutation_necessary || exports.size() == _permute.size()); + KOKKOS_ASSERT(exports.size() == getTotalSendLength()); + KOKKOS_ASSERT(imports.size() == getTotalReceiveLength()); // Make sure things work even if ExportView is unmanaged using ExportViewWithoutMemoryTraits = @@ -343,7 +342,7 @@ class Distributor same_rank_destination = it - _destinations.begin(); it = std::find(_sources.begin(), _sources.end(), comm_rank); - ARBORX_ASSERT(it != _sources.end()); + KOKKOS_ASSERT(it != _sources.end()); same_rank_source = it - _sources.begin(); } } @@ -410,7 +409,7 @@ class Distributor if (same_rank_destination != -1) { - ARBORX_ASSERT((_src_offsets[same_rank_source + 1] - + KOKKOS_ASSERT((_src_offsets[same_rank_source + 1] - _src_offsets[same_rank_source]) == (_dest_offsets[same_rank_destination + 1] - _dest_offsets[same_rank_destination])); diff --git a/src/interpolation/detail/ArborX_InterpDetailsSymmetricPseudoInverseSVD.hpp b/src/interpolation/detail/ArborX_InterpDetailsSymmetricPseudoInverseSVD.hpp index e277ee095..11c81e81d 100644 --- a/src/interpolation/detail/ArborX_InterpDetailsSymmetricPseudoInverseSVD.hpp +++ b/src/interpolation/detail/ArborX_InterpDetailsSymmetricPseudoInverseSVD.hpp @@ -13,7 +13,6 @@ #define ARBORX_INTERP_SYMMETRIC_PSEUDO_INVERSE_SVD_HPP #include -#include #include #include diff --git a/src/kokkos_ext/ArborX_KokkosExtMinMaxReduce.hpp b/src/kokkos_ext/ArborX_KokkosExtMinMaxReduce.hpp index 19191dbf8..2a3727743 100644 --- a/src/kokkos_ext/ArborX_KokkosExtMinMaxReduce.hpp +++ b/src/kokkos_ext/ArborX_KokkosExtMinMaxReduce.hpp @@ -13,7 +13,6 @@ #define ARBORX_KOKKOS_EXT_MIN_MAX_REDUCTIONS_HPP #include -#include #include @@ -34,7 +33,8 @@ minmax_reduce(ExecutionSpace const &space, ViewType const &v) "minmax_reduce requires a View of rank 1"); auto const n = v.extent(0); - ARBORX_ASSERT(n > 0); + if (n == 0) + Kokkos::abort("ArborX: minmax_reduce: view must be non-empty"); using ValueType = typename ViewType::non_const_value_type; @@ -69,7 +69,8 @@ typename ViewType::non_const_value_type min_reduce(ExecutionSpace const &space, static_assert(ViewType::rank() == 1, "min_reduce requires a View of rank 1"); auto const n = v.extent(0); - ARBORX_ASSERT(n > 0); + if (n == 0) + Kokkos::abort("ArborX: minmax_reduce: view must be non-empty"); using ValueType = typename ViewType::non_const_value_type; @@ -96,7 +97,8 @@ typename ViewType::non_const_value_type max_reduce(ExecutionSpace const &space, static_assert(ViewType::rank() == 1, "max_reduce requires a View of rank 1"); auto const n = v.extent(0); - ARBORX_ASSERT(n > 0); + if (n == 0) + Kokkos::abort("ArborX: minmax_reduce: view must be non-empty"); using ValueType = typename ViewType::non_const_value_type; diff --git a/src/kokkos_ext/ArborX_KokkosExtSort.hpp b/src/kokkos_ext/ArborX_KokkosExtSort.hpp index f76005e2e..4d60f932b 100644 --- a/src/kokkos_ext/ArborX_KokkosExtSort.hpp +++ b/src/kokkos_ext/ArborX_KokkosExtSort.hpp @@ -90,7 +90,9 @@ void sortByKey(ExecutionSpace const &space, Keys &keys, Values &values) static_assert(KokkosExt::is_accessible_from::value); auto const n = keys.size(); - ARBORX_ASSERT(values.size() == n); + if (values.size() != n) + Kokkos::abort( + "ArborX: sortByKey: keys and values must be of the same size"); if (n == 0) return; @@ -132,7 +134,9 @@ void sortByKey( static_assert(KokkosExt::is_accessible_from::value); auto const n = keys.size(); - ARBORX_ASSERT(values.size() == n); + if (values.size() != n) + Kokkos::abort( + "ArborX: sortByKey: keys and values must be of the same size"); if (n == 0) return; @@ -165,7 +169,9 @@ void sortByKey(Kokkos::Experimental::SYCL const &space, Keys &keys, static_assert(KokkosExt::is_accessible_from::value); auto const n = keys.size(); - ARBORX_ASSERT(values.size() == n); + if (values.size() != n) + Kokkos::abort( + "ArborX: sortByKey: keys and values must be of the same size"); if (n == 0) return; diff --git a/src/kokkos_ext/ArborX_KokkosExtViewHelpers.hpp b/src/kokkos_ext/ArborX_KokkosExtViewHelpers.hpp index 6ef835802..f18ac4cc3 100644 --- a/src/kokkos_ext/ArborX_KokkosExtViewHelpers.hpp +++ b/src/kokkos_ext/ArborX_KokkosExtViewHelpers.hpp @@ -12,8 +12,6 @@ #ifndef ARBORX_KOKKOS_EXT_VIEW_HELPERS_HPP #define ARBORX_KOKKOS_EXT_VIEW_HELPERS_HPP -#include - #include namespace ArborX::Details::KokkosExt @@ -34,7 +32,7 @@ lastElement(ExecutionSpace const &space, Kokkos::View const &v) static_assert(unsigned(Kokkos::ViewTraits::rank) == unsigned(1), "lastElement requires Views of rank 1"); auto const n = v.extent(0); - ARBORX_ASSERT(n > 0); + KOKKOS_ASSERT(n > 0); auto v_subview = Kokkos::subview(v, n - 1); typename Kokkos::ViewTraits::non_const_value_type v_host; Kokkos::deep_copy(space, v_host, v_subview); diff --git a/src/misc/ArborX_Exception.hpp b/src/misc/ArborX_Exception.hpp deleted file mode 100644 index d1ec2fe35..000000000 --- a/src/misc/ArborX_Exception.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2017-2022 by the ArborX authors * - * All rights reserved. * - * * - * This file is part of the ArborX library. ArborX is * - * distributed under a BSD 3-clause license. For the licensing terms see * - * the LICENSE file in the top-level directory. * - * * - * SPDX-License-Identifier: BSD-3-Clause * - ****************************************************************************/ -#ifndef ARBORX_SEARCH_EXCEPTION_HPP -#define ARBORX_SEARCH_EXCEPTION_HPP - -#include -#include - -namespace ArborX -{ -class SearchException : public std::logic_error -{ -public: - SearchException(std::string const &msg) - : std::logic_error(std::string("ArborX exception: ") + msg) - {} -}; - -} // namespace ArborX - -#define ARBORX_STRINGIZE_DETAIL(x) #x -#define ARBORX_STRINGIZE(x) ARBORX_STRINGIZE_DETAIL(x) - -// FIXME: Unconditionally assert for now -// Once moved out, possibly make it conditional -#define ARBORX_ASSERT(c) \ - if (!(c)) \ - throw ArborX::SearchException(#c ", failed at " __FILE__ \ - ":" ARBORX_STRINGIZE(__LINE__) ".") - -#endif diff --git a/src/misc/ArborX_SortUtils.hpp b/src/misc/ArborX_SortUtils.hpp index d68c42347..e41fee735 100644 --- a/src/misc/ArborX_SortUtils.hpp +++ b/src/misc/ArborX_SortUtils.hpp @@ -15,7 +15,6 @@ #include #include // iota #include // clone -#include #include @@ -56,8 +55,8 @@ void applyInversePermutation(ExecutionSpace const &space, static_assert(std::is_integral_v); auto const n = input_view.extent(0); - ARBORX_ASSERT(permutation.extent(0) == n); - ARBORX_ASSERT(output_view.extent(0) == n); + KOKKOS_ASSERT(permutation.extent(0) == n); + KOKKOS_ASSERT(output_view.extent(0) == n); Kokkos::parallel_for( "ArborX::Sorting::inverse_permute", Kokkos::RangePolicy(space, 0, n), @@ -78,8 +77,8 @@ void applyPermutation(ExecutionSpace const &space, static_assert(std::is_integral_v); auto const n = input_view.extent(0); - ARBORX_ASSERT(permutation.extent(0) == n); - ARBORX_ASSERT(output_view.extent(0) == n); + KOKKOS_ASSERT(permutation.extent(0) == n); + KOKKOS_ASSERT(output_view.extent(0) == n); Kokkos::parallel_for( "ArborX::Sorting::permute", Kokkos::RangePolicy(space, 0, n), diff --git a/src/misc/ArborX_Utils.hpp b/src/misc/ArborX_Utils.hpp index ae30c9134..71ece3bd3 100644 --- a/src/misc/ArborX_Utils.hpp +++ b/src/misc/ArborX_Utils.hpp @@ -14,7 +14,6 @@ #include #include -#include #include diff --git a/src/spatial/detail/ArborX_BruteForceImpl.hpp b/src/spatial/detail/ArborX_BruteForceImpl.hpp index cc5437b1f..a50806e16 100644 --- a/src/spatial/detail/ArborX_BruteForceImpl.hpp +++ b/src/spatial/detail/ArborX_BruteForceImpl.hpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include @@ -68,8 +67,8 @@ struct BruteForceImpl max_scratch_size / 2 / sizeof(PredicateType); int const indexables_per_team = max_scratch_size / 2 / sizeof(IndexableType); - ARBORX_ASSERT(predicates_per_team > 0); - ARBORX_ASSERT(indexables_per_team > 0); + KOKKOS_ASSERT(predicates_per_team > 0); + KOKKOS_ASSERT(indexables_per_team > 0); int const n_indexable_tiles = std::ceil((float)n_indexables / indexables_per_team); diff --git a/src/spatial/detail/ArborX_CrsGraphWrapperImpl.hpp b/src/spatial/detail/ArborX_CrsGraphWrapperImpl.hpp index 7f33b6924..fea5a700d 100644 --- a/src/spatial/detail/ArborX_CrsGraphWrapperImpl.hpp +++ b/src/spatial/detail/ArborX_CrsGraphWrapperImpl.hpp @@ -21,6 +21,8 @@ #include #include +#include + namespace ArborX { namespace Details @@ -227,7 +229,8 @@ void queryImpl(ExecutionSpace const &space, Tree const &tree, // Not enough (individual) storage for results // If it was hard preallocation, we simply throw - ARBORX_ASSERT(buffer_status != BufferStatus::PreallocationHard); + if (buffer_status == BufferStatus::PreallocationHard) + Kokkos::abort("ArborX: overflow occued with hard preallocation"); // Otherwise, do the second pass Kokkos::Profiling::pushRegion( diff --git a/src/spatial/detail/ArborX_TreeConstruction.hpp b/src/spatial/detail/ArborX_TreeConstruction.hpp index 84c1f6d25..f8798cf4b 100644 --- a/src/spatial/detail/ArborX_TreeConstruction.hpp +++ b/src/spatial/detail/ArborX_TreeConstruction.hpp @@ -17,7 +17,6 @@ #include // makeLeafNode #include #include -#include #include @@ -48,7 +47,7 @@ inline void projectOntoSpaceFillingCurve(ExecutionSpace const &space, LinearOrdering linear_ordering_indices) { size_t const n = indexables.size(); - ARBORX_ASSERT(linear_ordering_indices.extent(0) == n); + KOKKOS_ASSERT(linear_ordering_indices.extent(0) == n); static_assert( std::is_same_v); @@ -67,8 +66,8 @@ initializeSingleLeafTree(ExecutionSpace const &space, Values const &values, IndexableGetter const &indexable_getter, Nodes const &leaf_nodes, BoundingVolume &bounds) { - ARBORX_ASSERT(leaf_nodes.extent(0) == 1); - ARBORX_ASSERT(values.size() == 1); + KOKKOS_ASSERT(leaf_nodes.extent(0) == 1); + KOKKOS_ASSERT(values.size() == 1); // Skip initialization so that we don't execute a kernel launch Kokkos::View bounding_volume( diff --git a/src/spatial/detail/ArborX_TreeNodeLabeling.hpp b/src/spatial/detail/ArborX_TreeNodeLabeling.hpp index b72c18023..eeeec5907 100644 --- a/src/spatial/detail/ArborX_TreeNodeLabeling.hpp +++ b/src/spatial/detail/ArborX_TreeNodeLabeling.hpp @@ -13,7 +13,6 @@ #define ARBORX_TREE_NODE_LABELING_HPP #include -#include #include @@ -28,8 +27,8 @@ void findParents(ExecutionSpace const &exec_space, BVH const &bvh, { int const n = bvh.size(); - ARBORX_ASSERT(n >= 2); - ARBORX_ASSERT((int)parents.size() == 2 * n - 1); + KOKKOS_ASSERT(n >= 2); + KOKKOS_ASSERT((int)parents.size() == 2 * n - 1); Kokkos::parallel_for( "ArborX::recompute_internal_and_leaf_node_parents", @@ -45,8 +44,8 @@ void reduceLabels(ExecutionSpace const &exec_space, Parents const &parents, { int const n = (parents.size() + 1) / 2; - ARBORX_ASSERT(n >= 2); - ARBORX_ASSERT(labels.size() == parents.size()); + KOKKOS_ASSERT(n >= 2); + KOKKOS_ASSERT(labels.size() == parents.size()); using ValueType = typename Labels::value_type; constexpr ValueType indeterminate = -1; diff --git a/src/spatial/detail/ArborX_TreeTraversal.hpp b/src/spatial/detail/ArborX_TreeTraversal.hpp index b742fb5b8..d5c5bc1f4 100644 --- a/src/spatial/detail/ArborX_TreeTraversal.hpp +++ b/src/spatial/detail/ArborX_TreeTraversal.hpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/test/ArborX_BoostRangeAdapters.hpp b/test/ArborX_BoostRangeAdapters.hpp index 381df64c1..a7d8d0cdb 100644 --- a/test/ArborX_BoostRangeAdapters.hpp +++ b/test/ArborX_BoostRangeAdapters.hpp @@ -13,7 +13,6 @@ #define ARBORX_BOOST_RANGE_ADAPTERS_HPP #include -#include #include @@ -104,7 +103,7 @@ range_end(Kokkos::View &v) { using View = Kokkos::View; ARBORX_ASSERT_VIEW_COMPATIBLE(View) - ARBORX_ASSERT(v.span_is_contiguous()); + KOKKOS_ASSERT(v.span_is_contiguous()); return v.data() + v.span(); } @@ -114,7 +113,7 @@ range_end(Kokkos::View const &v) { using View = Kokkos::View; ARBORX_ASSERT_VIEW_COMPATIBLE(View) - ARBORX_ASSERT(v.span_is_contiguous()); + KOKKOS_ASSERT(v.span_is_contiguous()); return v.data() + v.span(); } diff --git a/test/tstDetailsKokkosExtKernelStdAlgorithms.cpp b/test/tstDetailsKokkosExtKernelStdAlgorithms.cpp index 89217c0ea..543f7533a 100644 --- a/test/tstDetailsKokkosExtKernelStdAlgorithms.cpp +++ b/test/tstDetailsKokkosExtKernelStdAlgorithms.cpp @@ -13,7 +13,6 @@ #include "ArborX_EnableViewComparison.hpp" #include #include -#include #include diff --git a/test/tstDetailsKokkosExtMinMaxReduce.cpp b/test/tstDetailsKokkosExtMinMaxReduce.cpp index 3fc972399..f11fa815a 100644 --- a/test/tstDetailsKokkosExtMinMaxReduce.cpp +++ b/test/tstDetailsKokkosExtMinMaxReduce.cpp @@ -46,8 +46,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(minmax_reduce, DeviceType, ARBORX_DEVICE_TYPES) BOOST_TEST(std::get<0>(result_float) == 1.41); BOOST_TEST(std::get<1>(result_float) == 3.14); Kokkos::View w("w", 0); - BOOST_CHECK_THROW(KokkosExt::minmax_reduce(space, w), - ArborX::SearchException); + // FIXME: need death testing + // BOOST_CHECK_THROW(KokkosExt::minmax_reduce(space, w), + // ArborX::SearchException); Kokkos::resize(w, 1); Kokkos::deep_copy(w, 255); auto const result_int = KokkosExt::minmax_reduce(space, w); diff --git a/test/tstDetailsKokkosExtStdAlgorithms.cpp b/test/tstDetailsKokkosExtStdAlgorithms.cpp index 0bde51b2f..f0aa80ae0 100644 --- a/test/tstDetailsKokkosExtStdAlgorithms.cpp +++ b/test/tstDetailsKokkosExtStdAlgorithms.cpp @@ -12,7 +12,6 @@ #include "ArborX_EnableDeviceTypes.hpp" // ARBORX_DEVICE_TYPES #include "ArborX_EnableViewComparison.hpp" #include -#include #include diff --git a/test/tstDetailsKokkosExtUninitializedMemoryAlgorithms.cpp b/test/tstDetailsKokkosExtUninitializedMemoryAlgorithms.cpp index 3fcd30dbb..ce828839a 100644 --- a/test/tstDetailsKokkosExtUninitializedMemoryAlgorithms.cpp +++ b/test/tstDetailsKokkosExtUninitializedMemoryAlgorithms.cpp @@ -11,7 +11,6 @@ #include "ArborX_EnableDeviceTypes.hpp" // ARBORX_DEVICE_TYPES #include -#include #include diff --git a/test/tstDetailsKokkosExtViewHelpers.cpp b/test/tstDetailsKokkosExtViewHelpers.cpp index fde532dc2..31f482f32 100644 --- a/test/tstDetailsKokkosExtViewHelpers.cpp +++ b/test/tstDetailsKokkosExtViewHelpers.cpp @@ -11,7 +11,6 @@ #include "ArborX_EnableDeviceTypes.hpp" // ARBORX_DEVICE_TYPES #include -#include #include @@ -33,8 +32,10 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(last_element, DeviceType, ARBORX_DEVICE_TYPES) v_host(1) = 24; Kokkos::deep_copy(v, v_host); BOOST_TEST(lastElement(execution_space, v) == 24); - Kokkos::View w("w", 0); - BOOST_CHECK_THROW(lastElement(execution_space, w), ArborX::SearchException); + // FIXME: need death testing + // Kokkos::View w("w", 0); + // BOOST_CHECK_THROW(lastElement(execution_space, w), + // ArborX::SearchException); Kokkos::View u("u"); Kokkos::deep_copy(u, 3.14); BOOST_TEST(lastElement(execution_space, u) == 3.14); diff --git a/test/tstDetailsMutualReachabilityDistance.cpp b/test/tstDetailsMutualReachabilityDistance.cpp index 7a8acea43..23d8e2a6a 100644 --- a/test/tstDetailsMutualReachabilityDistance.cpp +++ b/test/tstDetailsMutualReachabilityDistance.cpp @@ -29,7 +29,7 @@ auto compute_core_distances(ExecutionSpace exec_space, { auto points = toView(points_host, "Test::points"); - ARBORX_ASSERT(points.extent_int(0) >= k); + KOKKOS_ASSERT(points.extent_int(0) >= k); using MemorySpace = typename ExecutionSpace::memory_space; ArborX::BoundingVolumeHierarchy bvh{ exec_space, ArborX::Experimental::attach_indices(points)}; diff --git a/test/tstDetailsUtils.cpp b/test/tstDetailsUtils.cpp index 232f56389..982d5a9ca 100644 --- a/test/tstDetailsUtils.cpp +++ b/test/tstDetailsUtils.cpp @@ -12,7 +12,6 @@ #include "ArborXTest_StdVectorToKokkosView.hpp" #include "ArborX_EnableDeviceTypes.hpp" // ARBORX_DEVICE_TYPES #include "ArborX_EnableViewComparison.hpp" -#include #include #include diff --git a/test/tstException.cpp b/test/tstException.cpp deleted file mode 100644 index 859bd9b36..000000000 --- a/test/tstException.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2017-2022 by the ArborX authors * - * All rights reserved. * - * * - * This file is part of the ArborX library. ArborX is * - * distributed under a BSD 3-clause license. For the licensing terms see * - * the LICENSE file in the top-level directory. * - * * - * SPDX-License-Identifier: BSD-3-Clause * - ****************************************************************************/ - -#include - -#include - -BOOST_AUTO_TEST_SUITE(DesignByContract) - -BOOST_AUTO_TEST_CASE(dumb) -{ - using namespace ArborX; - BOOST_CHECK_NO_THROW(ARBORX_ASSERT(true)); - std::string const prefix = "ArborX exception: "; - BOOST_CHECK_EXCEPTION( - ARBORX_ASSERT(false), SearchException, [&](std::exception const &e) { - std::string const message = e.what(); - bool const message_starts_with_prefix = message.find(prefix) == 0; - bool const message_contains_filename = - message.find(__FILE__) != std::string::npos; - return message_starts_with_prefix && message_contains_filename; - }); - std::string const message = "Keep calm and chive on!"; - BOOST_CHECK_EXCEPTION( - throw SearchException(message), std::exception, - [&](std::exception const &e) { return prefix + message == e.what(); }); -} - -BOOST_AUTO_TEST_SUITE_END() diff --git a/test/tstQueryTreeTraversalPolicy.cpp b/test/tstQueryTreeTraversalPolicy.cpp index 67d760461..5392c01e4 100644 --- a/test/tstQueryTreeTraversalPolicy.cpp +++ b/test/tstQueryTreeTraversalPolicy.cpp @@ -99,10 +99,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(buffer_optimization, DeviceType, ArborX::query(bvh, ExecutionSpace{}, queries, indices, offset, ArborX::Experimental::TraversalPolicy().setBufferSize(+1))); checkResultsAreFine(); - BOOST_CHECK_THROW( - ArborX::query(bvh, ExecutionSpace{}, queries, indices, offset, - ArborX::Experimental::TraversalPolicy().setBufferSize(-1)), - ArborX::SearchException); + // FIXME: need death testing + // BOOST_CHECK_THROW( + // ArborX::query(bvh, ExecutionSpace{}, queries, indices, offset, + // ArborX::Experimental::TraversalPolicy().setBufferSize(-1)), + // ArborX::SearchException); // adequate buffer size BOOST_TEST(max_results_per_query < 5);