Skip to content

Commit

Permalink
removes unused vars & tests scan for output iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
elstehle committed Sep 1, 2023
1 parent 5667ba1 commit f060998
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 0 additions & 2 deletions cub/test/catch2_test_device_scan_by_key.cu
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ CUB_TEST("Device scan works with all device interfaces", "[by_key][scan][device]
std::get<1>(seg_size_range));

// Get array of keys from segment offsets
const offset_t num_segments = static_cast<offset_t>(segment_offsets.size() - 1);
thrust::device_vector<key_t> segment_keys(num_items);
c2h::init_key_segments(segment_offsets, segment_keys);
auto d_keys_it = thrust::raw_pointer_cast(segment_keys.data());
Expand Down Expand Up @@ -350,7 +349,6 @@ CUB_TEST("Device scan works when memory for keys and results alias one another",
std::get<1>(seg_size_range));

// Get array of keys from segment offsets
const offset_t num_segments = static_cast<offset_t>(segment_offsets.size() - 1);
thrust::device_vector<key_t> segment_keys(num_items);
c2h::init_key_segments(segment_offsets, segment_keys);
auto d_keys_it = thrust::raw_pointer_cast(segment_keys.data());
Expand Down
15 changes: 5 additions & 10 deletions cub/test/catch2_test_device_scan_by_key_iterators.cu
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ CUB_TEST("Device scan works with fancy iterators", "[by_key][scan][device]", ful
std::get<1>(seg_size_range));

// Get array of keys from segment offsets
const offset_t num_segments = static_cast<offset_t>(segment_offsets.size() - 1);
thrust::device_vector<key_t> segment_keys(num_items);
c2h::init_key_segments(segment_offsets, segment_keys);
auto d_keys_it = segment_keys.begin();
Expand All @@ -144,8 +143,7 @@ CUB_TEST("Device scan works with fancy iterators", "[by_key][scan][device]", ful

// Run test
thrust::device_vector<output_t> out_values(num_items);
auto d_values_out_it = thrust::raw_pointer_cast(out_values.data());
device_inclusive_sum_by_key(d_keys_it, values_in_it, d_values_out_it, num_items, eq_op_t{});
device_inclusive_sum_by_key(d_keys_it, values_in_it, out_values.begin(), num_items, eq_op_t{});

// Verify result
REQUIRE(expected_result == out_values);
Expand All @@ -167,8 +165,7 @@ CUB_TEST("Device scan works with fancy iterators", "[by_key][scan][device]", ful

// Run test
thrust::device_vector<output_t> out_values(num_items);
auto d_values_out_it = thrust::raw_pointer_cast(out_values.data());
device_exclusive_sum_by_key(d_keys_it, values_in_it, d_values_out_it, num_items, eq_op_t{});
device_exclusive_sum_by_key(d_keys_it, values_in_it, out_values.begin(), num_items, eq_op_t{});

// Verify result
REQUIRE(expected_result == out_values);
Expand All @@ -189,10 +186,9 @@ CUB_TEST("Device scan works with fancy iterators", "[by_key][scan][device]", ful

// Run test
thrust::device_vector<output_t> out_values(num_items);
auto d_values_out_it = thrust::raw_pointer_cast(out_values.data());
device_inclusive_scan_by_key(d_keys_it,
values_in_it,
d_values_out_it,
out_values.begin(),
op_t{},
num_items,
eq_op_t{});
Expand Down Expand Up @@ -220,11 +216,10 @@ CUB_TEST("Device scan works with fancy iterators", "[by_key][scan][device]", ful

// Run test
thrust::device_vector<output_t> out_values(num_items);
auto d_values_out_it = thrust::raw_pointer_cast(out_values.data());
using init_t = value_t;
using init_t = value_t;
device_exclusive_scan_by_key(d_keys_it,
values_in_it,
d_values_out_it,
out_values.begin(),
scan_op,
init_t{},
num_items,
Expand Down

0 comments on commit f060998

Please sign in to comment.