Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory error due to lambda return type deduction limitation #9778

Merged
merged 5 commits into from
Dec 1, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions cpp/src/sort/rank.cu
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ void rank_max(cudf::device_span<size_type const> group_keys,
stream);
}

// Returns index, count
template <typename T>
struct index_counter {
__device__ T operator()(size_type i) { return T{i, 1}; }
};

void rank_average(cudf::device_span<size_type const> group_keys,
column_view sorted_order_view,
mutable_column_view rank_mutable_view,
Expand All @@ -208,10 +214,7 @@ void rank_average(cudf::device_span<size_type const> group_keys,
using MinCount = thrust::pair<size_type, size_type>;
tie_break_ranks_transform<MinCount>(
group_keys,
cudf::detail::make_counting_transform_iterator(1,
[] __device__(auto i) {
return MinCount{i, 1};
}),
cudf::detail::make_counting_transform_iterator(1, index_counter<MinCount>{}),
karthikeyann marked this conversation as resolved.
Show resolved Hide resolved
sorted_order_view,
rank_mutable_view.begin<double>(),
[] __device__(auto rank_count1, auto rank_count2) {
Expand Down