Skip to content

Commit 9246251

Browse files
committed
Add assertions that the destination size is the number of unsorted dims when sorting a size-1 axis
1 parent 0cf8e0f commit 9246251

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

dpctl/tensor/libtensor/source/sorting/py_argsort_common.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ py_argsort(const dpctl::tensor::usm_ndarray &src,
147147
return std::make_pair(keep_args_alive_ev, comp_ev);
148148
}
149149
else {
150+
assert(dst.get_size() == iter_nelems);
150151
int dst_elemsize = dst.get_elemsize();
151152
static constexpr int memset_val(0);
152153

dpctl/tensor/libtensor/source/sorting/py_sort_common.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ py_sort(const dpctl::tensor::usm_ndarray &src,
148148
return std::make_pair(keep_args_alive_ev, comp_ev);
149149
}
150150
else {
151+
assert(dst.get_size() == iter_nelems);
151152
int src_elemsize = src.get_elemsize();
152153

153154
sycl::event copy_ev =

0 commit comments

Comments
 (0)