|
| 1 | +#include <vector> |
| 2 | + |
| 3 | +#include <thrust/binary_search.h> |
| 4 | +#include <thrust/copy.h> |
| 5 | +#include <thrust/device_malloc.h> |
| 6 | +#include <thrust/device_vector.h> |
| 7 | +#include <thrust/execution_policy.h> |
| 8 | +#include <thrust/extrema.h> |
| 9 | +#include <thrust/find.h> |
| 10 | +#include <thrust/functional.h> |
| 11 | +#include <thrust/gather.h> |
| 12 | +#include <thrust/host_vector.h> |
| 13 | +#include <thrust/inner_product.h> |
| 14 | +#include <thrust/mismatch.h> |
| 15 | +#include <thrust/random.h> |
| 16 | +#include <thrust/reduce.h> |
| 17 | +#include <thrust/remove.h> |
| 18 | +#include <thrust/replace.h> |
| 19 | +#include <thrust/reverse.h> |
| 20 | +#include <thrust/set_operations.h> |
| 21 | +#include <thrust/sort.h> |
| 22 | +#include <thrust/tabulate.h> |
| 23 | +#include <thrust/transform_scan.h> |
| 24 | +#include <thrust/unique.h> |
| 25 | + |
| 26 | + |
| 27 | +void binary_search_test() { |
| 28 | + // clang-format off |
| 29 | + // Start |
| 30 | + std::vector<int> v, v2, v3, v4; |
| 31 | + auto bp = [](int x, int y) -> bool { return x < y; }; |
| 32 | + /*1*/ thrust::binary_search(thrust::seq, v.begin(), v.end(), v2.begin(), v2.end(), v3.begin()); |
| 33 | + /*2*/ thrust::binary_search(v.begin(), v.end(), v2.begin(), v2.end(), v3.begin()); |
| 34 | + /*3*/ thrust::binary_search(thrust::seq, v.begin(), v.end(), v2.begin(), v2.end(), v3.begin(), bp); |
| 35 | + /*4*/ thrust::binary_search(v.begin(), v.end(), v2.begin(), v2.end(), v3.begin(), bp); |
| 36 | + // End |
| 37 | + // clang-format on |
| 38 | +} |
0 commit comments