opencl: fix l2_norm (llama/20480)

This commit is contained in:
lhez 2026-03-13 22:18:52 -07:00 committed by Georgi Gerganov
parent c7abcd577b
commit a31600d8e3
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ kernel void kernel_l2_norm_f32(
barrier(CLK_LOCAL_MEM_FENCE);
const float scale = 1.0f/sqrt(max(sum[0], eps));
const float scale = 1.0f/max(sqrt(sum[0]), eps);
for (int i00 = get_local_id(0); i00 < ne00; i00 += get_local_size(0)) {
y[i00] = x[i00] * scale;