opencl: handle OOB write in noshuffle GEMV kernels (odd ne01) (#25640)
This commit is contained in:
@@ -190,6 +190,10 @@ __kernel void kernel_gemv_noshuffle_q8_0_f32(
|
||||
// 1 outputs per fiber in wave 0
|
||||
if (groupId == 0) {
|
||||
dst = (global float*)((global char*)dst + offsetd);
|
||||
dst[gid] = totalSum;
|
||||
// Guard the output row. The x-grid is padded to CEIL_DIV(M,wavesize)*wavesize,
|
||||
// so when ne01 is not a multiple of the wave size the tail work-items run past
|
||||
// row ne01 and would overrun dst into the adjacent tensor. No-op / byte-identical
|
||||
// when ne01 is wave-aligned (no padding).
|
||||
if (gid < M) dst[gid] = totalSum;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user