6#include <Kokkos_Core.hpp>
14template <class InputIt, class T = typename std::iterator_traits<InputIt>::value_type>
15KOKKOS_FUNCTION
constexpr InputIt find(InputIt first, InputIt last,
const T& value)
17 for (; first != last; ++first)
53KOKKOS_FUNCTION
constexpr std::remove_reference_t<T>&& move(T&& t)
noexcept
55 return static_cast<typename std::remove_reference<T>::type&&
>(t);
58template <
class InputIt,
class OutputIt>
59KOKKOS_FUNCTION OutputIt move(InputIt first, InputIt last, OutputIt d_first)
61 for (; first != last; ++d_first, ++first)
62 *d_first = move(*first);
68KOKKOS_FUNCTION
constexpr std::size_t bounded_advance(I& i, std::size_t n, I
const bound)
70 for (; n > 0 && i != bound; --n, void(++i)) {
77template <
class ForwardIt>
78KOKKOS_FUNCTION ForwardIt shift_left(ForwardIt first, ForwardIt last, std::size_t n)
85 if (bounded_advance(mid, n, last)) {
89 return move(move(mid), move(last), move(first));
92template <
class InputIt,
class OutputIt>
93KOKKOS_FUNCTION
constexpr OutputIt copy(InputIt first, InputIt last, OutputIt d_first)
95 for (; first != last; (void)++first, (void)++d_first)
102template <
typename It,
typename Compare = std::less<>>
103KOKKOS_FUNCTION
constexpr void sort(It begin, It end, Compare comp = Compare())
105 for (It i = begin; i != end; ++i) {
106 for (It j = begin; j < end - 1; ++j) {
107 if (comp(*(j + 1), *j)) {
108 Kokkos::kokkos_swap(*j, *(j + 1));
The top-level namespace of SimiLie.