Skip to content

Commit 85d5cb9

Browse files
Add throw py::value_error in argsort too
Also deleted inaccurate comments.
1 parent 0cdd79e commit 85d5cb9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

dpctl/tensor/libtensor/source/sorting/argsort.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ py_argsort(const dpctl::tensor::usm_ndarray &src,
125125
"Output index array must have data type int32 or int64");
126126
}
127127

128-
// handle special case when both reduction and iteration are 1D contiguous
129128
bool is_src_c_contig = src.is_c_contiguous();
130129
bool is_dst_c_contig = dst.is_c_contiguous();
131130

@@ -150,7 +149,8 @@ py_argsort(const dpctl::tensor::usm_ndarray &src,
150149
return std::make_pair(keep_args_alive_ev, comp_ev);
151150
}
152151

153-
return std::make_pair(sycl::event(), sycl::event());
152+
throw py::value_error(
153+
"Both source and destination arrays must be C-contiguous");
154154
}
155155

156156
using dpctl::tensor::kernels::sort_contig_fn_ptr_t;

dpctl/tensor/libtensor/source/sorting/sort.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ py_sort(const dpctl::tensor::usm_ndarray &src,
123123
"the same value data type");
124124
}
125125

126-
// handle special case when both reduction and iteration are 1D contiguous
127126
bool is_src_c_contig = src.is_c_contiguous();
128127
bool is_dst_c_contig = dst.is_c_contiguous();
129128

0 commit comments

Comments
 (0)