From 875d0b5740b1fcb38cc65b1ac182224174ea77c0 Mon Sep 17 00:00:00 2001 From: yejianwu Date: Mon, 4 Dec 2017 17:26:18 +0800 Subject: [PATCH] update fmax, clamp para in relu.cl --- mace/kernels/opencl/cl/relu.cl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mace/kernels/opencl/cl/relu.cl b/mace/kernels/opencl/cl/relu.cl index 17d39165..c8ea1c09 100644 --- a/mace/kernels/opencl/cl/relu.cl +++ b/mace/kernels/opencl/cl/relu.cl @@ -10,7 +10,7 @@ __kernel void relu(__read_only image2d_t input, const int pos = ch_blk * width + w; DATA_TYPE4 in = READ_IMAGET(input, SAMPLER, (int2)(pos, hb)); - DATA_TYPE4 out = fmax(in, (DATA_TYPE4)0); + DATA_TYPE4 out = fmax(in, 0); WRITE_IMAGET(output, (int2)(pos, hb), out); } @@ -24,6 +24,6 @@ __kernel void relux(__read_only image2d_t input, const int pos = ch_blk * width + w; DATA_TYPE4 in = READ_IMAGET(input, SAMPLER, (int2)(pos, hb)); - DATA_TYPE4 out = clamp(in, (DATA_TYPE4)0, (DATA_TYPE4)max_limit); + DATA_TYPE4 out = clamp(in, 0, max_limit); WRITE_IMAGET(output, (int2)(pos, hb), out); } -- GitLab