diff --git a/mindspore/lite/src/runtime/kernel/opencl/cl/gather.cl b/mindspore/lite/src/runtime/kernel/opencl/cl/gather.cl index 85213e92231..d36de906ea3 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/cl/gather.cl +++ b/mindspore/lite/src/runtime/kernel/opencl/cl/gather.cl @@ -9,7 +9,7 @@ __kernel void gather(__write_only image2d_t dst_data, __read_only image2d_t src_ if (X >= dst_size.x || Y >= dst_size.y * dst_size.w || Z >= dst_size.z || dst_size.y == 0) { return; } - DTYPE4 res_data = (DTYPE4)(0.0f, 0.0f, 0.0f, 0.0f); + DTYPE4 res_data = (DTYPE4)(0, 0, 0, 0); int batch = Y / dst_size.y; int height = Y % dst_size.y; if (axis == 0) { @@ -23,7 +23,7 @@ __kernel void gather(__write_only image2d_t dst_data, __read_only image2d_t src_ DTYPE tmp[4]; DTYPE res_tmp[4]; for (int i = 0; i < indices_num; ++i) { - DTYPE4 rd_data = (DTYPE4)(0.0f, 0.0f, 0.0f, 0.0f); + DTYPE4 rd_data = (DTYPE4)(0, 0, 0, 0); rd_data = READ_IMAGE(src_data, smp_zero, (int2)(X * src_size.z + offset[i], batch * src_size.y + height)); if (i >= 1 && offset[i] != offset[i - 1]) { rd_data = READ_IMAGE(src_data, smp_zero, (int2)(X * src_size.z + offset[i], batch * src_size.y + height)); diff --git a/mindspore/lite/src/runtime/kernel/opencl/cl/int8/arithmetic.cl b/mindspore/lite/src/runtime/kernel/opencl/cl/int8/arithmetic.cl index 1abe4a9004f..5e712c9ddc7 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/cl/int8/arithmetic.cl +++ b/mindspore/lite/src/runtime/kernel/opencl/cl/int8/arithmetic.cl @@ -14,6 +14,6 @@ __kernel void ElementAddInt8(__read_only image2d_t input_a, __read_only image2d_ float4 real_a = convert_float4(a - zero_point.x) * scale.x; float4 real_b = convert_float4(b - zero_point.y) * scale.y; int4 result = convert_int4(round((real_a + real_b) / scale.z)) + zero_point.z; - result = clamp(result, (FLT)(act_min), (FLT)(act_max)); + result = clamp(result, (int)(act_min), (int)(act_max)); write_imagei(output, (int2)(X, Y), result); }