forked from mindspore-Ecosystem/mindspore
!14357 fix static check
From: @yeyunpeng2020 Reviewed-by: @ddwsky,@ddwsky Signed-off-by: @ddwsky,@ddwsky
This commit is contained in:
commit
243358b1f4
|
@ -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 "";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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…
Reference in New Issue