Skip to content

Commit 596833e

Browse files
Fix a lapse in logic for computing upper bound of iteration
This fixes gh-1901
1 parent ee7d6fb commit 596833e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpctl/tensor/libtensor/include/kernels/accumulators.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ inclusive_scan_base_step(sycl::queue &exec_q,
281281
}
282282

283283
const nwiT m_max =
284-
std::min<nwiT>(n_wi, std::max(i, acc_nelems) - i);
284+
static_cast<nwiT>(std::min(i + n_wi, acc_nelems) - i);
285285
for (nwiT m_wi = 0; m_wi < m_max; ++m_wi) {
286286
output[out_iter_offset + out_indexer(i + m_wi)] =
287287
local_iscan[m_wi];

0 commit comments

Comments
 (0)