未验证 提交 48ea76c9 编写于 作者: Y Yiqun Liu 提交者: GitHub

Fix index calculation error in ElementwiseKernel. (#43603)

上级 ec6da792
......@@ -768,7 +768,7 @@ __global__ void VectorizedElementwiseKernel(
ins, outs, data_offset, read_lens * BLOCK_NUM_X, read_lens, func);
}
int remain = numel - data_offset;
kps::IndexType remain = numel - data_offset;
if (remain > 0) {
VectorizedElementwiseKernelImpl<OutT,
Functor,
......@@ -776,7 +776,7 @@ __global__ void VectorizedElementwiseKernel(
NumOuts,
VecSize,
true>(
ins, outs, data_offset, remain, read_lens, func);
ins, outs, data_offset, static_cast<int>(remain), read_lens, func);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册