metal : prevent int overflows [no ci]

This commit is contained in:
Georgi Gerganov 2024-11-07 22:11:24 +02:00
parent 486a5eb8c1
commit 5d1a10d275
No known key found for this signature in database
GPG Key ID: BF970631944C16B7

View File

@ -3613,7 +3613,7 @@ kernel void kernel_flash_attn_ext_vec(
const float S = ss[0];
for (short i = tiisg; i < D16; i += NW) {
dst44[(iq3*ne2*ne1 + iq2 + (iq1)*ne1)*D16 + i] = (float4x4) sr4x4[i]/S;
dst44[((int64_t)iq3*ne2*ne1 + iq2 + (iq1)*ne1)*D16 + i] = (float4x4) sr4x4[i]/S;
}
}
}