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 has_atomic_support check in can_use_hash_groupby() #10588

Merged
merged 1 commit into from
Apr 5, 2022
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
10 changes: 7 additions & 3 deletions cpp/src/groupby/hash/groupby.cu
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,14 @@ bool can_use_hash_groupby(table_view const& keys, host_span<aggregation_request
// Currently, structs are not supported in any of hash-based aggregations.
// Therefore, if any request contains structs then we must fallback to sort-based aggregations.
// TODO: Support structs in hash-based aggregations.
auto const v_type = is_dictionary(r.values.type())
? cudf::dictionary_column_view(r.values).keys().type()
: r.values.type();

return not(r.values.type().id() == type_id::STRUCT) and
cudf::has_atomic_support(r.values.type()) and
std::all_of(r.aggregations.begin(), r.aggregations.end(), [](auto const& a) {
return is_hash_aggregation(a->kind);
std::all_of(r.aggregations.begin(), r.aggregations.end(), [v_type](auto const& a) {
return cudf::has_atomic_support(cudf::detail::target_type(v_type, a->kind)) and
is_hash_aggregation(a->kind);
});
});
}
Expand Down