Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Fix reduce by key for non default initializable iterators #1827

Merged
Changes from all 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
5 changes: 3 additions & 2 deletions thrust/system/cuda/detail/reduce_by_key.h
Original file line number Diff line number Diff line change
Expand Up @@ -1079,12 +1079,13 @@ namespace __reduce_by_key {

size_type num_items = thrust::distance(keys_first, keys_last);

pair<KeysOutputIt, ValuesOutputIt> result = thrust::make_pair(keys_output, values_output);

gevtushenko marked this conversation as resolved.
Show resolved Hide resolved
if (num_items == 0)
{
return thrust::make_pair(keys_output, values_output);
return result;
}

pair<KeysOutputIt, ValuesOutputIt> result{};
THRUST_INDEX_TYPE_DISPATCH(result,
reduce_by_key_dispatch,
num_items,
Expand Down