COMPMID-712: OCLGrind CLSoftmaxLayer quantized failures
Change-Id: I480eb8ad55b632c7d75b1a89e952e77b0ebbeda5
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/111158
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com>
diff --git a/src/core/CL/cl_kernels/softmax_layer_quantized.cl b/src/core/CL/cl_kernels/softmax_layer_quantized.cl
index 19cd983..31f402f 100644
--- a/src/core/CL/cl_kernels/softmax_layer_quantized.cl
+++ b/src/core/CL/cl_kernels/softmax_layer_quantized.cl
@@ -256,8 +256,8 @@
data = asymm_mult(shifted_scale, data);
data = asymm_rounding_divide_by_pow2(data, num_bits_over_unit + 31 - 8);
- data = select(0, max(min(data, 255), 0), data_diff >= (int16)(DIFF_MIN));
- vstore16(convert_uchar16(data), 0, (__global uchar *)offset(&dst, 0, 0));
+ data = select(0, data, data_diff >= (int16)(DIFF_MIN));
+ vstore16(convert_uchar16_sat(data), 0, (__global uchar *)offset(&dst, 0, 0));
}
#endif /* defined(DIFF_MIN) */