From 2e1d42385cb505ba9a32290a40635718b845a715 Mon Sep 17 00:00:00 2001 From: Pengyongrong Date: Tue, 15 Sep 2020 19:34:20 -0700 Subject: [PATCH] fix warning for review boot --- mindspore/lite/src/runtime/kernel/opencl/cl/scale.cl | 2 +- mindspore/lite/src/runtime/kernel/opencl/utils.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mindspore/lite/src/runtime/kernel/opencl/cl/scale.cl b/mindspore/lite/src/runtime/kernel/opencl/cl/scale.cl index d4a8d5ec5e0..3c56ab33970 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/cl/scale.cl +++ b/mindspore/lite/src/runtime/kernel/opencl/cl/scale.cl @@ -31,7 +31,7 @@ __kernel void Scale_C_IMG(__read_only image2d_t input, __read_only image2d_t sca __write_only image2d_t output, const int2 output_shape, const int C) { int X = get_global_id(0); int Y = get_global_id(1); - if (X >= output_shape.x || Y >= output_shape.y) { + if (X >= output_shape.x || Y >= output_shape.y || C == 0) { return; } diff --git a/mindspore/lite/src/runtime/kernel/opencl/utils.h b/mindspore/lite/src/runtime/kernel/opencl/utils.h index a15a245a9f7..ad9f76c06ff 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/utils.h +++ b/mindspore/lite/src/runtime/kernel/opencl/utils.h @@ -126,7 +126,8 @@ std::vector MatrixMultiply(const T A[], const T B[], int M, int N, int K) { template void ConvertConvWeight4DTo7D(void *src, void *dst, size_t CO, size_t KH, size_t KW, size_t CI, size_t OGroup = 1, - size_t CI_TILE = 4, size_t CO_TILE = 4) { + const size_t CI_TILE = 4, const size_t CO_TILE = 4) { + if (CO_TILE == 0 || CI_TILE == 0) return; auto origin_weight = reinterpret_cast(src); auto packed_weight = reinterpret_cast(dst); auto CI_SLICES = UP_DIV(CI, CI_TILE);