|
3 | 3 |
|
4 | 4 | #include "metaphysicl/metaphysicl_device.h" |
5 | 5 |
|
| 6 | +#include <algorithm> |
6 | 7 | #include <type_traits> |
7 | 8 |
|
8 | 9 | namespace MetaPhysicL::detail { |
9 | 10 |
|
| 11 | +#ifdef METAPHYSICL_KOKKOS_COMPILATION |
| 12 | + |
10 | 13 | template <typename T, typename U> |
11 | 14 | METAPHYSICL_INLINE constexpr bool less(const T & lhs, const U & rhs) |
12 | 15 | { |
@@ -96,6 +99,36 @@ METAPHYSICL_INLINE bool is_sorted(ForwardIt first, ForwardIt last) |
96 | 99 | return true; |
97 | 100 | } |
98 | 101 |
|
| 102 | +#else |
| 103 | + |
| 104 | +template <typename ForwardIt, typename T> |
| 105 | +METAPHYSICL_INLINE ForwardIt lower_bound(ForwardIt first, ForwardIt last, const T & value) |
| 106 | +{ |
| 107 | + return std::lower_bound(first, last, value); |
| 108 | +} |
| 109 | + |
| 110 | +template <typename BidirectionalIt1, typename BidirectionalIt2> |
| 111 | +METAPHYSICL_INLINE BidirectionalIt2 copy_backward(BidirectionalIt1 first, |
| 112 | + BidirectionalIt1 last, |
| 113 | + BidirectionalIt2 result) |
| 114 | +{ |
| 115 | + return std::copy_backward(first, last, result); |
| 116 | +} |
| 117 | + |
| 118 | +template <typename ForwardIt> |
| 119 | +METAPHYSICL_INLINE ForwardIt adjacent_find(ForwardIt first, ForwardIt last) |
| 120 | +{ |
| 121 | + return std::adjacent_find(first, last); |
| 122 | +} |
| 123 | + |
| 124 | +template <typename ForwardIt> |
| 125 | +METAPHYSICL_INLINE bool is_sorted(ForwardIt first, ForwardIt last) |
| 126 | +{ |
| 127 | + return std::is_sorted(first, last); |
| 128 | +} |
| 129 | + |
| 130 | +#endif |
| 131 | + |
99 | 132 | } // namespace MetaPhysicL::detail |
100 | 133 |
|
101 | 134 | #endif // METAPHYSICL_ALGORITHM_H |
0 commit comments