Skip to content

Commit

Permalink
fix corner cases
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Jun 27, 2023
1 parent 5e3e5f4 commit 2941c91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions algorithms/src/sorting/impl/Kokkos_SortImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void sort_via_binsort(const ExecutionSpace& exec,
static_assert(ViewType::rank == 1,
"Kokkos::sort: currently only supports rank-1 Views.");

if (view.extent(0) == 0) {
if (view.extent(0) <= 1) {
return;
}

Expand Down Expand Up @@ -171,7 +171,7 @@ void sort_cudathrust(const Cuda& space,
static_assert(ViewType::rank == 1,
"Kokkos::sort: currently only supports rank-1 Views.");

if (view.extent(0) == 0) {
if (view.extent(0) <= 1) {
return;
}
const auto exec = thrust::cuda::par.on(space.cuda_stream());
Expand Down Expand Up @@ -199,7 +199,7 @@ void sort_onedpl(const Experimental::SYCL& space,
std::is_same<typename ViewType::array_layout, LayoutLeft>::value),
"SYCL sort only supports contiguous rank-1 Views.");

if (view.extent(0) == 0) {
if (view.extent(0) <= 1) {
return;
}

Expand Down

0 comments on commit 2941c91

Please sign in to comment.