12#include "detray/definitions/detail/qualifiers.hpp"
13#include "detray/utils/find_bound.hpp"
14#include "detray/utils/ranges/detail/iterator_functions.hpp"
15#include "detray/utils/sort.hpp"
27template <std::random_access_iterator rand_iter_t,
28 std::sentinel_for<rand_iter_t> sentinel_t>
31#if defined(DETRAY_NO_DEVICE)
32 std::ranges::sort(first, last);
34 detray::detail::selection_sort(first, last);
46template <std::random_access_iterator rand_iter_t,
47 std::sentinel_for<rand_iter_t> sentinel_t,
class Predicate>
48DETRAY_HOST_DEVICE
inline auto find_if(rand_iter_t first, sentinel_t last,
50 for (rand_iter_t i = first; i != last; ++i) {
51 if (std::forward<Predicate>(comp)(*i)) {
67template <std::forward_iterator forw_iter_t,
68 std::sentinel_for<forw_iter_t> sentinel_t,
typename Value>
69DETRAY_HOST_DEVICE
inline auto lower_bound(forw_iter_t first, sentinel_t last,
71#if defined(DETRAY_NO_DEVICE)
72 return std::ranges::lower_bound(first, last, value);
74 return detray::detail::lower_bound(first, last, value);
86template <std::forward_iterator forw_iter_t,
87 std::sentinel_for<forw_iter_t> sentinel_t,
typename Value>
88DETRAY_HOST_DEVICE
inline auto upper_bound(forw_iter_t first, sentinel_t last,
90#if defined(DETRAY_NO_DEVICE)
91 return std::ranges::upper_bound(first, last, value);
93 return detray::detail::upper_bound(first, last, value);
Detray include(s).
Definition array_operators.hpp:18
auto upper_bound(forw_iter_t first, sentinel_t last, const Value &value)
upper_bound implementation for host/device
Definition algorithms.hpp:88
void sequential_sort(rand_iter_t first, sentinel_t last)
sequential (single thread) sort function
Definition algorithms.hpp:29
auto find_if(rand_iter_t first, sentinel_t last, Predicate &&comp)
find_if implementation for host/device (single thread)
Definition algorithms.hpp:48
auto lower_bound(forw_iter_t first, sentinel_t last, const Value &value)
lower_bound implementation for host/device
Definition algorithms.hpp:69