From f840c8ccae81a75662627b58c5bacee4637954ed Mon Sep 17 00:00:00 2001 From: yeyunpeng Date: Fri, 22 Jan 2021 18:09:23 +0800 Subject: [PATCH] fix cast multi thread --- mindspore/lite/src/ops/deconv2d.cc | 9 +++++---- mindspore/lite/src/runtime/kernel/arm/fp16/cast_fp16.h | 4 ++-- mindspore/lite/src/runtime/kernel/arm/fp32/cast_fp32.h | 4 ++-- mindspore/lite/test/models_tf.cfg | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mindspore/lite/src/ops/deconv2d.cc b/mindspore/lite/src/ops/deconv2d.cc index d6878602ed..bd1d7ff50e 100644 --- a/mindspore/lite/src/ops/deconv2d.cc +++ b/mindspore/lite/src/ops/deconv2d.cc @@ -271,10 +271,11 @@ int DeConv2D::UnPackToFlatBuilder(const schema::Primitive *primitive, flatbuffer MS_LOG(ERROR) << "value_as_DeConv2D return nullptr"; return RET_ERROR; } - auto val_offset = schema::CreateDeConv2D( - *fbb, attr->format(), attr->group(), attr->channelIn(), attr->channelOut(), attr->kernelW(), attr->kernelH(), - attr->strideW(), attr->strideH(), attr->padMode(), attr->padUp(), attr->padDown(), attr->padLeft(), - attr->padRight(), attr->dilateW(), attr->dilateH(), attr->hasBias(), attr->activationType()); + auto val_offset = + schema::CreateDeConv2D(*fbb, attr->format(), attr->group(), attr->channelIn(), attr->channelOut(), attr->kernelW(), + attr->kernelH(), attr->strideW(), attr->strideH(), attr->padMode(), attr->padUp(), + attr->padDown(), attr->padLeft(), attr->padRight(), attr->dilateW(), attr->dilateH(), + attr->hasBias(), attr->activationType(), attr->outputPaddingW(), attr->outputPaddingH()); auto prim_offset = schema::CreatePrimitive(*fbb, schema::PrimitiveType_DeConv2D, val_offset.o); fbb->Finish(prim_offset); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/cast_fp16.h b/mindspore/lite/src/runtime/kernel/arm/fp16/cast_fp16.h index 91b407c6f2..4db5d283b0 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/cast_fp16.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/cast_fp16.h @@ -38,8 +38,8 @@ class CastFp16CPUKernel : public LiteKernel { int DoCast(int thread_id); private: - uint32_t stride_; - uint32_t data_num_; + int stride_; + int data_num_; }; } // namespace mindspore::kernel diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/cast_fp32.h b/mindspore/lite/src/runtime/kernel/arm/fp32/cast_fp32.h index afcf19053d..c438d1ace8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/cast_fp32.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/cast_fp32.h @@ -39,8 +39,8 @@ class CastCPUKernel : public LiteKernel { int DoCast(int thread_id); private: - uint32_t stride_; - uint32_t data_num_; + int stride_; + int data_num_; }; } // namespace mindspore::kernel diff --git a/mindspore/lite/test/models_tf.cfg b/mindspore/lite/test/models_tf.cfg index b5377cbf6b..280135eec1 100644 --- a/mindspore/lite/test/models_tf.cfg +++ b/mindspore/lite/test/models_tf.cfg @@ -3,3 +3,4 @@ decoder_step_201217_modified.pb 5 unet_model_reconstruct.pb 1;1,256,256,3 encoder_201228.pb 3;1:1,22:1 female_model_step2_int16_noiseout.pb 66 +fasterrcnn_crop.pb 1;236,190,3 \ No newline at end of file