Skip to content

Commit

Permalink
Fix has_atomic_support check in can_use_hash_groupby()
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrennan333 committed Apr 5, 2022
1 parent 090f6b8 commit 423c216
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit 423c216

Please sign in to comment.