Skip to content

Commit

Permalink
Use radix sort when size is large enough so that one-group sorter won…
Browse files Browse the repository at this point in the history
…t be needed
  • Loading branch information
oleksandr-pavlyk committed Dec 23, 2024
1 parent 51ead2b commit de53055
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dpctl/tensor/libtensor/source/sorting/topk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ sycl::event topk_caller(sycl::queue &exec_q,
py::ssize_t axis_inds_offset,
const std::vector<sycl::event> &depends)
{
if constexpr (use_radix_sort<argTy>::value) {
if (use_radix_sort<argTy>::value && (axis_nelems >= 16384)) {
using dpctl::tensor::kernels::topk_radix_impl;
auto ascending = !largest;
const auto ascending = !largest;
return topk_radix_impl<argTy, IndexTy>(
exec_q, iter_nelems, axis_nelems, k, ascending, arg_cp, vals_cp,
inds_cp, iter_arg_offset, iter_vals_offset, iter_inds_offset,
Expand Down

0 comments on commit de53055

Please sign in to comment.