Skip to content

Commit

Permalink
integrates checked allocators
Browse files Browse the repository at this point in the history
  • Loading branch information
elstehle committed Feb 20, 2024
1 parent cb23564 commit 73cd11b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
12 changes: 4 additions & 8 deletions cub/test/catch2_test_device_select_if_vsmem.cu
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,17 @@ CUB_TEST("DeviceSelect::If works for large types", "[select_if][vsmem][device]",
using type = typename c2h::get<0, TestType>;

const int num_items = GENERATE_COPY(take(2, random(1, 10000)));
thrust::device_vector<type> in(num_items);
thrust::device_vector<type> out(num_items);
c2h::device_vector<type> in(num_items);
c2h::device_vector<type> out(num_items);
c2h::gen(CUB_SEED(2), in);

// just pick one of the input elements as boundary
// Just pick one of the input elements as boundary
less_than_t<type> le{in[num_items / 2]};

// Needs to be device accessible
// Run test
thrust::device_vector<int> num_selected_out(1, 0);
int* d_first_num_selected_out = thrust::raw_pointer_cast(num_selected_out.data());

select_if(in.begin(), out.begin(), num_selected_out.begin(), num_items, le);

std::cout << "Selected: " << num_selected_out[0] << "/" << num_items << "\n";

// Ensure that we create the same output as std
thrust::host_vector<type> reference = in;
std::stable_partition(reference.begin(), reference.end(), le);
Expand Down
1 change: 0 additions & 1 deletion thrust/thrust/system/cuda/detail/adjacent_difference.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#include <thrust/type_traits/remove_cvref.h>

#include <cub/device/device_adjacent_difference.cuh>
#include <cub/device/device_select.cuh>
#include <cub/util_math.cuh>

THRUST_NAMESPACE_BEGIN
Expand Down

0 comments on commit 73cd11b

Please sign in to comment.