From 0f110d693c7fdff7b21f2d8d6d37d21658cdb9b6 Mon Sep 17 00:00:00 2001 From: Yuan Shuai Date: Sun, 15 Mar 2020 15:50:31 +0800 Subject: [PATCH] [LITE][OPENCL] Fix fc opencl (#3190) * [LITE][OPENCL] Change fp32 fc to fp16's. test=develop * fix act in conv3x3opt opencl kernel. test=develop * [LITE][OPENCL] fix opencl fc kernel. test=develop --- lite/backends/opencl/cl_kernel/buffer/fc_kernel.cl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lite/backends/opencl/cl_kernel/buffer/fc_kernel.cl b/lite/backends/opencl/cl_kernel/buffer/fc_kernel.cl index 7d9570aef7..a14748c69f 100644 --- a/lite/backends/opencl/cl_kernel/buffer/fc_kernel.cl +++ b/lite/backends/opencl/cl_kernel/buffer/fc_kernel.cl @@ -305,7 +305,8 @@ void fc_gemv_1x4(__global const CL_DTYPE* a, // store res #ifdef RELU if (col % 4 == 0) { - vstore4(fmax(c0, (CL_DTYPE4)0.f), 0, c + col); + float4 act_res = convert_float4(fmax(c0, (half4)0.f)); + vstore4(act_res, 0, c + col); } else { switch (col % 4) { case 3: -- GitLab