Browse Source

!6319 [MS][LITE][Develop] GPU ops fix warnning for divide zero

Merge pull request !6319 from pengyongrong/dongxu_fix_winograd
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
dccd231ff0
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      mindspore/lite/src/runtime/kernel/opencl/cl/scale.cl
  2. +2
    -1
      mindspore/lite/src/runtime/kernel/opencl/utils.h

+ 1
- 1
mindspore/lite/src/runtime/kernel/opencl/cl/scale.cl View File

@@ -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;
}



+ 2
- 1
mindspore/lite/src/runtime/kernel/opencl/utils.h View File

@@ -126,7 +126,8 @@ std::vector<T> MatrixMultiply(const T A[], const T B[], int M, int N, int K) {

template <typename SRC_T, typename DST_T>
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_T *>(src);
auto packed_weight = reinterpret_cast<DST_T *>(dst);
auto CI_SLICES = UP_DIV(CI, CI_TILE);


Loading…
Cancel
Save