Skip to content

Commit 4c3c23f

Browse files
Restricted use of reduce_over_axis0 special kernels
The kernel is applicable if both inputs are F-contiguous, or if the first input if F-contiguous and we are reducing to 1d C-contiguous array. Closes gh-1391
1 parent 01e6c3d commit 4c3c23f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dpctl/tensor/libtensor/source/sum_reductions.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ std::pair<sycl::event, sycl::event> py_sum_over_axis(
218218
return std::make_pair(keep_args_event, sum_over_axis_contig_ev);
219219
}
220220
}
221-
else if (is_src_f_contig & is_dst_c_contig) {
221+
else if (is_src_f_contig &&
222+
(is_dst_c_contig && dst_nd == 1 || dst.is_f_contiguous()))
223+
{
222224
auto fn = sum_over_axis0_contig_atomic_dispatch_table[src_typeid]
223225
[dst_typeid];
224226
if (fn != nullptr) {

0 commit comments

Comments
 (0)