Skip to content

Commit

Permalink
fix corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Jun 27, 2023
1 parent 2a1c79b commit 5e3e5f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions algorithms/src/sorting/Kokkos_SortPublicAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void sort(const Kokkos::View<DataType, Properties...>& view) {

Kokkos::fence("Kokkos::sort: before");

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

Expand All @@ -86,7 +86,7 @@ std::enable_if_t<Kokkos::is_execution_space<ExecutionSpace>::value> sort(
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 @@ -117,7 +117,7 @@ void sort(ViewType view, size_t const begin, size_t const end) {

Kokkos::fence("Kokkos::sort: before");

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

Expand Down

0 comments on commit 5e3e5f4

Please sign in to comment.