Skip to content

Commit

Permalink
Merge pull request #336 from senior-zero/fix-main/github/msvc
Browse files Browse the repository at this point in the history
Fix MSVC / CUB tests build
  • Loading branch information
gevtushenko committed Aug 15, 2023
2 parents 067064e + 3023c5b commit 812ba98
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cub/test/c2h/generators.cu
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void init_key_segments(const thrust::device_vector<OffsetT> &segment_offsets,
KeyT *d_out,
std::size_t element_size)
{
OffsetT total_segments = segment_offsets.size() - 1;
OffsetT total_segments = static_cast<OffsetT>(segment_offsets.size() - 1);
const OffsetT *d_offsets = thrust::raw_pointer_cast(segment_offsets.data());

thrust::counting_iterator<int> iota(0);
Expand Down
4 changes: 3 additions & 1 deletion cub/test/catch2_test_device_reduce.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ inline void compute_host_reference(InputItT h_in,
{
auto seg_begin = h_in + h_offsets[segment];
auto seg_end = seg_begin + h_sizes_begin[segment];
h_data_out[segment] = std::accumulate(seg_begin, seg_end, init, reduction_op);
// TODO Should this be using cub accumulator t?
h_data_out[segment] = static_cast<cub::detail::value_t<ResultOutItT>>(
std::accumulate(seg_begin, seg_end, init, reduction_op));
}
}

Expand Down
2 changes: 1 addition & 1 deletion cub/test/catch2_test_device_reduce_by_key.cu
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ CUB_TEST("Device reduce-by-key works", "[by_key][reduce][device]", full_type_lis
std::get<1>(seg_size_range));

// Get array of keys from segment offsets
const offset_t num_segments = segment_offsets.size() - 1;
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
2 changes: 1 addition & 1 deletion cub/test/catch2_test_device_reduce_by_key_iterators.cu
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ CUB_TEST("Device reduce-by-key works with iterators",
std::get<1>(seg_size_range));

// Get array of keys from segment offsets
const offset_t num_segments = segment_offsets.size() - 1;
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.cbegin();
Expand Down
2 changes: 1 addition & 1 deletion cub/test/catch2_test_device_segmented_reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ CUB_TEST("Device reduce works with all device interfaces",
num_items,
std::get<0>(seg_size_range),
std::get<1>(seg_size_range));
const offset_t num_segments = segment_offsets.size() - 1;
const offset_t num_segments = static_cast<offset_t>(segment_offsets.size() - 1);
auto d_offsets_it = thrust::raw_pointer_cast(segment_offsets.data());

// Generate input data
Expand Down
2 changes: 1 addition & 1 deletion cub/test/catch2_test_device_segmented_reduce_iterators.cu
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ CUB_TEST("Device segmented reduce works with fancy input iterators",
num_items,
std::get<0>(seg_size_range),
std::get<1>(seg_size_range));
const offset_t num_segments = segment_offsets.size() - 1;
const offset_t num_segments = static_cast<offset_t>(segment_offsets.size() - 1);
auto d_offsets_it = thrust::raw_pointer_cast(segment_offsets.data());

// Prepare input data
Expand Down

0 comments on commit 812ba98

Please sign in to comment.