Skip to content

Commit

Permalink
Fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
ttnghia committed May 26, 2022
1 parent 28e1463 commit d3708a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp/include/cudf/detail/labeling/label_segments.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include <rmm/cuda_stream_view.hpp>
#include <rmm/exec_policy.hpp>

#include <thrust/for_each.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/scan.h>
#include <thrust/transform.h>
#include <thrust/uninitialized_fill.h>

namespace cudf::detail {
Expand Down Expand Up @@ -69,14 +69,14 @@ void label_segments(InputIterator offsets_begin,
thrust::for_each(rmm::exec_policy(stream),
thrust::make_counting_iterator(size_type{1}),
thrust::make_counting_iterator(num_segments),
[offsets, out_begin] __device__(auto const idx) {
[offsets = offsets_begin, output = out_begin] __device__(auto const idx) {
auto const dst_idx = offsets[idx] - offsets[0];

// Scatter value `1` to the index at offsets[idx].
// In case we have repeated offsets (i.e., we have empty segments), this
// atomicAdd call will make sure the label values corresponding to these empty
// segments will be skipped in the output.
atomicAdd(&out_begin[dst_idx], OutputType{1});
atomicAdd(&output[dst_idx], OutputType{1});
});
thrust::inclusive_scan(rmm::exec_policy(stream), out_begin, out_end, out_begin);
}
Expand Down

0 comments on commit d3708a5

Please sign in to comment.