From 18fb3d72d38a53906bccc68f700bcfe0e54b3cc4 Mon Sep 17 00:00:00 2001 From: yangjie159 Date: Mon, 7 Jun 2021 14:25:58 +0800 Subject: [PATCH] fix codegen bugs --- .../coder/opcoders/nnacl/fp32/deconv2d_fp32_coder.cc | 3 +-- .../micro/coder/opcoders/nnacl/int8/add_int8_coder.cc | 4 ++-- .../coder/opcoders/nnacl/int8/concat_int8_coder.cc | 2 +- .../coder/opcoders/nnacl/int8/conv2d_1x1_int8_coder.cc | 10 +++++----- .../coder/opcoders/nnacl/int8/conv2d_3x3_int8_coder.cc | 2 +- .../coder/opcoders/nnacl/int8/conv2d_int8_coder.cc | 2 +- .../nnacl/int8/convolution_depthwise_int8_coder.cc | 3 +-- .../coder/opcoders/nnacl/int8/resize_int8_coder.cc | 2 +- 8 files changed, 13 insertions(+), 15 deletions(-) diff --git a/mindspore/lite/micro/coder/opcoders/nnacl/fp32/deconv2d_fp32_coder.cc b/mindspore/lite/micro/coder/opcoders/nnacl/fp32/deconv2d_fp32_coder.cc index aa7a807bcf5..e5f42269b14 100644 --- a/mindspore/lite/micro/coder/opcoders/nnacl/fp32/deconv2d_fp32_coder.cc +++ b/mindspore/lite/micro/coder/opcoders/nnacl/fp32/deconv2d_fp32_coder.cc @@ -186,8 +186,7 @@ int DeConvolutionFP32Coder::DoCode(CoderContext *const context) { if (!support_parallel_) { code.CodeFunction("DeConvFp32Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } else { - code.CodeFunction(kParallelLaunch, "DeConvFp32Run", kRunArgsAddr, "conv_parameter.thread_num_", kLhsScale, - kRhsScale); + code.CodeFunction(kParallelLaunch, "DeConvFp32Run", kRunArgsAddr, "conv_parameter.thread_num_"); } } context->AppendCode(code.str()); diff --git a/mindspore/lite/micro/coder/opcoders/nnacl/int8/add_int8_coder.cc b/mindspore/lite/micro/coder/opcoders/nnacl/int8/add_int8_coder.cc index f1db25025da..4e2d6f27239 100644 --- a/mindspore/lite/micro/coder/opcoders/nnacl/int8/add_int8_coder.cc +++ b/mindspore/lite/micro/coder/opcoders/nnacl/int8/add_int8_coder.cc @@ -156,9 +156,9 @@ int AddInt8Coder::DoCode(CoderContext *const context) { support_opt_add_, input0, input1, output_tensor_); if (support_parallel_) { if (arith_para_->broadcasting_) { - code.CodeFunction(kParallelLaunch, "AddBroadcastInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "AddBroadcastInt8Run", kRunArgsAddr, gThreadNum); } else { - code.CodeFunction(kParallelLaunch, "AddInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "AddInt8Run", kRunArgsAddr, gThreadNum); } } else { if (arith_para_->broadcasting_) { diff --git a/mindspore/lite/micro/coder/opcoders/nnacl/int8/concat_int8_coder.cc b/mindspore/lite/micro/coder/opcoders/nnacl/int8/concat_int8_coder.cc index 49fe528f17c..124bd0dd21d 100644 --- a/mindspore/lite/micro/coder/opcoders/nnacl/int8/concat_int8_coder.cc +++ b/mindspore/lite/micro/coder/opcoders/nnacl/int8/concat_int8_coder.cc @@ -113,7 +113,7 @@ int ConcatInt8Coder::DoCode(CoderContext *const context) { code.CodeBaseStruct("ConcatInt8Args", kRunArgs, "input_data", output_tensor_, "&concat_param", axis_, before_axis_size, count_unit_); if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "ConcatInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "ConcatInt8Run", kRunArgsAddr, gThreadNum); } else { code.CodeFunction("ConcatInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } diff --git a/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_1x1_int8_coder.cc b/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_1x1_int8_coder.cc index 0f1762460c9..8d1331b7e4b 100644 --- a/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_1x1_int8_coder.cc +++ b/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_1x1_int8_coder.cc @@ -88,7 +88,7 @@ int Conv2D1x1Int8Coder::DoCode(CoderContext *const context) { /* input transpose and input sum */ code << "if (GetSupportOptFlag()) {\n"; if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "OcOptPre", kRunArgsAddr, "args.thread_count_hw", kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "OcOptPre", kRunArgsAddr, "args.thread_count_hw"); } else { code.CodeFunction("OcOptPre", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } @@ -107,13 +107,13 @@ int Conv2D1x1Int8Coder::DoCode(CoderContext *const context) { /* matmul parallel by oc */ code << "if (GetSupportOptFlag()) {\n"; if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "RunArm64OptOc", kRunArgsAddr, "args.thread_count_oc", kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "RunArm64OptOc", kRunArgsAddr, "args.thread_count_oc"); } else { code.CodeFunction("RunArm64OptOc", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } code << "} else {\n"; if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "RunArmOc", kRunArgsAddr, "args.thread_count_oc", kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "RunArmOc", kRunArgsAddr, "args.thread_count_oc"); } else { code.CodeFunction("RunArmOc", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } @@ -122,13 +122,13 @@ int Conv2D1x1Int8Coder::DoCode(CoderContext *const context) { /* matmul parallel by hw */ code << "if (GetSupportOptFlag()) {\n"; if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "RunArm64OptHw", kRunArgsAddr, "args.thread_count_hw, kLhsScale, kRhsScale"); + code.CodeFunction(kParallelLaunch, "RunArm64OptHw", kRunArgsAddr, "args.thread_count_hw"); } else { code.CodeFunction("RunArm64OptHw", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } code << "} else {\n"; if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "RunArmHw", kRunArgsAddr, "args.thread_count_hw", kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "RunArmHw", kRunArgsAddr, "args.thread_count_hw"); } else { code.CodeFunction("RunArmHw", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } diff --git a/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_3x3_int8_coder.cc b/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_3x3_int8_coder.cc index 9921c9591f7..3fee43883f6 100644 --- a/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_3x3_int8_coder.cc +++ b/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_3x3_int8_coder.cc @@ -163,7 +163,7 @@ int Conv2D3x3Int8Coder::DoCode(CoderContext *const context) { if (thread_num_ > 1) { code.CodeBaseStruct("Conv3x3Int8Args", kRunArgs, c8_input_, transformed_filter_addr_, new_bias_addr_, output_tensor_, tile_buffer_, block_unit_buffer_, tmp_dst_buffer_, tmp_out_, "&conv_param_"); - code.CodeFunction(kParallelLaunch, "Conv3x3Int8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "Conv3x3Int8Run", kRunArgsAddr, gThreadNum); } else { code.CodeFunction("Conv3x3Int8", c8_input_, transformed_filter_addr_, new_bias_addr_, output_tensor_, tile_buffer_, block_unit_buffer_, tmp_dst_buffer_, tmp_out_, kDefaultTaskId, "&conv_param_", kLhsScale, diff --git a/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_int8_coder.cc b/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_int8_coder.cc index 6cc3e80dabd..076bbf6c492 100644 --- a/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_int8_coder.cc +++ b/mindspore/lite/micro/coder/opcoders/nnacl/int8/conv2d_int8_coder.cc @@ -237,7 +237,7 @@ int Conv2DINT8Coder::DoCode(CoderContext *const context) { } if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "ConvolutionInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "ConvolutionInt8Run", kRunArgsAddr, gThreadNum); } else { code.CodeFunction("ConvolutionInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } diff --git a/mindspore/lite/micro/coder/opcoders/nnacl/int8/convolution_depthwise_int8_coder.cc b/mindspore/lite/micro/coder/opcoders/nnacl/int8/convolution_depthwise_int8_coder.cc index 3879fa4ac90..ee7a7277f19 100644 --- a/mindspore/lite/micro/coder/opcoders/nnacl/int8/convolution_depthwise_int8_coder.cc +++ b/mindspore/lite/micro/coder/opcoders/nnacl/int8/convolution_depthwise_int8_coder.cc @@ -122,8 +122,7 @@ int ConvolutionDepthwiseINT8Coder::DoCode(CoderContext *const context) { code.CodeBaseStruct("ConvDepthwiseInt8Args", kRunArgs, output_tensor_, row_buffer_, input_tensor_, packed_weight_, bias_data_, "&conv_param"); if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "ConvDepthwiseInt8Run", kRunArgsAddr, "conv_param.thread_num_", kLhsScale, - kRhsScale); + code.CodeFunction(kParallelLaunch, "ConvDepthwiseInt8Run", kRunArgsAddr, "conv_param.thread_num_"); } else { code.CodeFunction("ConvDepthwiseInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } diff --git a/mindspore/lite/micro/coder/opcoders/nnacl/int8/resize_int8_coder.cc b/mindspore/lite/micro/coder/opcoders/nnacl/int8/resize_int8_coder.cc index 6b247526076..6957ac264c4 100644 --- a/mindspore/lite/micro/coder/opcoders/nnacl/int8/resize_int8_coder.cc +++ b/mindspore/lite/micro/coder/opcoders/nnacl/int8/resize_int8_coder.cc @@ -92,7 +92,7 @@ int ResizeInt8Coder::DoCode(CoderContext *const context) { code.CodeBaseStruct("ResizeInt8Args", kRunArgs, input_tensor_, output_tensor_, "input_shape", "output_shape", align_corners, gThreadNum); if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "ResizeInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); + code.CodeFunction(kParallelLaunch, "ResizeInt8Run", kRunArgsAddr, gThreadNum); } else { code.CodeFunction("ResizeInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); }