Browse Source

!14357 fix static check

From: @yeyunpeng2020
Reviewed-by: @ddwsky,@ddwsky
Signed-off-by: @ddwsky,@ddwsky
pull/14357/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
243358b1f4
5 changed files with 6 additions and 7 deletions
  1. +1
    -1
      mindspore/lite/examples/quick_start_cpp/main.cc
  2. +1
    -2
      mindspore/lite/examples/runtime_cpp/main.cc
  3. +2
    -2
      mindspore/lite/src/runtime/kernel/opencl/cl/strassen.cl
  4. +1
    -1
      mindspore/lite/src/runtime/kernel/opencl/kernel/conv2d.cc
  5. +1
    -1
      mindspore/lite/src/runtime/kernel/opencl/kernel/matmul.cc

+ 1
- 1
mindspore/lite/examples/quick_start_cpp/main.cc View File

@@ -25,7 +25,7 @@
#include "include/lite_session.h"

std::string RealPath(const char *path) {
size_t max = 4096;
const size_t max = 4096;
if (path == nullptr) {
std::cerr << "path is nullptr" << std::endl;
return "";


+ 1
- 2
mindspore/lite/examples/runtime_cpp/main.cc View File

@@ -27,7 +27,7 @@
#include "include/version.h"

std::string RealPath(const char *path) {
size_t max = 4096;
const size_t max = 4096;
if (path == nullptr) {
std::cerr << "path is nullptr" << std::endl;
return "";
@@ -553,7 +553,6 @@ int RunWithSharedMemoryPool(const char *model_path) {
return -1;
}
auto session1 = mindspore::session::LiteSession::CreateSession(context1.get());

if (session1 == nullptr) {
delete model;
std::cerr << "CreateSession failed while running." << std::endl;


+ 2
- 2
mindspore/lite/src/runtime/kernel/opencl/cl/strassen.cl View File

@@ -44,7 +44,7 @@ __kernel void MatMul_BUF_Add_Sub_2(__global FLT4 *input, __global FLT4 *output,
return;
}
int ci_co_4 = shape.w;
int origin_shape = 2 * ci_co_4;
const int origin_shape = 2 * ci_co_4;
int index_1 = (gidx + offset.x) * origin_shape + gidy + offset.y;
int index_2 = (gidx + offset.z) * origin_shape + gidy + offset.w;
FLT4 result1 = input[index_1];
@@ -121,7 +121,7 @@ __kernel void MatMul_BUF_Filled(__global FLT4 *input, __global FLT4 *output, int
}
int stride_out = shape.z * shape.w;
int index_out = gidx * stride_out + gidy;
int stride_origin = 2 * stride_out;
const int stride_origin = 2 * stride_out;
int index_in = (gidx + offset.x) * stride_origin + gidy + offset.y;
FLT4 result = input[index_in];
output[index_out] = result;


+ 1
- 1
mindspore/lite/src/runtime/kernel/opencl/kernel/conv2d.cc View File

@@ -500,7 +500,7 @@ kernel::LiteKernel *OpenCLConv2DCreator(const std::vector<lite::Tensor *> &input
}

// case 3: common conv2d
kernel::OpenCLKernel *kernel;
kernel::OpenCLKernel *kernel = nullptr;
bool infer_shape_done = opParameter->infer_flag_;
if (infer_shape_done && UseFcReplaceConv(inputs, outputs, conv_param)) {
auto *fc_param = CreateFcParam(conv_param, inputs);


+ 1
- 1
mindspore/lite/src/runtime/kernel/opencl/kernel/matmul.cc View File

@@ -226,7 +226,7 @@ int MatMulOpenCLKernel::Run() {
kernel::LiteKernel *OpenCLMatMulKernelCreator(const std::vector<lite::Tensor *> &inputs,
const std::vector<lite::Tensor *> &outputs, OpParameter *opParameter,
const lite::InnerContext *ctx, const kernel::KernelKey &desc) {
kernel::OpenCLKernel *kernel;
kernel::OpenCLKernel *kernel = nullptr;
bool infer_shape_done = opParameter->infer_flag_;
if (infer_shape_done && IsUseStrassenMatmul(inputs)) {
MS_LOG(DEBUG) << "use_matmul_strassen";


Loading…
Cancel
Save