Skip to content

Commit 0cdd79e

Browse files
Throw exception in py_sort if inputs are not C-contiguous
1 parent 5fc8c95 commit 0cdd79e

File tree

1 file changed

+2
-1
lines changed
  • dpctl/tensor/libtensor/source/sorting

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ py_sort(const dpctl::tensor::usm_ndarray &src,
144144
return std::make_pair(keep_args_alive_ev, comp_ev);
145145
}
146146

147-
return std::make_pair(sycl::event(), sycl::event());
147+
throw py::value_error(
148+
"Both source and destination arrays must be C-contiguous");
148149
}
149150

150151
using dpctl::tensor::kernels::sort_contig_fn_ptr_t;

0 commit comments

Comments
 (0)