From a1062ab9428115c0e7d5ca0b07730c61adab8299 Mon Sep 17 00:00:00 2001 From: yangjie159 Date: Fri, 4 Jun 2021 21:12:38 +0800 Subject: [PATCH] feature, ThreadPool support unequal Task --- .../kernel_compiler/cpu/nnacl/op_base.h | 1 + .../core/mindrt/src/thread/core_affinity.cc | 4 +- .../core/mindrt/src/thread/core_affinity.h | 4 +- .../mindrt/src/thread/inter_threadpool.cc | 23 ++-- .../core/mindrt/src/thread/inter_threadpool.h | 1 - mindspore/core/mindrt/src/thread/threadlog.h | 48 ++++++++ .../core/mindrt/src/thread/threadpool.cc | 107 +++++++++++++----- mindspore/core/mindrt/src/thread/threadpool.h | 54 ++++----- .../component/const_blocks/thread_pool.cc | 2 +- .../nnacl/fp32/deconv2d_fp32_coder.cc | 5 +- .../opcoders/nnacl/int8/add_int8_coder.cc | 8 +- .../opcoders/nnacl/int8/concat_int8_coder.cc | 4 +- .../nnacl/int8/conv2d_1x1_int8_coder.cc | 20 ++-- .../nnacl/int8/conv2d_3x3_int8_coder.cc | 5 +- .../opcoders/nnacl/int8/conv2d_int8_coder.cc | 4 +- .../int8/convolution_depthwise_int8_coder.cc | 5 +- .../opcoders/nnacl/int8/resize_int8_coder.cc | 4 +- .../lite/micro/coder/opcoders/parallel.h | 2 + .../wrapper/fp32/deconvolution_fp32_wrapper.c | 2 +- .../wrapper/fp32/deconvolution_fp32_wrapper.h | 2 +- .../coder/wrapper/int8/add_int8_wrapper.c | 4 +- .../coder/wrapper/int8/add_int8_wrapper.h | 4 +- .../wrapper/int8/batchnorm_int8_wrapper.c | 2 +- .../wrapper/int8/batchnorm_int8_wrapper.h | 2 +- .../coder/wrapper/int8/concat_int8_wrapper.c | 2 +- .../coder/wrapper/int8/concat_int8_wrapper.h | 2 +- .../wrapper/int8/conv1x1_run_int8_wrapper.c | 10 +- .../wrapper/int8/conv1x1_run_int8_wrapper.h | 10 +- .../wrapper/int8/conv3x3_run_int8_wrapper.c | 2 +- .../wrapper/int8/conv3x3_run_int8_wrapper.h | 2 +- .../int8/convolution_depthwise_int8_wrapper.c | 2 +- .../int8/convolution_depthwise_int8_wrapper.h | 2 +- .../wrapper/int8/convolution_int8_wrapper.c | 2 +- .../wrapper/int8/convolution_int8_wrapper.h | 2 +- .../coder/wrapper/int8/resize_int8_wrapper.c | 2 +- .../coder/wrapper/int8/resize_int8_wrapper.h | 2 +- .../coder/wrapper/int8/slice_int8_wrapper.c | 2 +- .../coder/wrapper/int8/slice_int8_wrapper.h | 2 +- .../coder/wrapper/thread/thread_wrapper.cc | 2 +- .../kernel/arm/base/constant_of_shape.cc | 2 +- .../arm/base/detection_post_process_base.cc | 2 +- .../src/runtime/kernel/arm/base/prior_box.cc | 2 +- .../kernel/arm/base/quant_dtype_cast.cc | 2 +- .../runtime/kernel/arm/base/reshape_base.cc | 2 +- .../src/runtime/kernel/arm/base/slice_base.cc | 2 +- .../src/runtime/kernel/arm/base/split_base.cc | 2 +- .../arm/base/split_with_over_lap_base.cc | 2 +- .../src/runtime/kernel/arm/base/stack_base.cc | 2 +- .../runtime/kernel/arm/base/strided_slice.cc | 2 +- .../src/runtime/kernel/arm/base/tile_base.cc | 2 +- .../kernel/arm/fp16/activation_fp16.cc | 2 +- .../arm/fp16/arithmetic_compare_fp16.cc | 2 +- .../src/runtime/kernel/arm/fp16/cast_fp16.cc | 2 +- .../kernel/arm/fp16/convolution_1x1_fp16.cc | 4 +- .../arm/fp16/convolution_depthwise_fp16.cc | 2 +- .../convolution_depthwise_slidewindow_fp16.cc | 2 +- .../kernel/arm/fp16/convolution_fp16.cc | 2 +- .../arm/fp16/convolution_winograd_fp16.cc | 2 +- .../src/runtime/kernel/arm/fp16/crop_fp16.cc | 2 +- .../arm/fp16/deconvolution_depthwise_fp16.cc | 2 +- .../kernel/arm/fp16/deconvolution_fp16.cc | 2 +- .../arm/fp16/deconvolution_winograd_fp16.cc | 4 +- .../runtime/kernel/arm/fp16/gather_fp16.cc | 2 +- .../kernel/arm/fp16/instance_norm_fp16.cc | 2 +- .../kernel/arm/fp16/layer_norm_fp16.cc | 2 +- .../kernel/arm/fp16/log_softmax_fp16.cc | 2 +- .../kernel/arm/fp16/matmul_base_fp16.cc | 2 +- .../runtime/kernel/arm/fp16/pooling_fp16.cc | 2 +- .../src/runtime/kernel/arm/fp16/power_fp16.cc | 2 +- .../kernel/arm/fp16/quant_dtype_cast_fp16.cc | 2 +- .../runtime/kernel/arm/fp16/reduce_fp16.cc | 2 +- .../src/runtime/kernel/arm/fp16/scale_fp16.cc | 2 +- .../src/runtime/kernel/arm/fp16/slice_fp16.cc | 2 +- .../runtime/kernel/arm/fp16/softmax_fp16.cc | 2 +- .../src/runtime/kernel/arm/fp16/stack_fp16.cc | 2 +- .../arm/fp16_grad/activation_fp16_grad.cc | 2 +- .../fp16_grad/arithmetic_fp16_self_grad.cc | 2 +- .../kernel/arm/fp32/activation_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/adder_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/addn_fp32.cc | 6 +- .../src/runtime/kernel/arm/fp32/addn_fp32.h | 2 +- .../kernel/arm/fp32/arithmetic_compare_fp32.h | 2 +- .../kernel/arm/fp32/arithmetic_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/arithmetic_fp32.h | 2 +- .../kernel/arm/fp32/arithmetic_self_fp32.cc | 2 +- .../kernel/arm/fp32/arithmetic_self_fp32.h | 2 +- .../runtime/kernel/arm/fp32/batchnorm_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/batchnorm_fp32.h | 2 +- .../src/runtime/kernel/arm/fp32/cast_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/concat_fp32.cc | 2 +- .../kernel/arm/fp32/convolution_1x1_fp32.cc | 4 +- .../fp32/convolution_depthwise_3x3_fp32.cc | 2 +- .../arm/fp32/convolution_depthwise_fp32.cc | 2 +- .../convolution_depthwise_indirect_fp32.cc | 2 +- .../convolution_depthwise_slidewindow_fp32.cc | 2 +- ...volution_depthwise_slidewindow_x86_fp32.cc | 2 +- .../kernel/arm/fp32/convolution_fp32.cc | 2 +- .../arm/fp32/convolution_slidewindow_fp32.cc | 2 +- .../arm/fp32/convolution_winograd_fp32.cc | 2 +- .../kernel/arm/fp32/crop_and_resize_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/crop_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/cumsum_fp32.cc | 2 +- .../arm/fp32/deconvolution_depthwise_fp32.cc | 2 +- .../kernel/arm/fp32/deconvolution_fp32.cc | 2 +- .../arm/fp32/deconvolution_winograd_fp32.cc | 4 +- .../src/runtime/kernel/arm/fp32/elu_fp32.cc | 2 +- .../kernel/arm/fp32/embedding_lookup_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/exp_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/fill_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/gatherNd_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/gather_fp32.cc | 2 +- .../kernel/arm/fp32/instance_norm_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/l2_norm_fp32.cc | 6 +- .../kernel/arm/fp32/layer_norm_fp32.cc | 2 +- .../arm/fp32/local_response_norm_fp32.cc | 2 +- .../kernel/arm/fp32/log_softmax_fp32.cc | 2 +- .../kernel/arm/fp32/lsh_projection_fp32.cc | 2 +- .../kernel/arm/fp32/matmul_fp32_base.cc | 2 +- .../runtime/kernel/arm/fp32/one_hot_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/pad_fp32.cc | 4 +- .../src/runtime/kernel/arm/fp32/pad_fp32.h | 4 +- .../runtime/kernel/arm/fp32/pooling_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/power_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/prelu_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/reduce_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/resize_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/reverse_fp32.cc | 2 +- .../kernel/arm/fp32/roi_pooling_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/scale_fp32.cc | 2 +- .../kernel/arm/fp32/scatter_nd_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/softmax_fp32.cc | 2 +- .../kernel/arm/fp32/space_to_batch_fp32.cc | 2 +- .../kernel/arm/fp32/space_to_depth_fp32.cc | 2 +- .../kernel/arm/fp32/sparse_to_dense_fp32.cc | 2 +- .../runtime/kernel/arm/fp32/transpose_fp32.cc | 2 +- .../src/runtime/kernel/arm/fp32/where_fp32.cc | 2 +- .../kernel/arm/fp32_grad/activation_grad.cc | 2 +- .../src/runtime/kernel/arm/fp32_grad/adam.cc | 2 +- .../kernel/arm/fp32_grad/apply_momentum.cc | 2 +- .../kernel/arm/fp32_grad/arithmetic_grad.cc | 2 +- .../arm/fp32_grad/arithmetic_self_grad.cc | 2 +- .../runtime/kernel/arm/fp32_grad/assign.cc | 2 +- .../runtime/kernel/arm/fp32_grad/bias_grad.cc | 2 +- .../runtime/kernel/arm/fp32_grad/bn_grad.cc | 2 +- .../kernel/arm/fp32_grad/convolution.cc | 2 +- .../arm/fp32_grad/convolution_grad_filter.cc | 2 +- .../arm/fp32_grad/convolution_grad_input.cc | 2 +- .../fp32_grad/deconvolution_grad_filter.cc | 2 +- .../runtime/kernel/arm/fp32_grad/dropout.cc | 2 +- .../kernel/arm/fp32_grad/dropout_grad.cc | 2 +- .../kernel/arm/fp32_grad/layernorm_grad.cc | 2 +- .../runtime/kernel/arm/fp32_grad/neg_grad.cc | 2 +- .../kernel/arm/fp32_grad/pooling_grad.cc | 2 +- .../kernel/arm/fp32_grad/power_grad.cc | 2 +- .../kernel/arm/fp32_grad/resize_grad.cc | 2 +- .../src/runtime/kernel/arm/fp32_grad/sgd.cc | 4 +- .../sigmoid_cross_entropy_with_logits.cc | 2 +- .../sigmoid_cross_entropy_with_logits_grad.cc | 2 +- .../kernel/arm/fp32_grad/smooth_l1_loss.cc | 2 +- .../arm/fp32_grad/smooth_l1_loss_grad.cc | 2 +- .../softmax_cross_entropy_with_logits.cc | 2 +- .../kernel/arm/fp32_grad/softmax_grad.cc | 2 +- ...parse_softmax_cross_entropy_with_logits.cc | 2 +- .../arm/fp32_grad/strided_slice_grad.cc | 2 +- .../arm/fp32_grad/unsorted_segment_sum.cc | 2 +- .../src/runtime/kernel/arm/int8/add_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/add_int8.h | 2 +- .../kernel/arm/int8/arithmetic_int8.cc | 2 +- .../kernel/arm/int8/arithmetic_self_int8.cc | 2 +- .../runtime/kernel/arm/int8/batchnorm_int8.cc | 2 +- .../runtime/kernel/arm/int8/concat_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/concat_int8.h | 2 +- .../kernel/arm/int8/convolution_1x1_int8.cc | 6 +- .../kernel/arm/int8/convolution_3x3_int8.cc | 2 +- .../int8/convolution_depthwise_3x3_int8.cc | 2 +- .../arm/int8/convolution_depthwise_int8.cc | 2 +- .../convolution_depthwise_slidewindow_int8.cc | 2 +- .../kernel/arm/int8/convolution_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/crop_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/crop_int8.h | 2 +- .../arm/int8/deconvolution_depthwise_int8.cc | 2 +- .../kernel/arm/int8/deconvolution_int8.cc | 2 +- .../arm/int8/detection_post_process_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/div_int8.cc | 2 +- .../runtime/kernel/arm/int8/gatherNd_int8.cc | 2 +- .../runtime/kernel/arm/int8/gather_int8.cc | 2 +- .../runtime/kernel/arm/int8/hswish_int8.cc | 2 +- .../runtime/kernel/arm/int8/l2_norm_int8.cc | 2 +- .../kernel/arm/int8/layer_norm_int8.cc | 2 +- .../kernel/arm/int8/leaky_relu_int8.cc | 2 +- .../kernel/arm/int8/matmul_base_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/mul_int8.cc | 4 +- .../src/runtime/kernel/arm/int8/mul_int8.h | 4 +- .../src/runtime/kernel/arm/int8/pad_int8.cc | 4 +- .../runtime/kernel/arm/int8/pooling_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/power_int8.cc | 2 +- .../runtime/kernel/arm/int8/reduce_int8.cc | 4 +- .../src/runtime/kernel/arm/int8/relux_int8.cc | 2 +- .../runtime/kernel/arm/int8/reshape_int8.cc | 2 +- .../runtime/kernel/arm/int8/reshape_int8.h | 2 +- .../runtime/kernel/arm/int8/resize_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/scale_int8.cc | 2 +- .../runtime/kernel/arm/int8/sigmoid_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/slice_int8.cc | 2 +- .../runtime/kernel/arm/int8/softmax_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/split_int8.cc | 2 +- .../runtime/kernel/arm/int8/squeeze_int8.cc | 2 +- .../runtime/kernel/arm/int8/squeeze_int8.h | 2 +- .../src/runtime/kernel/arm/int8/sub_int8.cc | 2 +- .../src/runtime/kernel/arm/int8/tanh_int8.cc | 2 +- .../runtime/kernel/arm/int8/transpose_int8.cc | 2 +- .../runtime/kernel/arm/int8/unsqueeze_int8.cc | 2 +- .../lite/src/runtime/parallel_executor.cc | 2 +- 213 files changed, 421 insertions(+), 324 deletions(-) create mode 100644 mindspore/core/mindrt/src/thread/threadlog.h diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/op_base.h b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/op_base.h index ec0e7b52abd..e7fb3eabeeb 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/op_base.h +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/op_base.h @@ -35,6 +35,7 @@ #define MSMIN(x, y) ((x) < (y) ? (x) : (y)) #define MSMAX(x, y) ((x) > (y) ? (x) : (y)) +#define MSCEIL(x) (int)((x) + (((x) - (int)(x)) > 0 ? 1 : 0)) #define UP_DIV(x, y) (((x) + (y) - (1)) / (y)) #define UP_ROUND(x, y) (((x) + (y) - (1)) / (y) * (y)) diff --git a/mindspore/core/mindrt/src/thread/core_affinity.cc b/mindspore/core/mindrt/src/thread/core_affinity.cc index f10ad411f8c..4f02eea1511 100644 --- a/mindspore/core/mindrt/src/thread/core_affinity.cc +++ b/mindspore/core/mindrt/src/thread/core_affinity.cc @@ -27,7 +27,6 @@ #include "thread/threadpool.h" namespace mindspore { - #define MAX_PATH_SIZE (256) enum Arch { @@ -215,8 +214,10 @@ int CoreAffinity::InitHardwareCoreInfo() { core_num_ = std::thread::hardware_concurrency(); std::vector freq_set; freq_set.resize(core_num_); + core_freq_.resize(core_num_); for (size_t i = 0; i < core_num_; ++i) { int max_freq = GetMaxFrequency(i); + core_freq_[i] = max_freq; freq_set[i].core_id = i; freq_set[i].max_freq = max_freq; freq_set[i].arch = UnKnown_Arch; @@ -329,6 +330,7 @@ int CoreAffinity::BindThreadsToCoreList(const std::vector &workers) co return THREAD_ERROR; } THREAD_INFO("set thread[%zu] affinity to core[%d] success", i, bind_id_[i % window]); + workers[i]->frequency = core_freq_[bind_id_[i]]; } #endif // BIND_CORE return THREAD_OK; diff --git a/mindspore/core/mindrt/src/thread/core_affinity.h b/mindspore/core/mindrt/src/thread/core_affinity.h index dbf5d633334..0c32719a1e7 100644 --- a/mindspore/core/mindrt/src/thread/core_affinity.h +++ b/mindspore/core/mindrt/src/thread/core_affinity.h @@ -26,7 +26,6 @@ #endif namespace mindspore { - enum BindMode { Power_NoBind = 0, // free schedule Power_Higher = 1, @@ -61,6 +60,9 @@ class CoreAffinity { // sorted_id contains the ordered CPU core id // the size of sorted_id is equal to the size of hardware_concurrency std::vector sorted_id_; + // used to store the frequency of core + // the core id corresponds to the index + std::vector core_freq_; size_t core_num_{0}; size_t higher_num_{0}; }; diff --git a/mindspore/core/mindrt/src/thread/inter_threadpool.cc b/mindspore/core/mindrt/src/thread/inter_threadpool.cc index 9b5b14ac994..b1928e6eeb6 100644 --- a/mindspore/core/mindrt/src/thread/inter_threadpool.cc +++ b/mindspore/core/mindrt/src/thread/inter_threadpool.cc @@ -18,7 +18,6 @@ #include "thread/core_affinity.h" namespace mindspore { - InterThreadPool::~InterThreadPool() { { THREAD_INFO("wait util actor queue is empty"); @@ -31,6 +30,17 @@ InterThreadPool::~InterThreadPool() { DestructThreads(); } +void InterThreadPool::ThreadAsyncRun(Worker *worker) { + THREAD_RETURN_IF_NULL(worker); + while (alive_) { + if (worker->type == kKernelThread) { + KernelThreadRun(worker); + } else if (worker->type == kActorThread) { + ActorThreadRun(); + } + } +} + void InterThreadPool::ActorThreadRun() { ActorReference actor; { @@ -46,17 +56,6 @@ void InterThreadPool::ActorThreadRun() { finish_cond_var_.notify_one(); } -void InterThreadPool::ThreadAsyncRun(Worker *worker) { - THREAD_RETURN_IF_NULL(worker); - while (alive_) { - if (worker->type == kKernelThread) { - KernelThreadRun(worker); - } else if (worker->type == kActorThread) { - ActorThreadRun(); - } - } -} - void InterThreadPool::EnqueReadyActor(const ActorReference &actor) { { std::lock_guard _l(actor_mutex_); diff --git a/mindspore/core/mindrt/src/thread/inter_threadpool.h b/mindspore/core/mindrt/src/thread/inter_threadpool.h index e172861fda0..abc9743d23f 100644 --- a/mindspore/core/mindrt/src/thread/inter_threadpool.h +++ b/mindspore/core/mindrt/src/thread/inter_threadpool.h @@ -25,7 +25,6 @@ #include "actor/actor.h" namespace mindspore { - class InterThreadPool : public ThreadPool { public: // create ThreadPool that contains inter thread and intra thread diff --git a/mindspore/core/mindrt/src/thread/threadlog.h b/mindspore/core/mindrt/src/thread/threadlog.h new file mode 100644 index 00000000000..434860bcd64 --- /dev/null +++ b/mindspore/core/mindrt/src/thread/threadlog.h @@ -0,0 +1,48 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MINDSPORE_CORE_MINDRT_RUNTIME_THREADPOOL_LOG_H_ +#define MINDSPORE_CORE_MINDRT_RUNTIME_THREADPOOL_LOG_H_ + +namespace mindspore { +#ifdef THREAD_POOL_DEBUG +#include +#define THREAD_INFO(content, args...) \ + { printf("[INFO] %s|%d: " #content "\r\n", __func__, __LINE__, ##args); } +#define THREAD_ERROR(content, args...) \ + { printf("[ERROR] %s|%d: " #content "\r\n", __func__, __LINE__, ##args); } +#else +#define THREAD_INFO(content, args...) +#define THREAD_ERROR(content, args...) +#endif + +#define THREAD_ERROR_IF_NULL(ptr) \ + do { \ + if ((ptr) == nullptr) { \ + return THREAD_ERROR; \ + } \ + } while (0) + +#define THREAD_RETURN_IF_NULL(ptr) \ + do { \ + if ((ptr) == nullptr) { \ + return; \ + } \ + } while (0) + +enum ThreadRet { THREAD_OK = 0, THREAD_ERROR = 1 }; +} // namespace mindspore +#endif // MINDSPORE_CORE_MINDRT_RUNTIME_THREADPOOL_LOG_H_ diff --git a/mindspore/core/mindrt/src/thread/threadpool.cc b/mindspore/core/mindrt/src/thread/threadpool.cc index f69ebafada5..b8556e9c7a3 100644 --- a/mindspore/core/mindrt/src/thread/threadpool.cc +++ b/mindspore/core/mindrt/src/thread/threadpool.cc @@ -19,9 +19,10 @@ #include "thread/core_affinity.h" namespace mindspore { - constexpr int kDefaultSpinCount = 300000; +float PartialScale(int partial, int total) { return (partial * 10.0 / total) / 10.0; } + ThreadPool::~ThreadPool() { alive_.store(false); DestructThreads(); @@ -37,10 +38,8 @@ void ThreadPool::DestructThreads() { worker = nullptr; } workers_.clear(); - if (affinity_ != nullptr) { - delete affinity_; - affinity_ = nullptr; - } + delete affinity_; + affinity_ = nullptr; THREAD_INFO("deconstruct threads success"); } @@ -65,11 +64,18 @@ int ThreadPool::CreateThreads(size_t thread_num) { return THREAD_OK; } +void ThreadPool::ThreadAsyncRun(Worker *worker) { + THREAD_RETURN_IF_NULL(worker); + while (alive_) { + KernelThreadRun(worker); + } +} + void ThreadPool::KernelThreadRun(Worker *worker) { if (worker->active) { Task *task = worker->task; THREAD_RETURN_IF_NULL(task); - task->status |= task->func(task->content, ++task->task_id); + task->status |= task->func(task->content, worker->task_id, worker->lhs_scale, worker->rhs_scale); { std::lock_guard _l(worker->mutex); worker->task = nullptr; @@ -91,21 +97,18 @@ void ThreadPool::KernelThreadRun(Worker *worker) { } } -void ThreadPool::ThreadAsyncRun(Worker *worker) { - THREAD_RETURN_IF_NULL(worker); - while (alive_) { - KernelThreadRun(worker); - } -} - -int ThreadPool::ParallelLaunch(const Func &func, Contend contend, int task_num) { +int ThreadPool::ParallelLaunch(const Func &func, Content content, int task_num) { // distribute task to the KernelThread and the free ActorThread, // if the task num is greater than the KernelThread num - Task task = Task(func, contend); - DistributeTask(&task, task_num); - - task.status |= task.func(task.content, 0); - ++task.finished; + Task task = Task(func, content); + Worker *curr = CurrentWorker(); + if (inter_thread_num_ == thread_num_ || curr == nullptr) { + SyncRunTask(&task, task_num); + } else { + DistributeTask(&task, task_num); + task.status |= task.func(task.content, 0, curr->lhs_scale, curr->rhs_scale); + ++task.finished; + } // synchronization // wait until the finished is equal to task_num while (task.finished != task_num) { @@ -118,10 +121,28 @@ int ThreadPool::ParallelLaunch(const Func &func, Contend contend, int task_num) return THREAD_OK; } +void ThreadPool::SyncRunTask(Task *task, int task_num) const { + float per_scale = kMaxScale / task_num; + for (int i = 0; i < task_num; ++i) { + float lhs_scale = i * per_scale; + float rhs_scale = (i + 1) * per_scale; + rhs_scale = i == task_num - 1 ? kMaxScale : rhs_scale; + task->status |= task->func(task->content, i, lhs_scale, rhs_scale); + ++task->finished; + } +} + void ThreadPool::DistributeTask(Task *task, int task_num) { - int count = 0; + int count = 1; + int sum_frequency = 0; + std::vector assigned; + Worker *curr = CurrentWorker(); + THREAD_RETURN_IF_NULL(curr); + assigned.push_back(curr); + sum_frequency += curr->frequency; + Worker *worker; - while (count < task_num - 1) { + while (count < task_num) { { std::lock_guard _l(pool_mutex_); if (freelist_.empty()) { @@ -130,14 +151,46 @@ void ThreadPool::DistributeTask(Task *task, int task_num) { worker = freelist_.back(); freelist_.pop_back(); } - { - std::lock_guard _l(worker->mutex); - worker->task = task; - worker->active = true; - } - worker->cond_var.notify_one(); + assigned.push_back(worker); + sum_frequency += worker->frequency; count++; } + + CalculateScales(assigned, sum_frequency); + ActiveWorkers(assigned, task, task_num); +} + +void ThreadPool::CalculateScales(const std::vector &assigned, int sum_frequency) const { + // Divide task according to computing power(core frequency) + float start = 0.; + for (const auto &worker : assigned) { + THREAD_RETURN_IF_NULL(worker); + worker->lhs_scale = start; + start += PartialScale(worker->frequency, sum_frequency); + start = start < 1 ? start : 1; + worker->rhs_scale = start; + } +} + +void ThreadPool::ActiveWorkers(const std::vector &workers, Task *task, int task_num) const { + for (int i = 1; i < task_num; ++i) { + Worker *worker = workers[i]; + THREAD_RETURN_IF_NULL(worker); + std::lock_guard _l(worker->mutex); + worker->task = task; + worker->task_id = i; + worker->active = true; + worker->cond_var.notify_one(); + } +} + +Worker *ThreadPool::CurrentWorker() const { + for (const auto &worker : workers_) { + if (worker->thread.get_id() == std::this_thread::get_id()) { + return worker; + } + } + return nullptr; } int ThreadPool::InitAffinityInfo() { diff --git a/mindspore/core/mindrt/src/thread/threadpool.h b/mindspore/core/mindrt/src/thread/threadpool.h index af3398deef4..ab70c0c3835 100644 --- a/mindspore/core/mindrt/src/thread/threadpool.h +++ b/mindspore/core/mindrt/src/thread/threadpool.h @@ -24,46 +24,24 @@ #include #include #include +#include "thread/threadlog.h" #include "thread/core_affinity.h" namespace mindspore { +constexpr int kDefaultFrequency = 1; +constexpr float kMaxScale = 1.; -#ifdef THREAD_POOL_DEBUG -#include -#define THREAD_INFO(content, args...) \ - { printf("[INFO] %s|%d: " #content "\r\n", __func__, __LINE__, ##args); } -#define THREAD_ERROR(content, args...) \ - { printf("[ERROR] %s|%d: " #content "\r\n", __func__, __LINE__, ##args); } -#else -#define THREAD_INFO(content, ...) -#define THREAD_ERROR(content, ...) -#endif - -#define THREAD_ERROR_IF_NULL(ptr) \ - do { \ - if ((ptr) == nullptr) { \ - return THREAD_ERROR; \ - } \ - } while (0) - -#define THREAD_RETURN_IF_NULL(ptr) \ - do { \ - if ((ptr) == nullptr) { \ - return; \ - } \ - } while (0) - -enum ThreadRet { THREAD_OK = 0, THREAD_ERROR = 1 }; enum ThreadType { kActorThread = 0, kKernelThread = 1 }; -using Func = int (*)(void *arg, int); -using Contend = void *; +// used in scenarios with unequal division of task +// the parameters indicate the start and end coefficients +using Func = int (*)(void *, int, float, float); +using Content = void *; typedef struct Task { - Task(Func f, Contend c) : func(f), content(c) {} + Task(Func f, Content c) : func(f), content(c) {} Func func; - Contend content; - std::atomic_int task_id{0}; + Content content; std::atomic_int finished{0}; std::atomic_int status{THREAD_OK}; // return status, RET_OK } Task; @@ -72,9 +50,13 @@ typedef struct Worker { std::thread thread; std::atomic_int type{kActorThread}; std::atomic_bool active{false}; - Task *task{nullptr}; std::mutex mutex; std::condition_variable cond_var; + Task *task{nullptr}; + int task_id{0}; + float lhs_scale{0.}; + float rhs_scale{kMaxScale}; + int frequency{kDefaultFrequency}; int spin{0}; } Worker; @@ -90,7 +72,7 @@ class ThreadPool { int SetProcessAffinity(BindMode bind_mode) const; - int ParallelLaunch(const Func &func, Contend contend, int task_num); + int ParallelLaunch(const Func &func, Content content, int task_num); protected: ThreadPool() = default; @@ -103,7 +85,13 @@ class ThreadPool { virtual void ThreadAsyncRun(Worker *worker); void KernelThreadRun(Worker *worker); + void SyncRunTask(Task *task, int task_num) const; + void DistributeTask(Task *task, int task_num); + void CalculateScales(const std::vector &workers, int sum_frequency) const; + void ActiveWorkers(const std::vector &workers, Task *task, int task_num) const; + + Worker *CurrentWorker() const; std::mutex pool_mutex_; diff --git a/mindspore/lite/micro/coder/generator/component/const_blocks/thread_pool.cc b/mindspore/lite/micro/coder/generator/component/const_blocks/thread_pool.cc index 90242f1d3b0..3d0c8b42ca1 100644 --- a/mindspore/lite/micro/coder/generator/component/const_blocks/thread_pool.cc +++ b/mindspore/lite/micro/coder/generator/component/const_blocks/thread_pool.cc @@ -47,7 +47,7 @@ int SetCoreAffinity(int bind_mode); int GetCurrentThreadNum(); -int ParallelLaunch(int (*func)(void *, int), void *content, int task_num); +int ParallelLaunch(int (*func)(void *, int, float, float), void *content, int task_num); void ClearThreadPool(); 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 a71f995400e..aa7a807bcf5 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 @@ -184,9 +184,10 @@ int DeConvolutionFP32Coder::DoCode(CoderContext *const context) { code.CodeBaseStruct("DeConvFp32Args", kRunArgs, packed_input_, packed_weight_, packed_bias_, packed_output_, output_ptr_, tmp_buffer_, "&matmul_parameter", "&conv_parameter"); if (!support_parallel_) { - code.CodeFunction("DeConvFp32Run", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("DeConvFp32Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } else { - code.CodeFunction(kParallelLaunch, "DeConvFp32Run", kRunArgsAddr, "conv_parameter.thread_num_"); + code.CodeFunction(kParallelLaunch, "DeConvFp32Run", kRunArgsAddr, "conv_parameter.thread_num_", kLhsScale, + kRhsScale); } } 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 f77ec07180c..f1db25025da 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,15 +156,15 @@ 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); + code.CodeFunction(kParallelLaunch, "AddBroadcastInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); } else { - code.CodeFunction(kParallelLaunch, "AddInt8Run", kRunArgsAddr, gThreadNum); + code.CodeFunction(kParallelLaunch, "AddInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); } } else { if (arith_para_->broadcasting_) { - code.CodeFunction("AddBroadcastInt8Run", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("AddBroadcastInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } else { - code.CodeFunction("AddInt8Run", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("AddInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } } context->AppendCode(code.str()); 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 52676698f10..49fe528f17c 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,9 +113,9 @@ 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); + code.CodeFunction(kParallelLaunch, "ConcatInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); } else { - code.CodeFunction("ConcatInt8Run", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("ConcatInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } context->AppendCode(code.str()); return RET_OK; 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 0db650a28c3..0f1762460c9 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,9 +88,9 @@ 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"); + code.CodeFunction(kParallelLaunch, "OcOptPre", kRunArgsAddr, "args.thread_count_hw", kLhsScale, kRhsScale); } else { - code.CodeFunction("OcOptPre", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("OcOptPre", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } code << "} else {\n"; code << "RowMajor2Row16x4MajorInt8(args.input_ptr_, args.packed_input_, args.matmul_param_->row_, " @@ -107,30 +107,30 @@ 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"); + code.CodeFunction(kParallelLaunch, "RunArm64OptOc", kRunArgsAddr, "args.thread_count_oc", kLhsScale, kRhsScale); } else { - code.CodeFunction("RunArm64OptOc", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("RunArm64OptOc", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } code << "} else {\n"; if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "RunArmOc", kRunArgsAddr, "args.thread_count_oc"); + code.CodeFunction(kParallelLaunch, "RunArmOc", kRunArgsAddr, "args.thread_count_oc", kLhsScale, kRhsScale); } else { - code.CodeFunction("RunArmOc", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("RunArmOc", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } code << "}\n"; code << "} else {\n"; /* matmul parallel by hw */ code << "if (GetSupportOptFlag()) {\n"; if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "RunArm64OptHw", kRunArgsAddr, "args.thread_count_hw"); + code.CodeFunction(kParallelLaunch, "RunArm64OptHw", kRunArgsAddr, "args.thread_count_hw, kLhsScale, kRhsScale"); } else { - code.CodeFunction("RunArm64OptHw", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("RunArm64OptHw", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } code << "} else {\n"; if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "RunArmHw", kRunArgsAddr, "args.thread_count_hw"); + code.CodeFunction(kParallelLaunch, "RunArmHw", kRunArgsAddr, "args.thread_count_hw", kLhsScale, kRhsScale); } else { - code.CodeFunction("RunArmHw", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("RunArmHw", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } code << "}\n"; code << "}\n"; 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 3822e64beb6..9921c9591f7 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,10 +163,11 @@ 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); + code.CodeFunction(kParallelLaunch, "Conv3x3Int8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); } 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_"); + block_unit_buffer_, tmp_dst_buffer_, tmp_out_, kDefaultTaskId, "&conv_param_", kLhsScale, + kRhsScale); } code.CodeFunction("PackNC4HW4ToNHWCInt8", tmp_out_, output_tensor_, conv_param_->output_batch_, conv_param_->output_h_ * conv_param_->output_w_, conv_param_->output_channel_); 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 e7eea636676..6cc3e80dabd 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,9 +237,9 @@ int Conv2DINT8Coder::DoCode(CoderContext *const context) { } if (support_parallel_) { - code.CodeFunction(kParallelLaunch, "ConvolutionInt8Run", kRunArgsAddr, gThreadNum); + code.CodeFunction(kParallelLaunch, "ConvolutionInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); } else { - code.CodeFunction("ConvolutionInt8Run", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("ConvolutionInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } context->AppendCode(code.str()); return RET_OK; 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 d4f3608ce13..3879fa4ac90 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,9 +122,10 @@ 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_"); + code.CodeFunction(kParallelLaunch, "ConvDepthwiseInt8Run", kRunArgsAddr, "conv_param.thread_num_", kLhsScale, + kRhsScale); } else { - code.CodeFunction("ConvDepthwiseInt8Run", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("ConvDepthwiseInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } context->AppendCode(code.str()); return RET_OK; 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 8477cb894f9..6b247526076 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,9 +92,9 @@ 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); + code.CodeFunction(kParallelLaunch, "ResizeInt8Run", kRunArgsAddr, gThreadNum, kLhsScale, kRhsScale); } else { - code.CodeFunction("ResizeInt8Run", kRunArgsAddr, kDefaultTaskId); + code.CodeFunction("ResizeInt8Run", kRunArgsAddr, kDefaultTaskId, kLhsScale, kRhsScale); } } else { MS_LOG(WARNING) << "unsupported parallel launch currently"; diff --git a/mindspore/lite/micro/coder/opcoders/parallel.h b/mindspore/lite/micro/coder/opcoders/parallel.h index ec91f38474f..1946b671bbb 100644 --- a/mindspore/lite/micro/coder/opcoders/parallel.h +++ b/mindspore/lite/micro/coder/opcoders/parallel.h @@ -35,6 +35,8 @@ constexpr auto gThreadNum = "g_thread_num"; constexpr auto kRunArgs = "args"; constexpr auto kRunArgsAddr = "(void *)&args"; +constexpr float kLhsScale = 0; +constexpr float kRhsScale = 1; } // namespace mindspore::lite::micro #endif // MINDSPORE_LITE_MICRO_CODER_OPCODERS_PARALLEL_H_ diff --git a/mindspore/lite/micro/coder/wrapper/fp32/deconvolution_fp32_wrapper.c b/mindspore/lite/micro/coder/wrapper/fp32/deconvolution_fp32_wrapper.c index 7789a1f631f..b19642554da 100644 --- a/mindspore/lite/micro/coder/wrapper/fp32/deconvolution_fp32_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/fp32/deconvolution_fp32_wrapper.c @@ -53,7 +53,7 @@ int DoDeconvFp32(const float *packed_input, const float *packed_weight, const fl return NNACL_OK; } -int DeConvFp32Run(void *cdata, int task_id) { +int DeConvFp32Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { DeConvFp32Args *args = (DeConvFp32Args *)cdata; const MatMulParameter *matmul_param = args->matmul_param_; const ConvParameter *conv_param = args->conv_param_; diff --git a/mindspore/lite/micro/coder/wrapper/fp32/deconvolution_fp32_wrapper.h b/mindspore/lite/micro/coder/wrapper/fp32/deconvolution_fp32_wrapper.h index f8356a14d79..08b9ec2124f 100644 --- a/mindspore/lite/micro/coder/wrapper/fp32/deconvolution_fp32_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/fp32/deconvolution_fp32_wrapper.h @@ -40,7 +40,7 @@ int DoDeconvFp32(const float *packed_input, const float *packed_weight, const fl float *output, float *tmp_ori_buffer, const MatMulParameter *matmul_param, const ConvParameter *conv_param, int task_id); -int DeConvFp32Run(void *cdata, int task_id); +int DeConvFp32Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); #ifdef __cplusplus } diff --git a/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.c index c5653e5a39a..df8287b6acc 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.c @@ -17,7 +17,7 @@ #include "wrapper/int8/add_int8_wrapper.h" #include "nnacl/errorcode.h" -int AddBroadcastInt8Run(void *cdata, int task_id) { +int AddBroadcastInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { AddInt8Args *args = (AddInt8Args *)(cdata); int stride = UP_DIV(args->out_size_, args->thread_count_); int real_out_count = MSMIN(stride, args->out_size_ - stride * task_id); @@ -42,7 +42,7 @@ int AddBroadcastInt8Run(void *cdata, int task_id) { return NNACL_OK; } -int AddInt8Run(void *cdata, int task_id) { +int AddInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { AddInt8Args *args = (AddInt8Args *)(cdata); /* no need broadcast */ int stride = UP_DIV(args->elements_num_, args->thread_count_); diff --git a/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.h index 791ee2cf577..372d41b2d03 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.h @@ -38,9 +38,9 @@ typedef struct { int8_t *output_data_; } AddInt8Args; -int AddBroadcastInt8Run(void *cdata, int task_id); +int AddBroadcastInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); -int AddInt8Run(void *cdata, int task_id); +int AddInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); #ifdef __cplusplus } diff --git a/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.c index 93048138b69..2959c4f0c42 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.c @@ -18,7 +18,7 @@ #include "nnacl/int8/batchnorm_int8.h" #include "nnacl/errorcode.h" -int BatchNormInt8Run(void *cdata, int task_id) { +int BatchNormInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { BatchNormArgs *args = (BatchNormArgs *)(cdata); BatchNormInt8(args->out_addr_, args->in_addr_, args->alpha_addr_, args->beta_addr_, task_id, args->batchnorm_param_); return NNACL_OK; diff --git a/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.h index a3b3c876373..9772b97528f 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.h @@ -27,6 +27,6 @@ typedef struct BatchNormArgs { BatchNormParameter *batchnorm_param_; } BatchNormArgs; -int BatchNormInt8Run(void *cdata, int task_id); +int BatchNormInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); #endif // MINDSPORE_LITE_MICRO_CODER_OPERATOR_LIBRARY_WRAPPER_INT8_BATCHNORM_INT8_WRAPPER_H_ diff --git a/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.c index b81643113e3..ff240d6e5a0 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.c @@ -16,7 +16,7 @@ #include "wrapper/int8/concat_int8_wrapper.h" -int ConcatInt8Run(void *cdata, int task_id) { +int ConcatInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { ConcatInt8Args *args = (ConcatInt8Args *)cdata; int64_t real_dst_count = MSMIN(args->before_axis_size_ - task_id * args->count_unit_, args->count_unit_); if (real_dst_count <= 0) { diff --git a/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.h index f7c8fc4e200..3b18a3d9aff 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.h @@ -30,6 +30,6 @@ typedef struct { int64_t count_unit_; } ConcatInt8Args; -int ConcatInt8Run(void *cdata, int task_id); +int ConcatInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); #endif // MINDSPORE_LITE_MICRO_INT8_CONCAT_WRAPPER_INT8_WRAPPER_H_ diff --git a/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.c index dec9f70591b..f9df30f2a45 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.c @@ -30,7 +30,7 @@ void Pre1x1Trans(Conv1x1Args *args, int8_t *src_input, int8_t *src_output) { } } -int OcOptPre(void *cdata, int task_id) { +int OcOptPre(void *cdata, int task_id, float lhs_scale, float rhs_scale) { Conv1x1Args *args = (Conv1x1Args *)(cdata); int cur_stride = args->thread_stride_hw_ * C4NUM; int res_stride = args->matmul_param_->row_ - task_id * args->thread_stride_hw_ * C4NUM; @@ -51,7 +51,7 @@ int OcOptPre(void *cdata, int task_id) { return NNACL_OK; } -int RunArm64OptOc(void *cdata, int task_id) { +int RunArm64OptOc(void *cdata, int task_id, float lhs_scale, float rhs_scale) { Conv1x1Args *args = (Conv1x1Args *)(cdata); int stride = args->thread_stride_oc_ * C16NUM; int cur_stride = task_id * stride; @@ -77,7 +77,7 @@ int RunArm64OptOc(void *cdata, int task_id) { return NNACL_OK; } -int RunArmOc(void *cdata, int task_id) { +int RunArmOc(void *cdata, int task_id, float lhs_scale, float rhs_scale) { Conv1x1Args *args = (Conv1x1Args *)(cdata); #ifdef ENABLE_ARM32 int col_tile = C2NUM; @@ -108,7 +108,7 @@ int RunArmOc(void *cdata, int task_id) { return NNACL_OK; } -int RunArm64OptHw(void *cdata, int task_id) { +int RunArm64OptHw(void *cdata, int task_id, float lhs_scale, float rhs_scale) { Conv1x1Args *args = (Conv1x1Args *)(cdata); int cur_stride = args->thread_stride_hw_ * C4NUM; int res_stride = args->matmul_param_->row_ - task_id * args->thread_stride_hw_ * C4NUM; @@ -134,7 +134,7 @@ int RunArm64OptHw(void *cdata, int task_id) { return NNACL_OK; } -int RunArmHw(void *cdata, int task_id) { +int RunArmHw(void *cdata, int task_id, float lhs_scale, float rhs_scale) { Conv1x1Args *args = (Conv1x1Args *)(cdata); int cur_stride = args->thread_stride_hw_ * C4NUM; int res_stride = args->matmul_param_->row_ - task_id * args->thread_stride_hw_ * C4NUM; diff --git a/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.h index 6432e8b91d2..85a913d2498 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.h @@ -48,10 +48,10 @@ typedef struct { void Conv1x1PreRun(Conv1x1Args *args, int thread_num); void Pre1x1Trans(Conv1x1Args *args, int8_t *src_input, int8_t *src_output); -int OcOptPre(void *cdata, int task_id); -int RunArm64OptOc(void *cdata, int task_id); -int RunArmOc(void *cdata, int task_id); -int RunArm64OptHw(void *cdata, int task_id); -int RunArmHw(void *cdata, int task_id); +int OcOptPre(void *cdata, int task_id, float lhs_scale, float rhs_scale); +int RunArm64OptOc(void *cdata, int task_id, float lhs_scale, float rhs_scale); +int RunArmOc(void *cdata, int task_id, float lhs_scale, float rhs_scale); +int RunArm64OptHw(void *cdata, int task_id, float lhs_scale, float rhs_scale); +int RunArmHw(void *cdata, int task_id, float lhs_scale, float rhs_scale); #endif // MINDSPORE_LITE_MICRO_CODER_OPERATOR_LIBRARY_WRAPPER_INT8_CONV1X1_RUN_H_ diff --git a/mindspore/lite/micro/coder/wrapper/int8/conv3x3_run_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/conv3x3_run_int8_wrapper.c index a2f21c18b44..23b7af34eff 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/conv3x3_run_int8_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/int8/conv3x3_run_int8_wrapper.c @@ -16,7 +16,7 @@ #include "wrapper/int8/conv3x3_run_int8_wrapper.h" -int Conv3x3Int8Run(void *cdata, int task_id) { +int Conv3x3Int8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { Conv3x3Int8Args *args = (Conv3x3Int8Args *)cdata; Conv3x3Int8(args->input_data, args->transed_weight, args->bias_data, args->output_data, args->tile_buffer, args->block_unit_buffer, args->tmp_dst_buffer, args->tmp_out, task_id, args->conv_param); diff --git a/mindspore/lite/micro/coder/wrapper/int8/conv3x3_run_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/conv3x3_run_int8_wrapper.h index 1fc76ee96e3..506c015aaff 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/conv3x3_run_int8_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/int8/conv3x3_run_int8_wrapper.h @@ -33,6 +33,6 @@ typedef struct { ConvParameter *conv_param; } Conv3x3Int8Args; -int Conv3x3Int8Run(void *cdata, int task_id); +int Conv3x3Int8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); #endif // MINDSPORE_LITE_MICRO_INT8_CONV3x3_WRAPPER_INT8_WRAPPER_H_ diff --git a/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.c index 3e5cf2a4109..f7c0e1d895b 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.c @@ -16,7 +16,7 @@ #include "wrapper/int8/convolution_depthwise_int8_wrapper.h" -int ConvDepthwiseInt8Run(void *cdata, int task_id) { +int ConvDepthwiseInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { ConvDepthwiseInt8Args *args = (ConvDepthwiseInt8Args *)cdata; int32_t *buffer = args->row_buffer_ + args->conv_param_->output_w_ * args->conv_param_->output_channel_ * task_id; ConvDwInt8(args->output_data_, buffer, args->input_data_, args->weight_data_, args->bias_data_, args->conv_param_, diff --git a/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.h index 6df27d027fe..da079b9ab1e 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.h @@ -30,6 +30,6 @@ typedef struct { const ConvParameter *conv_param_; } ConvDepthwiseInt8Args; -int ConvDepthwiseInt8Run(void *cdata, int task_id); +int ConvDepthwiseInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); #endif // MINDSPORE_LITE_MICRO_INT8_CONVOLUTION_DEPTHWISE_WRAPPER_INT8_WRAPPER_H_ diff --git a/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.c index 48f5ccf7785..ac29715c5b5 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.c @@ -16,7 +16,7 @@ #include "wrapper/int8/convolution_int8_wrapper.h" -int ConvolutionInt8Run(void *cdata, int task_id) { +int ConvolutionInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { ConvolutionInt8Args *args = (ConvolutionInt8Args *)cdata; ConvInt8(args->input_data_, args->packed_input_, args->matmul_input_, args->packed_weight_, args->bias_data_, args->output_data_, args->filter_zp_, args->input_sum_, task_id, args->conv_param_, args->matmul_func_, diff --git a/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.h index 082ccf41567..e3ce22ff269 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.h @@ -36,6 +36,6 @@ typedef struct { bool is_optimize_; } ConvolutionInt8Args; -int ConvolutionInt8Run(void *cdata, int task_id); +int ConvolutionInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); #endif // MINDSPORE_LITE_MICRO_INT8_CONVOLUTION_WRAPPER_INT8_WRAPPER_H_ diff --git a/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.c index 58dcbbf28de..81dc157856d 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.c @@ -17,7 +17,7 @@ #include "wrapper/int8/resize_int8_wrapper.h" #include "nnacl/errorcode.h" -int ResizeInt8Run(void *cdata, int task_id) { +int ResizeInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { ResizeInt8Args *args = (ResizeInt8Args *)cdata; ResizeNearestNeighborInt8Simple(args->input_data_, args->output_data_, args->input_shape_, args->output_shape_, args->align_corners_, task_id, args->thread_num_); diff --git a/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.h index 6721109e173..fb59dfba623 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.h @@ -32,7 +32,7 @@ typedef struct { int thread_num_; } ResizeInt8Args; -int ResizeInt8Run(void *cdata, int task_id); +int ResizeInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); #ifdef __cplusplus } diff --git a/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.c index 191908d29c8..0dd12174754 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.c +++ b/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.c @@ -17,7 +17,7 @@ #include "wrapper/int8/slice_int8_wrapper.h" #include "nnacl/int8/slice_int8.h" -int SliceInt8Run(void *cdata, int task_id) { +int SliceInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { SliceArgs *args = (SliceArgs *)(cdata); int ret = SliceInt8(args->input_data_, args->output_data_, args->param_, task_id); return ret; diff --git a/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.h index 0ecbc875cf4..5487acd3e82 100644 --- a/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.h +++ b/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.h @@ -26,6 +26,6 @@ typedef struct SliceArgs { SliceParameter *param_; } SliceArgs; -int SliceInt8Run(void *cdata, int task_id); +int SliceInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); #endif // MINDSPORE_LITE_MICRO_CODER_OPERATOR_LIBRARY_WRAPPER_INT8_SLICE_INT8_WRAPPER_H_ diff --git a/mindspore/lite/micro/coder/wrapper/thread/thread_wrapper.cc b/mindspore/lite/micro/coder/wrapper/thread/thread_wrapper.cc index 35d7f6d20e6..941c0281f62 100644 --- a/mindspore/lite/micro/coder/wrapper/thread/thread_wrapper.cc +++ b/mindspore/lite/micro/coder/wrapper/thread/thread_wrapper.cc @@ -45,7 +45,7 @@ int GetCurrentThreadNum() { return g_pool->thread_num(); } -int ParallelLaunch(int (*func)(void *, int), void *content, int task_num) { +int ParallelLaunch(int (*func)(void *, int, float, float), void *content, int task_num) { if (g_pool == nullptr) { return mindspore::THREAD_ERROR; } diff --git a/mindspore/lite/src/runtime/kernel/arm/base/constant_of_shape.cc b/mindspore/lite/src/runtime/kernel/arm/base/constant_of_shape.cc index 1637dca0496..4a8ed6fafbd 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/constant_of_shape.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/constant_of_shape.cc @@ -25,7 +25,7 @@ using mindspore::lite::RET_OK; using mindspore::schema::PrimitiveType_ConstantOfShape; namespace mindspore::kernel { -int ConstantOfShapeRun(void *cdata, int task_id) { +int ConstantOfShapeRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->DoExecute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/detection_post_process_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/detection_post_process_base.cc index 69350017562..7121c9e829b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/detection_post_process_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/detection_post_process_base.cc @@ -88,7 +88,7 @@ DetectionPostProcessBaseCPUKernel::~DetectionPostProcessBaseCPUKernel() { delete int DetectionPostProcessBaseCPUKernel::ReSize() { return RET_OK; } -int NmsMultiClassesFastCoreRun(void *cdata, int task_id) { +int NmsMultiClassesFastCoreRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto KernelData = reinterpret_cast(cdata); int ret = NmsMultiClassesFastCore(KernelData->num_boxes_, KernelData->num_classes_with_bg_, KernelData->input_scores_, PartialArgSort, KernelData->params_, task_id, KernelData->thread_num_); diff --git a/mindspore/lite/src/runtime/kernel/arm/base/prior_box.cc b/mindspore/lite/src/runtime/kernel/arm/base/prior_box.cc index a8adb880391..1dc64f051f7 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/prior_box.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/prior_box.cc @@ -153,7 +153,7 @@ int PriorBoxCPUKernel::PriorBoxImpl(int task_id) { return ret; } -int RunPriorBox(void *cdata, int task_id) { +int RunPriorBox(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto prior_box = reinterpret_cast(cdata); auto error_code = prior_box->PriorBoxImpl(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/base/quant_dtype_cast.cc b/mindspore/lite/src/runtime/kernel/arm/base/quant_dtype_cast.cc index d0e8754e26d..1298ed3d5d5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/quant_dtype_cast.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/quant_dtype_cast.cc @@ -125,7 +125,7 @@ int QuantDTypeCastCPUKernel::QuantDTypeCast(int task_id) { return RET_OK; } -int QuantDTypeCastRun(void *cdata, int task_id) { +int QuantDTypeCastRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->QuantDTypeCast(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/reshape_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/reshape_base.cc index 12c0d5b1f68..bcad7695c26 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/reshape_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/reshape_base.cc @@ -53,7 +53,7 @@ int ReshapeBaseCPUKernel::RunImpl(int task_id) { return RET_OK; } -int ReshapeRun(void *cdata, int task_id) { +int ReshapeRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto reshape = reinterpret_cast(cdata); auto ret = reshape->RunImpl(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/slice_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/slice_base.cc index e440ef42de4..53055eba035 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/slice_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/slice_base.cc @@ -24,7 +24,7 @@ using mindspore::lite::RET_OK; using mindspore::schema::PrimitiveType_SliceFusion; namespace mindspore::kernel { -int SliceLaunch(void *cdata, int task_id) { +int SliceLaunch(void *cdata, int task_id, float lhs_scale, float rhs_scale) { if (cdata == nullptr) { MS_LOG(ERROR) << "Input cdata is nullptr!"; return RET_ERROR; diff --git a/mindspore/lite/src/runtime/kernel/arm/base/split_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/split_base.cc index afcad09edc7..528f724ef72 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/split_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/split_base.cc @@ -106,7 +106,7 @@ int SplitBaseCPUKernel::Split(int task_id) { return RET_OK; } -static int SplitRun(void *cdata, int task_id) { +static int SplitRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->Split(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/split_with_over_lap_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/split_with_over_lap_base.cc index e4b1a901978..1635d99333a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/split_with_over_lap_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/split_with_over_lap_base.cc @@ -72,7 +72,7 @@ int SplitWithOverlapBaseCPUKernel::Split(int task_id) { return RET_OK; } -int SplitWithOverlapRun(void *cdata, int task_id) { +int SplitWithOverlapRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->Split(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/stack_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/stack_base.cc index 70a789b1d22..97653e9675f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/stack_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/stack_base.cc @@ -81,7 +81,7 @@ void StackBaseCPUKernel::Execute(int task_id) { Stack(all_inputs_, output_data + input_num * start * copy_size_, input_num, copy_size_, start, end); } -static int StackRun(void *cdata, int task_id) { +static int StackRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto stack = reinterpret_cast(cdata); stack->Execute(task_id); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/base/strided_slice.cc b/mindspore/lite/src/runtime/kernel/arm/base/strided_slice.cc index db4eb7f01bc..4f1707dbd88 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/strided_slice.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/strided_slice.cc @@ -129,7 +129,7 @@ int StridedSliceCPUKernel::FastRunImpl(int task_id) { return RET_OK; } -int StrideRun(void *cdata, int task_id) { +int StrideRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto stride = reinterpret_cast(cdata); auto ret = stride->FastRunImpl(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/tile_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/tile_base.cc index 6b170a2e341..4d88a45f15d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/tile_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/tile_base.cc @@ -83,7 +83,7 @@ int TileCPUKernel::ReSize() { return RET_OK; } -int SimpleTile(void *cdata, int task_id) { +int SimpleTile(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->SimpleTileImpl(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/activation_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/activation_fp16.cc index fa76a5e3aa2..ba9dc431797 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/activation_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/activation_fp16.cc @@ -82,7 +82,7 @@ int ActivationFp16CPUKernel::DoActivation(int task_id) { return error_code; } -int ActivationFp16Run(void *cdata, int task_id) { +int ActivationFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto activation_kernel = reinterpret_cast(cdata); auto error_code = activation_kernel->DoActivation(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/arithmetic_compare_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/arithmetic_compare_fp16.cc index 4feeac7f1e9..da468a10506 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/arithmetic_compare_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/arithmetic_compare_fp16.cc @@ -145,7 +145,7 @@ int ArithmeticCompareFP16CPUKernel::DoArithmetic(int task_id) { return ret; } -static int ArithmeticsRunFp16(void *cdata, int task_id) { +static int ArithmeticsRunFp16(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto arithmetic_kernel = reinterpret_cast(cdata); auto ret = arithmetic_kernel->DoArithmetic(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/cast_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/cast_fp16.cc index ec0b6d9ec48..c4b0dd21b60 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/cast_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/cast_fp16.cc @@ -26,7 +26,7 @@ using mindspore::schema::PrimitiveType_Cast; namespace mindspore::kernel { namespace { -int CastFp16Run(void *cdata, int task_id) { +int CastFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { if (cdata == nullptr) { MS_LOG(ERROR) << "input cdata is nullptr!"; return RET_ERROR; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_1x1_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_1x1_fp16.cc index 5f9e3e17acc..9a86b11bc59 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_1x1_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_1x1_fp16.cc @@ -189,7 +189,7 @@ int Convolution1x1FP16CPUKernel::RunHw(int task_id) { return RET_OK; } -static int Convolution1x1Fp16RunOc(void *cdata, int task_id) { +static int Convolution1x1Fp16RunOc(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->RunOc(task_id); if (error_code != RET_OK) { @@ -199,7 +199,7 @@ static int Convolution1x1Fp16RunOc(void *cdata, int task_id) { return RET_OK; } -static int Convolution1x1Fp16RunHw(void *cdata, int task_id) { +static int Convolution1x1Fp16RunHw(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->RunHw(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_depthwise_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_depthwise_fp16.cc index 112531fbd42..e592429bf09 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_depthwise_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_depthwise_fp16.cc @@ -92,7 +92,7 @@ int ConvolutionDepthwiseFp16CPUKernel::Execute(int task_id) { return RET_OK; } -static int ConvDwFp16Run(void *cdata, int task_id) { +static int ConvDwFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw_fp16 = reinterpret_cast(cdata); auto ret = conv_dw_fp16->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_depthwise_slidewindow_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_depthwise_slidewindow_fp16.cc index 7d9d5593ccf..127e0c3603e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_depthwise_slidewindow_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_depthwise_slidewindow_fp16.cc @@ -121,7 +121,7 @@ int ConvolutionDepthwiseSWFp16CPUKernel::Execute(int task_id) { return RET_OK; } -static int ConvDwSWFp16Run(void *cdata, int task_id) { +static int ConvDwSWFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw_fp16 = reinterpret_cast(cdata); auto ret = conv_dw_fp16->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_fp16.cc index c3e6516f2a9..1e3f219c294 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_fp16.cc @@ -125,7 +125,7 @@ int ConvolutionFP16CPUKernel::RunImpl(int task_id) { return RET_OK; } -static int ConvolutionFp16Impl(void *cdata, int task_id) { +static int ConvolutionFp16Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_winograd_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_winograd_fp16.cc index 770eb7ea46c..cbd098630fc 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_winograd_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/convolution_winograd_fp16.cc @@ -194,7 +194,7 @@ int ConvolutionWinogradFP16CPUKernel::RunImpl(int task_id) { return RET_OK; } -static int ConvolutionWinogradFp16Impl(void *cdata, int task_id) { +static int ConvolutionWinogradFp16Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/crop_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/crop_fp16.cc index 61c50714a43..a3c9c54d09e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/crop_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/crop_fp16.cc @@ -35,7 +35,7 @@ int CropFp16CPUKernel::DoExecute(int task_id) { return RET_OK; } -static int CropFp16Run(void *cdata, int task_id) { +static int CropFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->DoExecute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_depthwise_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_depthwise_fp16.cc index d6960c834e2..4d93e8c4cdf 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_depthwise_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_depthwise_fp16.cc @@ -132,7 +132,7 @@ int DeconvolutionDepthwiseFp16CPUKernel::Execute(int task_id) { return RET_OK; } -static int DeconvDwFp16Run(void *cdata, int task_id) { +static int DeconvDwFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconv_dw_fp16 = reinterpret_cast(cdata); auto ret = deconv_dw_fp16->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_fp16.cc index 5650ed71128..a05eee862b1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_fp16.cc @@ -149,7 +149,7 @@ void DeConvolutionFp16CPUKernel::FreeRunBuf() { return; } -static int DeConvFp16Run(void *cdata, int task_id) { +static int DeConvFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconv = reinterpret_cast(cdata); auto error_code = deconv->DoDeconv(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc index 08342513bf3..465f9160a8c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc @@ -220,13 +220,13 @@ int DeConvWinogradFp16CPUKernel::DeDeconvPost(int task_id) { return RET_OK; } -int DeConvWgFp16Run(void *cdata, int task_id) { +int DeConvWgFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconvWg = reinterpret_cast(cdata); deconvWg->DoDeconv(task_id); return RET_OK; } -int DeConvWgPostFp16Run(void *cdata, int task_id) { +int DeConvWgPostFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconvWg = reinterpret_cast(cdata); deconvWg->DeDeconvPost(task_id); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/gather_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/gather_fp16.cc index b155f06e630..e75eec93fb3 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/gather_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/gather_fp16.cc @@ -121,7 +121,7 @@ int GatherFp16CPUKernel::DoGather(int task_id) { return error_code; } -int GatherRunFp16(void *cdata, int task_id) { +int GatherRunFp16(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto gather_kernel = reinterpret_cast(cdata); auto error_code = gather_kernel->DoGather(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/instance_norm_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/instance_norm_fp16.cc index 4faafc010fc..c0f1ba772d5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/instance_norm_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/instance_norm_fp16.cc @@ -96,7 +96,7 @@ int InstanceNormFp16CPUKernel::DoInstanceNorm(int task_id) { return RET_OK; } -int InstanceNormFp16Run(void *cdata, int task_id) { +int InstanceNormFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoInstanceNorm(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/layer_norm_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/layer_norm_fp16.cc index 8fd30e5cb85..b6f3f6714af 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/layer_norm_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/layer_norm_fp16.cc @@ -70,7 +70,7 @@ int LayerNormFp16CPUKernel::DoLayerNormFp16(int thread_id) { return RET_OK; } -int LayerNormFp16Run(void *cdata, int task_id) { +int LayerNormFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoLayerNormFp16(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/log_softmax_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/log_softmax_fp16.cc index 94347b11135..096ee774ffb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/log_softmax_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/log_softmax_fp16.cc @@ -84,7 +84,7 @@ int LogSoftmaxFp16CPUKernel::DoLogSoftmaxLastAxis(int task_id) { return RET_OK; } -int LogSoftmaxLastAxisFp16Run(void *cdata, int task_id) { +int LogSoftmaxLastAxisFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoLogSoftmaxLastAxis(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/matmul_base_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/matmul_base_fp16.cc index 8c9b0666c14..b204898c626 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/matmul_base_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/matmul_base_fp16.cc @@ -25,7 +25,7 @@ using mindspore::lite::RET_MEMORY_FAILED; using mindspore::lite::RET_OK; namespace mindspore::kernel { -int MatmulBaseFP16Run(void *cdata, int task_id) { +int MatmulBaseFP16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto op = reinterpret_cast(cdata); auto error_code = op->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/pooling_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/pooling_fp16.cc index 2d1b9fcd8e4..915c502cf96 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/pooling_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/pooling_fp16.cc @@ -72,7 +72,7 @@ int PoolingFp16CPUKernel::RunImpl(int task_id) { return RET_OK; } -static int PoolingFp16Impl(void *cdata, int task_id) { +static int PoolingFp16Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto pooling = reinterpret_cast(cdata); auto error_code = pooling->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/power_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/power_fp16.cc index 908bf018e12..d61893b1301 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/power_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/power_fp16.cc @@ -68,7 +68,7 @@ int PowerFp16CPUKernel::GetExpData() { return RET_OK; } -int PowerImplFp16(void *cdata, int task_id) { +int PowerImplFp16(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->RunImpl(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/quant_dtype_cast_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/quant_dtype_cast_fp16.cc index 409e11f73cc..832aa6bcfff 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/quant_dtype_cast_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/quant_dtype_cast_fp16.cc @@ -131,7 +131,7 @@ int QuantDTypeCastFp16CPUKernel::QuantDTypeCast(int task_id) { return RET_OK; } -int QuantDTypeCastFP16Run(void *cdata, int task_id) { +int QuantDTypeCastFP16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->QuantDTypeCast(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/reduce_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/reduce_fp16.cc index af9e29212ec..2fa3ef1599c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/reduce_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/reduce_fp16.cc @@ -67,7 +67,7 @@ int ReduceFp16CPUKernel::CallReduceUnit(int task_id) { return ret; } -static int ReduceFp16Impl(void *cdata, int task_id) { +static int ReduceFp16Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto reduce = reinterpret_cast(cdata); auto error_code = reduce->CallReduceUnit(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/scale_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/scale_fp16.cc index 2a99140045e..705473e413c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/scale_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/scale_fp16.cc @@ -84,7 +84,7 @@ int ScaleFp16CPUKernel::Scale(int task_id) { return RET_OK; } -int ScaleFp16Run(void *cdata, int task_id) { +int ScaleFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto scale = reinterpret_cast(cdata); auto ret = scale->Scale(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/slice_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/slice_fp16.cc index 12f7753b0ba..28e5f1b668a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/slice_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/slice_fp16.cc @@ -25,7 +25,7 @@ using mindspore::lite::RET_OK; using mindspore::schema::PrimitiveType_SliceFusion; namespace mindspore::kernel { -int SliceFp16Launch(void *cdata, int task_id) { +int SliceFp16Launch(void *cdata, int task_id, float lhs_scale, float rhs_scale) { if (cdata == nullptr) { MS_LOG(ERROR) << "Input cdata is nullptr!"; return RET_ERROR; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/softmax_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/softmax_fp16.cc index 34f27ec7428..d063a121337 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/softmax_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/softmax_fp16.cc @@ -84,7 +84,7 @@ int SoftmaxFp16CPUKernel::DoSoftmaxLastAxis(int task_id) { return RET_OK; } -int SoftmaxLastAxisFp16Run(void *cdata, int task_id) { +int SoftmaxLastAxisFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoSoftmaxLastAxis(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/stack_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/stack_fp16.cc index b8644ac498c..34133f2ba8b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/stack_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/stack_fp16.cc @@ -86,7 +86,7 @@ void StackFp16CPUKernel::Execute(int task_id) { Stack(inputs, output + input_num * start * copy_size_, input_num, copy_size_, start, end); } -static int StackRun(void *cdata, int task_id) { +static int StackRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto stack = reinterpret_cast(cdata); stack->Execute(task_id); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16_grad/activation_fp16_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp16_grad/activation_fp16_grad.cc index ddb689de33d..0acff65b01c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16_grad/activation_fp16_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16_grad/activation_fp16_grad.cc @@ -66,7 +66,7 @@ int ActivationGradCPUKernelFp16::DoActivation(int task_id) { return RET_OK; } -int ActivationGradRunFp16(void *cdata, int task_id) { +int ActivationGradRunFp16(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto activationGrad_kernel = reinterpret_cast(cdata); auto error_code = activationGrad_kernel->DoActivation(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16_grad/arithmetic_fp16_self_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp16_grad/arithmetic_fp16_self_grad.cc index fe87c8c753e..4ff31aec04a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16_grad/arithmetic_fp16_self_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16_grad/arithmetic_fp16_self_grad.cc @@ -60,7 +60,7 @@ int ArithmeticSelfGradFp16CPUKernel::DoActivation(int task_id) { return RET_OK; } -int ArithmeticSelfGradFp16Run(void *cdata, int task_id) { +int ArithmeticSelfGradFp16Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto activationGrad_kernel = reinterpret_cast(cdata); auto error_code = activationGrad_kernel->DoActivation(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/activation_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/activation_fp32.cc index e6157eb89dd..88defb26261 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/activation_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/activation_fp32.cc @@ -93,7 +93,7 @@ int ActivationCPUKernel::DoActivation(int task_id) { return ret; } -int ActivationRun(void *cdata, int task_id) { +int ActivationRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto activation_kernel = reinterpret_cast(cdata); auto error_code = activation_kernel->DoActivation(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/adder_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/adder_fp32.cc index 5670cd7d374..ac417c91811 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/adder_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/adder_fp32.cc @@ -104,7 +104,7 @@ int AdderCPUKernel::RunImpl(int task_id) { return RET_OK; } -int AdderImpl(void *cdata, int task_id) { +int AdderImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto adder = reinterpret_cast(cdata); auto error_code = adder->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/addn_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/addn_fp32.cc index aa7440c3224..8ab98a9448e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/addn_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/addn_fp32.cc @@ -27,13 +27,13 @@ using mindspore::schema::PrimitiveType_AddN; namespace mindspore::kernel { namespace { -int AddNLaunch(void *cdata, int task_id) { +int AddNLaunch(void *cdata, int task_id, float lhs_scale, float rhs_scale) { if (cdata == nullptr) { MS_LOG(ERROR) << "Input cdata is nullptr!"; return RET_NULL_PTR; } auto kernel = reinterpret_cast(cdata); - return kernel->AddNParallelRun(task_id); + return kernel->AddNParallelRun(task_id, lhs_scale, rhs_scale); } } // namespace @@ -41,7 +41,7 @@ int AddNCPUKernel::Init() { return RET_OK; } int AddNCPUKernel::ReSize() { return RET_OK; } -int AddNCPUKernel::AddNParallelRun(int thread_id) { +int AddNCPUKernel::AddNParallelRun(int thread_id, float lhs_scale, float rhs_scale) { int count_per_thread = UP_DIV(elements_num_, op_parameter_->thread_num_); int count = MSMIN(count_per_thread, elements_num_ - thread_id * count_per_thread); auto stride = count_per_thread * thread_id; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/addn_fp32.h b/mindspore/lite/src/runtime/kernel/arm/fp32/addn_fp32.h index 07acd7b413b..a57add0cc9a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/addn_fp32.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/addn_fp32.h @@ -32,7 +32,7 @@ class AddNCPUKernel : public InnerKernel { int Init() override; int ReSize() override; int Run() override; - int AddNParallelRun(int thread_id); + int AddNParallelRun(int thread_id, float lhs_scale, float rhs_scale); private: float *in1_addr_; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_compare_fp32.h b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_compare_fp32.h index 9518bd09f28..29b775ab31e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_compare_fp32.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_compare_fp32.h @@ -69,7 +69,7 @@ class ArithmeticCompareCPUKernel : public ArithmeticCPUKernel { ArithmeticCompareFp32Func func_fp32_ = nullptr; ArithmeticCompareIntFunc func_int32_ = nullptr; }; -int ArithmeticCompareRun(void *cdata, int task_id); +int ArithmeticCompareRun(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_ARITHMETIC_COMPARE_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.cc index b87d075f155..eceafa55ee7 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.cc @@ -398,7 +398,7 @@ int ArithmeticCPUKernel::DoArithmetic(int task_id) { static_cast(output_ptr_) + offset, count, false); } -int ArithmeticsRun(void *cdata, int task_id) { +int ArithmeticsRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoArithmetic(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.h b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.h index 38f1e980db2..d7980e71680 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.h @@ -120,6 +120,6 @@ class ArithmeticCPUKernel : public InnerKernel { ArithmeticOptIntRun arithmetic_opt_run_int_ = nullptr; ArithmeticBoolRun arithmetic_run_bool_ = nullptr; }; -int ArithmeticsRun(void *cdata, int task_id); +int ArithmeticsRun(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_ARITHMETIC_FP32_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.cc index 7115b59dc0f..48325ae48fb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.cc @@ -104,7 +104,7 @@ int ArithmeticSelfCPUKernel::DoExecute(int task_id) { return ret; } -int ArithmeticSelfRun(void *cdata, int task_id) { +int ArithmeticSelfRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoExecute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.h b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.h index 67d4e47bc53..c1be09f5bc7 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_self_fp32.h @@ -58,7 +58,7 @@ class ArithmeticSelfCPUKernel : public InnerKernel { ArithmeticSelfFunc func_; ArithmeticSelfBoolFunc func_bool_; }; -int ArithmeticSelfRun(void *cdata, int task_id); +int ArithmeticSelfRun(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_ARITHMETIC_SELF_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/batchnorm_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/batchnorm_fp32.cc index 729b8e597f0..19049010532 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/batchnorm_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/batchnorm_fp32.cc @@ -89,7 +89,7 @@ int BatchnormCPUKernel::DoExecute(int task_id) { return RET_OK; } -int BatchNormRun(void *cdata, int task_id) { +int BatchNormRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoExecute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/batchnorm_fp32.h b/mindspore/lite/src/runtime/kernel/arm/fp32/batchnorm_fp32.h index 2d7ed0d7058..a9c09ef2798 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/batchnorm_fp32.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/batchnorm_fp32.h @@ -50,7 +50,7 @@ class BatchnormCPUKernel : public InnerKernel { float default_momentum_ = -1.0f; }; -int BatchNormRun(void *cdata, int task_id); +int BatchNormRun(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_BATCHNORM_FP32_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/cast_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/cast_fp32.cc index fb1d52efc6d..b5185ba6082 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/cast_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/cast_fp32.cc @@ -25,7 +25,7 @@ using mindspore::schema::PrimitiveType_Cast; namespace mindspore::kernel { namespace { -int CastRun(void *cdata, int task_id) { +int CastRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { if (cdata == nullptr) { MS_LOG(ERROR) << "input cdata is nullptr!"; return RET_ERROR; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/concat_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/concat_fp32.cc index 4f3f0424b0c..dbd7c29d949 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/concat_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/concat_fp32.cc @@ -58,7 +58,7 @@ int ConcatCPUKernel::DoConcat(int task_id) { return RET_OK; } -int ConcatRun(void *cdata, int task_id) { +int ConcatRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto concat_kernel = reinterpret_cast(cdata); auto error_code = concat_kernel->DoConcat(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1_fp32.cc index c1a6e3fddfb..61875f6df40 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_1x1_fp32.cc @@ -177,7 +177,7 @@ int Convolution1x1CPUKernel::DoConv1x1(int task_id) { return RET_OK; } -int Convolution1x1Run(void *cdata, int task_id) { +int Convolution1x1Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv1x1 = reinterpret_cast(cdata); auto error_code = conv1x1->DoConv1x1(task_id); if (error_code != RET_OK) { @@ -212,7 +212,7 @@ int Convolution1x1CPUKernel::DoConv1x1Hw(int task_id) { return RET_OK; } -int Convolution1x1RunHw(void *cdata, int task_id) { +int Convolution1x1RunHw(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv1x1 = reinterpret_cast(cdata); auto error_code = conv1x1->DoConv1x1Hw(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_3x3_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_3x3_fp32.cc index c2754253dde..85978360050 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_3x3_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_3x3_fp32.cc @@ -95,7 +95,7 @@ int ConvolutionDepthwise3x3CPUKernel::Execute(int task_id) { return RET_OK; } -int ConvDw3x3Run(void *cdata, int task_id) { +int ConvDw3x3Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw = reinterpret_cast(cdata); auto ret = conv_dw->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_fp32.cc index 86f84c40676..96b23407e68 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_fp32.cc @@ -85,7 +85,7 @@ int ConvolutionDepthwiseCPUKernel::Execute(int task_id) { return RET_OK; } -int ConvDwRun(void *cdata, int task_id) { +int ConvDwRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw = reinterpret_cast(cdata); auto ret = conv_dw->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_indirect_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_indirect_fp32.cc index 82f57e33f7d..6a9083fd911 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_indirect_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_indirect_fp32.cc @@ -133,7 +133,7 @@ int ConvolutionDepthwiseIndirectCPUKernel::Execute(int task_id) { return RET_OK; } -int ConvDwIndirectRun(void *cdata, int task_id) { +int ConvDwIndirectRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw = reinterpret_cast(cdata); auto ret = conv_dw->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_fp32.cc index 829a3f06557..316e8ccbcc6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_fp32.cc @@ -123,7 +123,7 @@ int ConvolutionDepthwiseSWCPUKernel::Execute(int task_id) { return RET_OK; } -int ConvDwSWRun(void *cdata, int task_id) { +int ConvDwSWRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw = reinterpret_cast(cdata); auto ret = conv_dw->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_x86_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_x86_fp32.cc index d9342559a51..3a1d9665364 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_x86_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_depthwise_slidewindow_x86_fp32.cc @@ -126,7 +126,7 @@ int ConvolutionDepthwiseSWCPUKernelX86::Execute(int task_id) { return RET_OK; } -int ConvDwSWAvxRun(void *cdata, int task_id) { +int ConvDwSWAvxRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw = reinterpret_cast(cdata); auto ret = conv_dw->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_fp32.cc index 8d0508993a0..44377df3e73 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_fp32.cc @@ -130,7 +130,7 @@ int ConvolutionCPUKernel::RunImpl(int task_id) { return RET_OK; } -int ConvolutionImpl(void *cdata, int task_id) { +int ConvolutionImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_slidewindow_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_slidewindow_fp32.cc index 05c5ea41dd6..9543d1de170 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_slidewindow_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_slidewindow_fp32.cc @@ -122,7 +122,7 @@ int ConvolutionSWCPUKernel::RunImpl(int task_id) { return RET_OK; } -int ConvolutionSWImpl(void *cdata, int task_id) { +int ConvolutionSWImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_winograd_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_winograd_fp32.cc index b20a91c9811..0e10c1a7b61 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_winograd_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/convolution_winograd_fp32.cc @@ -197,7 +197,7 @@ int ConvolutionWinogradCPUKernel::RunImpl(int task_id) { return RET_OK; } -int ConvolutionWinogradImpl(void *cdata, int task_id) { +int ConvolutionWinogradImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/crop_and_resize_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/crop_and_resize_fp32.cc index aabf28a0ef2..f25952e9033 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/crop_and_resize_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/crop_and_resize_fp32.cc @@ -96,7 +96,7 @@ void CropAndResizeCPUKernel::FreeTmpBuffer() { context_->allocator->Free(line_buffer_); } -int CropAndResizeImpl(void *cdata, int task_id) { +int CropAndResizeImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto resize = reinterpret_cast(cdata); auto error_code = resize->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/crop_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/crop_fp32.cc index be26b8ab147..dbc4b166ad6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/crop_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/crop_fp32.cc @@ -25,7 +25,7 @@ using mindspore::schema::PrimitiveType_Crop; namespace mindspore::kernel { namespace { -int CropLaunch(void *cdata, int task_id) { +int CropLaunch(void *cdata, int task_id, float lhs_scale, float rhs_scale) { if (cdata == nullptr) { MS_LOG(ERROR) << "Input cdata is nullptr!"; return RET_NULL_PTR; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/cumsum_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/cumsum_fp32.cc index 6f1c3059555..496b93b1599 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/cumsum_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/cumsum_fp32.cc @@ -26,7 +26,7 @@ using mindspore::schema::PrimitiveType_CumSum; namespace mindspore::kernel { namespace { -int CumsumLaunch(void *cdata, int task_id) { +int CumsumLaunch(void *cdata, int task_id, float lhs_scale, float rhs_scale) { if (cdata == nullptr) { MS_LOG(ERROR) << "cdata is nullptr!"; return RET_NULL_PTR; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_depthwise_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_depthwise_fp32.cc index 21ec558c146..66368b1f0f0 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_depthwise_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_depthwise_fp32.cc @@ -128,7 +128,7 @@ int DeconvolutionDepthwiseCPUKernel::Execute(int task_id) { return RET_OK; } -int DeconvDwRun(void *cdata, int task_id) { +int DeconvDwRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconv_dw = reinterpret_cast(cdata); auto ret = deconv_dw->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_fp32.cc index a8528523d7e..f0e41b0ce87 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_fp32.cc @@ -100,7 +100,7 @@ int DeConvolutionCPUKernel::InitParam() { return RET_OK; } -int DeConvFp32Run(void *cdata, int task_id) { +int DeConvFp32Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconv = reinterpret_cast(cdata); auto error_code = deconv->DoDeconv(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_winograd_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_winograd_fp32.cc index 840c0bc1dc3..a927f2a28cb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_winograd_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_winograd_fp32.cc @@ -171,13 +171,13 @@ int DeConvolutionWinogradCPUKernel::InitParameter() { return RET_OK; } -int DeConvWgFp32Run(void *cdata, int task_id) { +int DeConvWgFp32Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconvWg = reinterpret_cast(cdata); deconvWg->DoDeconv(task_id); return RET_OK; } -int DeConvWgPostFp32Run(void *cdata, int task_id) { +int DeConvWgPostFp32Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconvWg = reinterpret_cast(cdata); deconvWg->DeDeconvPost(task_id); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/elu_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/elu_fp32.cc index 79046d79510..b48083012c9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/elu_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/elu_fp32.cc @@ -43,7 +43,7 @@ int EluCPUKernel::DoExcute(int task_id) { return RET_OK; } -int EluRun(void *cdata, int task_id) { +int EluRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto EluData = reinterpret_cast(cdata); auto ret = EluData->DoExcute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/embedding_lookup_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/embedding_lookup_fp32.cc index 55e30849e73..1a2032ca29e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/embedding_lookup_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/embedding_lookup_fp32.cc @@ -57,7 +57,7 @@ int EmbeddingLookupCPUKernel::DoExcute(int task_id) { return RET_OK; } -int EmbeddingLookupRun(void *cdata, int task_id) { +int EmbeddingLookupRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoExcute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/exp_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/exp_fp32.cc index 4a87c711850..9a248dd2add 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/exp_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/exp_fp32.cc @@ -57,7 +57,7 @@ int ExpCPUKernel::DoExcute(int task_id) { return RET_OK; } -int ExpRun(void *cdata, int task_id) { +int ExpRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto ExpData = reinterpret_cast(cdata); auto ret = ExpData->DoExcute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/fill_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/fill_fp32.cc index 9cf655e103b..dccb9f48ad7 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/fill_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/fill_fp32.cc @@ -65,7 +65,7 @@ int FillCPUKernel::DoFill(int task_id) { return RET_OK; } -int FillRun(void *cdata, int task_id) { +int FillRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->DoFill(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/gatherNd_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/gatherNd_fp32.cc index 7ab89378491..337595f93e2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/gatherNd_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/gatherNd_fp32.cc @@ -113,7 +113,7 @@ int GatherNdCPUKernel::DoGatherNd(int task_id) { return RET_OK; } -int GatherNdRun(void *cdata, int task_id) { +int GatherNdRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->DoGatherNd(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/gather_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/gather_fp32.cc index 7735bd252fb..cb439862599 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/gather_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/gather_fp32.cc @@ -72,7 +72,7 @@ int GatherCPUKernel::DoGather(int task_id) { return error_code; } -int GatherRun(void *cdata, int task_id) { +int GatherRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto gather_kernel = reinterpret_cast(cdata); auto error_code = gather_kernel->DoGather(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/instance_norm_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/instance_norm_fp32.cc index aeddecb217d..ec171fd7feb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/instance_norm_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/instance_norm_fp32.cc @@ -51,7 +51,7 @@ int InstanceNormCPUKernel::DoInstanceNorm(int task_id) { return RET_OK; } -int InstanceNormRun(void *cdata, int task_id) { +int InstanceNormRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoInstanceNorm(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/l2_norm_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/l2_norm_fp32.cc index 2de95712777..7df72f42da9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/l2_norm_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/l2_norm_fp32.cc @@ -109,7 +109,7 @@ int L2NormCPUKernel::CalcL2NormTrailingAxis(int task_id) { return ThreadTrailingAxis(input_ptr_, output_ptr_, l2_norm_param_, begin, end); } -int SquareSumRun(void *cdata, int task_id) { +int SquareSumRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->CalcSquareSum(task_id); if (ret != RET_OK) { @@ -119,7 +119,7 @@ int SquareSumRun(void *cdata, int task_id) { return RET_OK; } -int L2NormRun(void *cdata, int task_id) { +int L2NormRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DivSqrtSum(task_id); if (ret != RET_OK) { @@ -129,7 +129,7 @@ int L2NormRun(void *cdata, int task_id) { return RET_OK; } -int L2NormTrailingAxisRun(void *cdata, int task_id) { +int L2NormTrailingAxisRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->CalcL2NormTrailingAxis(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/layer_norm_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/layer_norm_fp32.cc index cb42c901c49..84032c0734c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/layer_norm_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/layer_norm_fp32.cc @@ -69,7 +69,7 @@ int LayerNormCPUKernel::DoLayerNorm(int thread_id) { return RET_OK; } -int LayerNormRun(void *cdata, int task_id) { +int LayerNormRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoLayerNorm(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/local_response_norm_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/local_response_norm_fp32.cc index 8161e2ed75f..539bea5fe49 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/local_response_norm_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/local_response_norm_fp32.cc @@ -61,7 +61,7 @@ int LocalResponseNormCPUKernel::DoLocalResponseNorm(int task_id) { return RET_OK; } -int LocalResponseNormRun(void *cdata, int task_id) { +int LocalResponseNormRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto lrn = reinterpret_cast(cdata); auto error_code = lrn->DoLocalResponseNorm(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/log_softmax_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/log_softmax_fp32.cc index 52190d814dc..07aaf31defb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/log_softmax_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/log_softmax_fp32.cc @@ -84,7 +84,7 @@ int LogSoftmaxCPUKernel::DoLogSoftmaxLastAxis(int task_id) { return RET_OK; } -int LogSoftmaxLastAxisRun(void *cdata, int task_id) { +int LogSoftmaxLastAxisRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoLogSoftmaxLastAxis(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/lsh_projection_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/lsh_projection_fp32.cc index b1009005749..e8814a74e5d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/lsh_projection_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/lsh_projection_fp32.cc @@ -35,7 +35,7 @@ int LshProjectionCPUKernel::Init() { int LshProjectionCPUKernel::ReSize() { return RET_OK; } -int LshProjectionRun(void *cdata, int task_id) { +int LshProjectionRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); return kernel->DoExecute(task_id); } diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/matmul_fp32_base.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/matmul_fp32_base.cc index fd12ab2c4dd..028333f68fa 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/matmul_fp32_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/matmul_fp32_base.cc @@ -18,7 +18,7 @@ #include "nnacl/fp32/matmul_fp32.h" namespace mindspore::kernel { -int MatmulBaseFloatRun(void *cdata, int task_id) { +int MatmulBaseFloatRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto op = reinterpret_cast(cdata); auto error_code = op->FloatRun(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/one_hot_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/one_hot_fp32.cc index f946a6685d7..d6d8782a32c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/one_hot_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/one_hot_fp32.cc @@ -81,7 +81,7 @@ int OneHotCPUKernel::ReSize() { return RET_OK; } -int RunOneHot(void *cdata, int task_id) { +int RunOneHot(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto onehot_kernel = reinterpret_cast(cdata); if (onehot_kernel == nullptr) { MS_LOG(ERROR) << "cast OneHotCPUKernel failed"; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/pad_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/pad_fp32.cc index 6fee7d0f3d5..e9d6f60f4a7 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/pad_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/pad_fp32.cc @@ -211,7 +211,7 @@ int PadCPUKernel::ExtendPaddings(int *paddings, int length, const int *ori_paddi return RET_OK; } -int PadImpl(void *cdata, int task_id) { +int PadImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto padKernel = reinterpret_cast(cdata); int error_code = padKernel->RunImpl(task_id); if (error_code != NNACL_OK) { @@ -235,7 +235,7 @@ int PadCPUKernel::RunImpl(int task_id) { return RET_OK; } -int MirrorPadImpl(void *cdata, int task_id) { +int MirrorPadImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto padKernel = reinterpret_cast(cdata); int error_code = padKernel->RunMirrorPadImpl(task_id); if (error_code != NNACL_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/pad_fp32.h b/mindspore/lite/src/runtime/kernel/arm/fp32/pad_fp32.h index c6866dd99fe..fc32b22924d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/pad_fp32.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/pad_fp32.h @@ -60,8 +60,8 @@ class PadCPUKernel : public InnerKernel { std::vector mirror_pad_block_; }; -int PadImpl(void *cdata, int task_id); -int MirrorPadImpl(void *cdata, int task_id); +int PadImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale); +int MirrorPadImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_PAD_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/pooling_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/pooling_fp32.cc index 8bc34dec8c8..b32f3c1ad1c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/pooling_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/pooling_fp32.cc @@ -73,7 +73,7 @@ int PoolingCPUKernel::RunImpl(int task_id) { return RET_OK; } -int PoolingImpl(void *cdata, int task_id) { +int PoolingImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto pooling = reinterpret_cast(cdata); auto error_code = pooling->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/power_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/power_fp32.cc index cc16db869f9..cac5ab86ca7 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/power_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/power_fp32.cc @@ -29,7 +29,7 @@ int PowerCPUKernel::Init() { return RET_OK; } int PowerCPUKernel::ReSize() { return RET_OK; } -int PowerImpl(void *cdata, int task_id) { +int PowerImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->RunImpl(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/prelu_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/prelu_fp32.cc index 16d81df137a..96d439d24d5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/prelu_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/prelu_fp32.cc @@ -26,7 +26,7 @@ using mindspore::lite::RET_OK; using mindspore::schema::PrimitiveType_PReLUFusion; namespace mindspore::kernel { -static int PReluRun(void *cdata, int task_id) { +static int PReluRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto PRelu = reinterpret_cast(cdata); auto ret = PRelu->DoExcute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/reduce_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/reduce_fp32.cc index 5edcb8a841b..55284187968 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/reduce_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/reduce_fp32.cc @@ -81,7 +81,7 @@ int ReduceCPUKernel::CallReduceUnit(int task_id) { return RET_OK; } -int ReduceImpl(void *cdata, int task_id) { +int ReduceImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto reduce = reinterpret_cast(cdata); auto error_code = reduce->CallReduceUnit(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/resize_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/resize_fp32.cc index 499a0c6cb78..6f98866ebcb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/resize_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/resize_fp32.cc @@ -155,7 +155,7 @@ void ResizeCPUKernel::FreeTmpBuffer() { } } -int ResizeImpl(void *cdata, int task_id) { +int ResizeImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto resize = reinterpret_cast(cdata); auto error_code = resize->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/reverse_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/reverse_fp32.cc index 3ee22e3ed8c..f8ae7b2d6b6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/reverse_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/reverse_fp32.cc @@ -101,7 +101,7 @@ int ReverseCPUKernel::Init() { return ret; } -int ReverseRun(void *cdata, int task_id) { +int ReverseRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->DoReverse(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/roi_pooling_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/roi_pooling_fp32.cc index f09a267c9c1..935af9a97f1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/roi_pooling_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/roi_pooling_fp32.cc @@ -85,7 +85,7 @@ int ROIPoolingCPUKernel::DoExecute(int task_id) { return RET_OK; } -int ROIPoolingRun(void *cdata, int task_id) { +int ROIPoolingRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto Data = reinterpret_cast(cdata); auto ret = Data->DoExecute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/scale_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/scale_fp32.cc index 71023df84e1..8c61a6f16cd 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/scale_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/scale_fp32.cc @@ -162,7 +162,7 @@ int ScaleCPUKernel::Scale(int task_id) { return RET_OK; } -int ScaleRun(void *cdata, int task_id) { +int ScaleRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto scale = reinterpret_cast(cdata); auto ret = scale->Scale(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/scatter_nd_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/scatter_nd_fp32.cc index 2d3c9c9b0f2..08550fcc8d0 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/scatter_nd_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/scatter_nd_fp32.cc @@ -136,7 +136,7 @@ int ScatterNDCPUKernel::ScatterND(int task_id) { return RET_OK; } -int ScatterNDRun(void *cdata, int task_id) { +int ScatterNDRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->ScatterND(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/softmax_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/softmax_fp32.cc index 27591d49201..856f216c30f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/softmax_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/softmax_fp32.cc @@ -84,7 +84,7 @@ int SoftmaxCPUKernel::DoSoftmaxLastAxis(int task_id) { return RET_OK; } -int SoftmaxLastAxisRun(void *cdata, int task_id) { +int SoftmaxLastAxisRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); auto ret = kernel->DoSoftmaxLastAxis(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_batch_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_batch_fp32.cc index 6b7df142d6a..868722434f3 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_batch_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_batch_fp32.cc @@ -58,7 +58,7 @@ int SpaceToBatchCPUKernel::Init() { return ReSize(); } -int SpaceToBatchFp32Run(void *cdata, int task_id) { +int SpaceToBatchFp32Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto op = reinterpret_cast(cdata); op->DoRun(task_id); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_depth_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_depth_fp32.cc index 3908e1aac2b..2b0f9bfb424 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_depth_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/space_to_depth_fp32.cc @@ -77,7 +77,7 @@ int SpaceToDepthCPUKernel::SpaceToDepth(int task_id) { return RET_OK; } -int SpaceToDepthRun(void *cdata, int task_id) { +int SpaceToDepthRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->SpaceToDepth(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/sparse_to_dense_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/sparse_to_dense_fp32.cc index bece04cf74b..89651a0d9dd 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/sparse_to_dense_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/sparse_to_dense_fp32.cc @@ -77,7 +77,7 @@ int SparseToDenseCPUKernel::DoExcute(int task_id) { return RET_OK; } -int SparseToDenseRun(void *cdata, int task_id) { +int SparseToDenseRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto s2ddata = reinterpret_cast(cdata); auto ret = s2ddata->DoExcute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/transpose_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/transpose_fp32.cc index cef04d696ea..9808178ea53 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/transpose_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/transpose_fp32.cc @@ -138,7 +138,7 @@ int TransposeCPUKernel::RunImpl(int task_id) { return RET_OK; } -int TransposeImpl(void *kernel, int task_id) { +int TransposeImpl(void *kernel, int task_id, float lhs_scale, float rhs_scale) { auto transpose = reinterpret_cast(kernel); auto ret = transpose->RunImpl(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/where_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/where_fp32.cc index 4ee27f47995..cf9d2cc6de8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/where_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/where_fp32.cc @@ -54,7 +54,7 @@ int WhereCPUKernel::DoExcute(int task_id) { return RET_OK; } -int WhereRun(void *cdata, int task_id) { +int WhereRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto wheredata = reinterpret_cast(cdata); auto ret = wheredata->DoExcute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/activation_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/activation_grad.cc index a8ffba78e4b..c704b859d96 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/activation_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/activation_grad.cc @@ -85,7 +85,7 @@ int ActivationGradCPUKernel::DoActivation(int task_id) { return RET_OK; } -int ActivationGradRun(void *cdata, int task_id) { +int ActivationGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto activationGrad_kernel = reinterpret_cast(cdata); auto error_code = activationGrad_kernel->DoActivation(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/adam.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/adam.cc index 35ba2bb5ba2..13aa9acf3cf 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/adam.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/adam.cc @@ -82,7 +82,7 @@ int AdamCPUKernel::Execute(int task_id) { adam_param_->use_nesterov_, start, end); } -int AdamRun(void *cdata, int task_id) { +int AdamRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto adam_kernel = reinterpret_cast(cdata); auto error_code = RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/apply_momentum.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/apply_momentum.cc index 8405044efca..cdbfc46c11d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/apply_momentum.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/apply_momentum.cc @@ -64,7 +64,7 @@ int ApplyMomentumCPUKernel::Execute(int task_id) { return RET_OK; } -int ApplyMomentumRun(void *cdata, int task_id) { +int ApplyMomentumRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto applyMomentum_kernel = reinterpret_cast(cdata); auto error_code = RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_grad.cc index ecc0f3b8148..d2d1dd7ea8e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_grad.cc @@ -213,7 +213,7 @@ int ArithmeticGradCPUKernel::Execute(int task_id) { return RET_OK; } -int ArithmeticGradRun(void *cdata, int task_id) { +int ArithmeticGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto Arithmetic_kernel = reinterpret_cast(cdata); auto error_code = Arithmetic_kernel->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_self_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_self_grad.cc index 6edbab8da3b..03935a935d1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_self_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/arithmetic_self_grad.cc @@ -32,7 +32,7 @@ using mindspore::schema::PrimitiveType_SqrtGrad; namespace mindspore::kernel { namespace { -int ArithmeticSelfGradRun(void *cdata, int thread_id) { +int ArithmeticSelfGradRun(void *cdata, int thread_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto kernel = reinterpret_cast(cdata); return kernel->DoArithmeticSelfGrad(thread_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/assign.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/assign.cc index cdd6ac6b0db..b578b9feb3f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/assign.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/assign.cc @@ -45,7 +45,7 @@ int AssignCPUKernel::Execute(int task_id) { return RET_OK; } -int AssignRun(void *cdata, int task_id) { +int AssignRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto Assign_kernel = reinterpret_cast(cdata); auto error_code = Assign_kernel->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bias_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bias_grad.cc index c2bcb2b04bb..e0a3700d2bc 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bias_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bias_grad.cc @@ -70,7 +70,7 @@ int BiasGradCPUKernel::Execute(int task_id) { return RET_OK; } -int BiasGradRun(void *cdata, int task_id) { +int BiasGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto bias_kernel = reinterpret_cast(cdata); auto error_code = bias_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.cc index f1294f4eea3..d4c18dee0a1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/bn_grad.cc @@ -124,7 +124,7 @@ int BNGradCPUKernel::Execute(int task_id) { return RET_OK; } -int BNGradRun(void *cdata, int task_id) { +int BNGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto bn_kernel = reinterpret_cast(cdata); auto error_code = bn_kernel->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution.cc index b955355bc1a..6fd968de535 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution.cc @@ -155,7 +155,7 @@ int ConvolutionTrainCPUKernel::Execute(int task_id) { return RET_OK; } -int ConvolutionTrainRun(void *cdata, int task_id) { +int ConvolutionTrainRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto conv_kernel = reinterpret_cast(cdata); auto error_code = conv_kernel->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_filter.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_filter.cc index 3b9431f52e2..542e9fac02b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_filter.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_filter.cc @@ -180,7 +180,7 @@ int ConvolutionGradFilterCPUKernel::Execute(int task_id) { return RET_OK; } -int ConvolutionGradFilterRun(void *cdata, int task_id) { +int ConvolutionGradFilterRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto convfilter_kernel = reinterpret_cast(cdata); auto error_code = convfilter_kernel->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_input.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_input.cc index a7dfc1a0470..157b26d74a2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_input.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/convolution_grad_input.cc @@ -123,7 +123,7 @@ int ConvolutionGradInputCPUKernel::Execute(int task_id) { return RET_OK; } -int ConvolutionGradInputRun(void *cdata, int task_id) { +int ConvolutionGradInputRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto convinput_kernel = reinterpret_cast(cdata); auto error_code = convinput_kernel->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/deconvolution_grad_filter.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/deconvolution_grad_filter.cc index e01fd90cb0d..64a6d0dca05 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/deconvolution_grad_filter.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/deconvolution_grad_filter.cc @@ -110,7 +110,7 @@ int DeConvolutionGradFilterCPUKernel::Execute(int task_id) { return RET_OK; } -int DeConvolutionGradFilterRun(void *cdata, int task_id) { +int DeConvolutionGradFilterRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto convfilter_kernel = reinterpret_cast(cdata); auto error_code = convfilter_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/dropout.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/dropout.cc index e765a22e41a..e372a2dc2dd 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/dropout.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/dropout.cc @@ -88,7 +88,7 @@ int DropoutCPUKernel::Execute(int task_id) { return RET_OK; } -int RunDropout(void *cdata, int task_id) { +int RunDropout(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto dropout = reinterpret_cast(cdata); auto error_code = dropout->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/dropout_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/dropout_grad.cc index cc30b193b49..bacd7951573 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/dropout_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/dropout_grad.cc @@ -69,7 +69,7 @@ int DropoutGradCPUKernel::Execute(int task_id) { return RET_OK; } -int RunDropoutGrad(void *cdata, int task_id) { +int RunDropoutGrad(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto dropout = reinterpret_cast(cdata); auto error_code = dropout->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/layernorm_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/layernorm_grad.cc index abcd04bf7b1..864022f8bc9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/layernorm_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/layernorm_grad.cc @@ -89,7 +89,7 @@ int LayerNormGradCPUKernel::Execute(int task_id) { return RET_OK; } -int LayerNormGradRun(void *cdata, int task_id) { +int LayerNormGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto ln_kernel = reinterpret_cast(cdata); auto error_code = ln_kernel->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/neg_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/neg_grad.cc index 4f3d6f985a5..7d3cafde2e6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/neg_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/neg_grad.cc @@ -28,7 +28,7 @@ using mindspore::schema::PrimitiveType_NegGrad; namespace mindspore::kernel { namespace { -int NegGradRun(void *cdata, int task_id) { +int NegGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto kernel = reinterpret_cast(cdata); MS_ASSERT(kernel != nullptr); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/pooling_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/pooling_grad.cc index 3e25a306898..f7e1255c42f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/pooling_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/pooling_grad.cc @@ -85,7 +85,7 @@ int PoolingGradCPUKernel::Execute(int task_id) { return RET_OK; } -int PoolingGradImpl(void *cdata, int task_id) { +int PoolingGradImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto pooling = reinterpret_cast(cdata); auto error_code = pooling->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/power_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/power_grad.cc index d61d9bb1ac0..c6d2f3ae6a8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/power_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/power_grad.cc @@ -64,7 +64,7 @@ int PowerGradCPUKernel::Execute(int task_id) { return RET_OK; } -int PowerGradRun(void *cdata, int task_id) { +int PowerGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto power_kernel = reinterpret_cast(cdata); auto error_code = power_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/resize_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/resize_grad.cc index 7c9e5cc75d8..ee81102e057 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/resize_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/resize_grad.cc @@ -76,7 +76,7 @@ int ResizeGradCPUKernel::Execute(int task_id) { return RET_OK; } -int ResizeGradRun(void *cdata, int task_id) { +int ResizeGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto resize_grad_kernel = reinterpret_cast(cdata); auto error_code = resize_grad_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sgd.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sgd.cc index 3c45d37fec6..fa32e1f8378 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sgd.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sgd.cc @@ -109,7 +109,7 @@ int SgdCPUKernel::ExecuteInit(int task_id) { return RET_OK; } -int SgdRun(void *cdata, int task_id) { +int SgdRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto sgd_kernel = reinterpret_cast(cdata); auto error_code = RET_OK; if (sgd_kernel->get_optimizer_mode() == OptimizerKernel::WeightUpdateMode::VIRTUAL_BATCH) { @@ -124,7 +124,7 @@ int SgdRun(void *cdata, int task_id) { return RET_OK; } -int SgdRunInit(void *cdata, int task_id) { +int SgdRunInit(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto sgd_kernel = reinterpret_cast(cdata); auto error_code = RET_OK; if (sgd_kernel->get_optimizer_mode() == OptimizerKernel::WeightUpdateMode::VIRTUAL_BATCH) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sigmoid_cross_entropy_with_logits.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sigmoid_cross_entropy_with_logits.cc index d916778c238..62b84554e2e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sigmoid_cross_entropy_with_logits.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sigmoid_cross_entropy_with_logits.cc @@ -48,7 +48,7 @@ int SigmoidCrossEntropyWithLogitsCPUKernel::Execute(int task_id) { return RET_OK; } -int SigmoidCrossEntropyWithLogitsRun(void *cdata, int task_id) { +int SigmoidCrossEntropyWithLogitsRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto sig_crs_ent_kernel = reinterpret_cast(cdata); auto error_code = sig_crs_ent_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sigmoid_cross_entropy_with_logits_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sigmoid_cross_entropy_with_logits_grad.cc index 180a6527036..5b926f7dbbd 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sigmoid_cross_entropy_with_logits_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sigmoid_cross_entropy_with_logits_grad.cc @@ -47,7 +47,7 @@ int SigmoidCrossEntropyWithLogitsGradCPUKernel::Execute(int task_id) { return RET_OK; } -int SigmoidCrossEntropyWithLogitsGradRun(void *cdata, int task_id) { +int SigmoidCrossEntropyWithLogitsGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto sig_crs_ent_kernel = reinterpret_cast(cdata); auto error_code = sig_crs_ent_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/smooth_l1_loss.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/smooth_l1_loss.cc index 460edd06ccb..e61caccb7df 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/smooth_l1_loss.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/smooth_l1_loss.cc @@ -60,7 +60,7 @@ int SmoothL1LossCPUKernel::Execute(int task_id) { return RET_OK; } -int SmoothL1LossRun(void *cdata, int task_id) { +int SmoothL1LossRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto smooth_l1_loss_kernel = reinterpret_cast(cdata); auto error_code = smooth_l1_loss_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/smooth_l1_loss_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/smooth_l1_loss_grad.cc index 7c39c2304e1..4017f6b8b06 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/smooth_l1_loss_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/smooth_l1_loss_grad.cc @@ -57,7 +57,7 @@ int SmoothL1LossGradCPUKernel::Execute(int task_id) { return RET_OK; } -int SmoothL1LossGradRun(void *cdata, int task_id) { +int SmoothL1LossGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto smooth_l1_loss_kernel = reinterpret_cast(cdata); auto error_code = smooth_l1_loss_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_cross_entropy_with_logits.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_cross_entropy_with_logits.cc index 346bad7dd45..8b8dbd4aa45 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_cross_entropy_with_logits.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_cross_entropy_with_logits.cc @@ -79,7 +79,7 @@ int SoftmaxCrossEntropyWithLogitsCPUKernel::Execute(int task_id) { return RET_OK; } -int SoftmaxCrossEntropyWithLogitsRun(void *cdata, int task_id) { +int SoftmaxCrossEntropyWithLogitsRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto softmax_kernel = reinterpret_cast(cdata); auto error_code = softmax_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_grad.cc index db467f2f36c..fd8a2e66904 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/softmax_grad.cc @@ -68,7 +68,7 @@ int SoftmaxGradCPUKernel::Execute(int task_id) { return RET_OK; } -int SoftmaxGradRun(void *cdata, int task_id) { +int SoftmaxGradRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto softmax_kernel = reinterpret_cast(cdata); auto error_code = softmax_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc index 58ff4aa3d22..d59ab8bccc6 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc @@ -110,7 +110,7 @@ int SparseSoftmaxCrossEntropyWithLogitsCPUKernel::Execute(int task_id) { return RET_OK; } -int SparseSoftmaxCrossEntropyWithLogitsRun(void *cdata, int task_id) { +int SparseSoftmaxCrossEntropyWithLogitsRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto sparse_kernel = reinterpret_cast(cdata); auto error_code = sparse_kernel->Execute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/strided_slice_grad.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/strided_slice_grad.cc index 72e055cade8..78e57e4d9db 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/strided_slice_grad.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/strided_slice_grad.cc @@ -110,7 +110,7 @@ void StridedSliceGradCPUKernel::FillOutputDim() { int StridedSliceGradCPUKernel::ReSize() { return RET_OK; } -int StridedSliceGradImpl(void *cdata, int task_id) { +int StridedSliceGradImpl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto slice = reinterpret_cast(cdata); auto error_code = slice->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/unsorted_segment_sum.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/unsorted_segment_sum.cc index 9112be09c88..c1f1a842fdd 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/unsorted_segment_sum.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/unsorted_segment_sum.cc @@ -54,7 +54,7 @@ int UnsortedSegmentSumCPUKernel::Init() { int UnsortedSegmentSumCPUKernel::ReSize() { return RET_OK; } -int UnsortedSegmentSumRun(void *cdata, int task_id) { +int UnsortedSegmentSumRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { MS_ASSERT(cdata != nullptr); auto kernel = reinterpret_cast(cdata); auto error_code = kernel->Execute(task_id); diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc index 08de628b795..ea32cbbd000 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.cc @@ -143,7 +143,7 @@ int QuantizedAddCPUKernel::ReSize() { return RET_OK; } -int AddInt8Run(void *cdata, int task_id) { +int AddInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto add = reinterpret_cast(cdata); add->DoExecute(task_id); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.h index a0f78332bff..5f6652516cb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/add_int8.h @@ -54,7 +54,7 @@ class QuantizedAddCPUKernel : public InnerKernel { int8_t *output_data_ = nullptr; }; -int AddInt8Run(void *cdata, int task_id); +int AddInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_INT8_ADD_INT8_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/arithmetic_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/arithmetic_int8.cc index f639e136cae..e2f990fec92 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/arithmetic_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/arithmetic_int8.cc @@ -40,7 +40,7 @@ using mindspore::schema::PrimitiveType_NotEqual; namespace mindspore::kernel { namespace { -int ArithmeticsInt8Launch(void *cdata, int task_id) { +int ArithmeticsInt8Launch(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto arithmetic_kernel = reinterpret_cast(cdata); auto error_code = arithmetic_kernel->DoArithmetic(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/arithmetic_self_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/arithmetic_self_int8.cc index d8df7acad05..8c512142f0d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/arithmetic_self_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/arithmetic_self_int8.cc @@ -64,7 +64,7 @@ int ArithmeticSelfInt8CPUKernel::ReSize() { return RET_OK; } -int ArithmeticSelfInt8Runs(void *cdata, int task_id) { +int ArithmeticSelfInt8Runs(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->DoArithmeticSelf(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/batchnorm_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/batchnorm_int8.cc index 0b0767797f6..98ab584a484 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/batchnorm_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/batchnorm_int8.cc @@ -173,7 +173,7 @@ int BatchnormInt8CPUKernel::DoExecute(int task_id) { return RET_OK; } -int BatchNormInt8Run(void *cdata, int task_id) { +int BatchNormInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->DoExecute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/concat_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/concat_int8.cc index c73fb5b9532..155b3bf3f40 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/concat_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/concat_int8.cc @@ -121,7 +121,7 @@ int ConcatInt8CPUKernel::Run() { return ret; } -int ConcatInt8Run(void *cdata, int task_id) { +int ConcatInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto concat = reinterpret_cast(cdata); concat->DoExecute(task_id); return lite::RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/concat_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/concat_int8.h index 789a977656b..209a305b79a 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/concat_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/concat_int8.h @@ -67,7 +67,7 @@ class ConcatInt8CPUKernel : public InnerKernel { ConcatParameter *concat_param_ = nullptr; }; -int ConcatInt8Run(void *cdata, int task_id); +int ConcatInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_INT8_CONCAT_INT8_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_1x1_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_1x1_int8.cc index b583dadb3eb..affe184b648 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_1x1_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_1x1_int8.cc @@ -60,7 +60,7 @@ void Convolution1x1Int8CPUKernel::FreeResizeBuf() { return; } -int Convolution1x1Int8HwRun(void *cdata, int task_id) { +int Convolution1x1Int8HwRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->HwRun(task_id); if (error_code != RET_OK) { @@ -70,7 +70,7 @@ int Convolution1x1Int8HwRun(void *cdata, int task_id) { return RET_OK; } -int Convolution1x1Int8OcRun(void *cdata, int task_id) { +int Convolution1x1Int8OcRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->OcRun(task_id); if (error_code != RET_OK) { @@ -80,7 +80,7 @@ int Convolution1x1Int8OcRun(void *cdata, int task_id) { return RET_OK; } -int Convolution1x1Int8OcOptPre(void *cdata, int task_id) { +int Convolution1x1Int8OcOptPre(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->OcOptPre(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_3x3_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_3x3_int8.cc index f83fd07e6ec..b1fcd08aef5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_3x3_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_3x3_int8.cc @@ -200,7 +200,7 @@ int Convolution3x3Int8CPUKernel::RunImpl(int task_id) { return RET_OK; } -int Convolution3x3Int8Impl(void *cdata, int task_id) { +int Convolution3x3Int8Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_3x3_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_3x3_int8.cc index bb90ef996e0..f92e9e813fa 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_3x3_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_3x3_int8.cc @@ -128,7 +128,7 @@ int ConvolutionDepthwise3x3Int8CPUKernel::Execute(int task_id) { return RET_OK; } -int ConvDw3x3Int8Run(void *cdata, int task_id) { +int ConvDw3x3Int8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw_int8 = reinterpret_cast(cdata); auto ret = conv_dw_int8->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_int8.cc index 84336c5be63..4ad4369383c 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_int8.cc @@ -112,7 +112,7 @@ int ConvolutionDepthwiseInt8CPUKernel::Execute(int task_id) { return RET_OK; } -int ConvDwInt8Run(void *cdata, int task_id) { +int ConvDwInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw_int8 = reinterpret_cast(cdata); auto ret = conv_dw_int8->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_slidewindow_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_slidewindow_int8.cc index 8e91b443c1c..69ce4b34c94 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_slidewindow_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_depthwise_slidewindow_int8.cc @@ -279,7 +279,7 @@ int ConvolutionDepthwiseSWInt8CPUKernel::Execute(int task_id) { return RET_OK; } -int ConvDwSWInt8Run(void *cdata, int task_id) { +int ConvDwSWInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv_dw_int8 = reinterpret_cast(cdata); auto ret = conv_dw_int8->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_int8.cc index 3ffa3f4112e..26fda639ff5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/convolution_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/convolution_int8.cc @@ -205,7 +205,7 @@ int ConvolutionInt8CPUKernel::RunImpl(int task_id) { return RET_OK; } -int ConvolutionInt8Impl(void *cdata, int task_id) { +int ConvolutionInt8Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto conv = reinterpret_cast(cdata); auto error_code = conv->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/crop_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/crop_int8.cc index 58b82179eb7..ff33d3338cf 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/crop_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/crop_int8.cc @@ -56,7 +56,7 @@ int CropInt8CPUKernel::Run() { return ret; } -int CropInt8Run(void *cdata, int task_id) { +int CropInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto crop = reinterpret_cast(cdata); crop->DoExecute(task_id); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/crop_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/crop_int8.h index 53f9af633f7..3d64cee7548 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/crop_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/crop_int8.h @@ -39,7 +39,7 @@ class CropInt8CPUKernel : public CropBaseCPUKernel { int DoExecute(int task_id); }; -int CropInt8Run(void *cdata, int task_id); +int CropInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); void PadOffset(int input_dim, CropParameter *crop_para); } // namespace mindspore::kernel diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_depthwise_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_depthwise_int8.cc index c881abcca8a..3fd5a44d642 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_depthwise_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_depthwise_int8.cc @@ -149,7 +149,7 @@ int DeconvolutionDepthwiseInt8CPUKernel::Execute(int task_id) { return RET_OK; } -int DeconvDwInt8Run(void *cdata, int task_id) { +int DeconvDwInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconv_dw_int8 = reinterpret_cast(cdata); auto ret = deconv_dw_int8->Execute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.cc index 61c4bbe2596..7aaeb7c8019 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.cc @@ -211,7 +211,7 @@ void DeConvInt8CPUKernel::FreeRunBuf() { return; } -int DeConvInt8Run(void *cdata, int task_id) { +int DeConvInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto deconv = reinterpret_cast(cdata); auto error_code = deconv->DoDeconv(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/detection_post_process_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/detection_post_process_int8.cc index f1f3707f8b5..b45d30a5169 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/detection_post_process_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/detection_post_process_int8.cc @@ -38,7 +38,7 @@ int DetectionPostProcessInt8CPUKernel::DequantizeInt8ToFp32(const int task_id) { return RET_OK; } -int DequantizeInt8ToFp32Run(void *cdata, int task_id) { +int DequantizeInt8ToFp32Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto KernelData = reinterpret_cast(cdata); auto ret = KernelData->DequantizeInt8ToFp32(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/div_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/div_int8.cc index fe3faa6279a..4d71c5ade79 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/div_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/div_int8.cc @@ -96,7 +96,7 @@ int DivInt8CPUKernel::DoExecute(int task_id) { return ret; } -int DivInt8Run(void *cdata, int task_id) { +int DivInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto div_kernel = reinterpret_cast(cdata); auto ret = div_kernel->DoExecute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/gatherNd_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/gatherNd_int8.cc index d413b66eea9..9bde0251de9 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/gatherNd_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/gatherNd_int8.cc @@ -120,7 +120,7 @@ int GatherNdInt8CPUKernel::DoGatherNd(int task_id) { return RET_OK; } -int GatherNdInt8Run(void *cdata, int task_id) { +int GatherNdInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->DoGatherNd(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/gather_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/gather_int8.cc index f8fe7310bef..17a11f1f534 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/gather_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/gather_int8.cc @@ -85,7 +85,7 @@ int GatherInt8CPUKernel::DoGather(int task_id) { return GatherInt8(input_ptr, output_ptr, count, inner_size, limit, indices_ptr, indices_element_size, param_); } -int GatherInt8Run(void *cdata, int task_id) { +int GatherInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto gather_kernel = reinterpret_cast(cdata); auto error_code = gather_kernel->DoGather(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.cc index 6cf567c05ef..d9a1fc2cb1f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/hswish_int8.cc @@ -77,7 +77,7 @@ int HswishInt8CPUKernel::DoActivation(int task_id) { return RET_OK; } -int HswishInt8Run(void *cdata, int task_id) { +int HswishInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto activation_kernel = reinterpret_cast(cdata); auto error_code = activation_kernel->DoActivation(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/l2_norm_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/l2_norm_int8.cc index 638bc84980b..daf5826495e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/l2_norm_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/l2_norm_int8.cc @@ -48,7 +48,7 @@ int L2NormInt8CPUKernel::Init() { return ReSize(); } -int L2NormInt8Run(void *cdata, int task_id) { +int L2NormInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); kernel->DoExecute(task_id); return lite::RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/layer_norm_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/layer_norm_int8.cc index 4a9001d655f..245e8edb8c8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/layer_norm_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/layer_norm_int8.cc @@ -121,7 +121,7 @@ int LayerNormInt8CPUKernel::DoExecute(int task_id) { return RET_OK; } -int LayerNormInt8Run(void *cdata, int task_id) { +int LayerNormInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto kernel = reinterpret_cast(cdata); kernel->DoExecute(task_id); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/leaky_relu_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/leaky_relu_int8.cc index 20308701ce3..c8fdf31c48d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/leaky_relu_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/leaky_relu_int8.cc @@ -26,7 +26,7 @@ using mindspore::schema::PrimitiveType_LeakyRelu; namespace mindspore::kernel { namespace { -int LeakyReluInt8Run(void *cdata, int task_id) { +int LeakyReluInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { if (cdata == nullptr) { MS_LOG(ERROR) << "input cdata is nullptr!"; return RET_ERROR; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/matmul_base_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/matmul_base_int8.cc index 78b51b1762a..77e4ce24dce 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/matmul_base_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/matmul_base_int8.cc @@ -21,7 +21,7 @@ using mindspore::lite::RET_MEMORY_FAILED; using mindspore::lite::RET_OK; namespace mindspore::kernel { -int MatmulBaseInt8Run(void *cdata, int task_id) { +int MatmulBaseInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto op = reinterpret_cast(cdata); auto ret = op->RunImpl(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/mul_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/mul_int8.cc index df1537bec06..42934912492 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/mul_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/mul_int8.cc @@ -188,13 +188,13 @@ int MulInt8CPUKernel::Run() { return ret; } -int FastHWBroadcatMulInt8Run(void *cdata, int task_id) { +int FastHWBroadcatMulInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto mul = reinterpret_cast(cdata); mul->FastDoExecute(task_id); return lite::RET_OK; } -int MulInt8Run(void *cdata, int task_id) { +int MulInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto mul = reinterpret_cast(cdata); mul->DoExecute(task_id); return lite::RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/mul_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/mul_int8.h index 77a191514dc..9149df38949 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/mul_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/mul_int8.h @@ -56,8 +56,8 @@ class MulInt8CPUKernel : public InnerKernel { int8_t *output_data_ = nullptr; }; -int MulInt8Run(void *cdata, int task_id); -int FastHWBroadcatMulInt8Run(void *cdata, int task_id); +int MulInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); +int FastHWBroadcatMulInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_INT8_MUL_INT8_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/pad_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/pad_int8.cc index 6c1c489d625..70c2d0e61ae 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/pad_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/pad_int8.cc @@ -129,7 +129,7 @@ int PadInt8CPUKernel::RunImpl(int task_id) { return PadConstant4D(in_data_, out_data_, in_dims_, out_dims_, pad_param_->paddings_, task_id, context_->thread_num_); } -int PadInt8Impl(void *cdata, int task_id) { +int PadInt8Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto resize = reinterpret_cast(cdata); auto error_code = resize->RunImpl(task_id); if (error_code != RET_OK) { @@ -197,7 +197,7 @@ int PadInt8CPUKernel::RunMirrorPadImpl(int task_id) { return RET_OK; } -int MirrorPadImplInt8(void *cdata, int task_id) { +int MirrorPadImplInt8(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto padKernel = reinterpret_cast(cdata); int error_code = padKernel->RunMirrorPadImpl(task_id); if (error_code != NNACL_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/pooling_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/pooling_int8.cc index 32180237ae4..ab8e1134fcb 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/pooling_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/pooling_int8.cc @@ -84,7 +84,7 @@ int PoolingInt8CPUKernel::RunImpl(int task_id) { return RET_OK; } -int PoolingInt8Impl(void *cdata, int task_id) { +int PoolingInt8Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto pooling = reinterpret_cast(cdata); auto error_code = pooling->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/power_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/power_int8.cc index 4a844cdd148..3ab2e7e0de5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/power_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/power_int8.cc @@ -88,7 +88,7 @@ int PowerInt8CPUKernel::DoPower(int task_id) { return ret; } -int PowerInt8Run(void *cdata, int task_id) { +int PowerInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto power_kernel = reinterpret_cast(cdata); auto ret = power_kernel->DoPower(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/reduce_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/reduce_int8.cc index fa30dfe221e..ed250530788 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/reduce_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/reduce_int8.cc @@ -355,7 +355,7 @@ void ReduceInt8CPUKernel::FreeTmpBuffer() { int ReduceInt8CPUKernel::ReSize() { return ReduceBaseCPUKernel::ReSize(); } -int ReduceInt8Impl(void *cdata, int task_id) { +int ReduceInt8Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto reduce = reinterpret_cast(cdata); auto error_code = reduce->CallReduceUnit(task_id); if (error_code != RET_OK) { @@ -365,7 +365,7 @@ int ReduceInt8Impl(void *cdata, int task_id) { return RET_OK; } -int ReduceMeanPatternInt8Impl(void *cdata, int task_id) { +int ReduceMeanPatternInt8Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto reduce = reinterpret_cast(cdata); auto error_code = reduce->Reduce4DExecute(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/relux_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/relux_int8.cc index 2b0aa18c2e6..50b92df6ebc 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/relux_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/relux_int8.cc @@ -60,7 +60,7 @@ int ReluXInt8CPUKernel::DoActivation(int task_id) { return RET_OK; } -int ReluXInt8Run(void *cdata, int task_id) { +int ReluXInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto activation_kernel = reinterpret_cast(cdata); auto error_code = activation_kernel->DoActivation(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.cc index 125e309a487..62baf2a62b8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.cc @@ -62,7 +62,7 @@ int ReshapeInt8CPUKernel::Run() { return ret; } -int ReshapeInt8Run(void *cdata, int task_id) { +int ReshapeInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto reshape = reinterpret_cast(cdata); reshape->DoExecute(task_id); return lite::RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.h index ca3baf71ee3..b32c4ab45f4 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.h @@ -47,7 +47,7 @@ class ReshapeInt8CPUKernel : public InnerKernel { ReshapeParameter *reshape_param_ = nullptr; }; -int ReshapeInt8Run(void *cdata, int task_id); +int ReshapeInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_INT8_RESHAPE_INT8_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/resize_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/resize_int8.cc index 0745a93ccc2..7b7eb5522c1 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/resize_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/resize_int8.cc @@ -289,7 +289,7 @@ int ResizeInt8CPUKernel::ReSize() { return RET_OK; } -int ResizeInt8Impl(void *cdata, int task_id) { +int ResizeInt8Impl(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto resize = reinterpret_cast(cdata); auto error_code = resize->RunImpl(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/scale_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/scale_int8.cc index 4bcf454d96b..7fb7bec320e 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/scale_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/scale_int8.cc @@ -275,7 +275,7 @@ int ScaleInt8CPUKernel::Scale(int task_id) { return RET_OK; } -int ScaleRunInt8(void *cdata, int task_id) { +int ScaleRunInt8(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto scale = reinterpret_cast(cdata); auto ret = scale->Scale(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc index 58c66c2a462..9ced691c3cc 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/sigmoid_int8.cc @@ -77,7 +77,7 @@ int SigmoidInt8CPUKernel::DoActivation(int task_id) { return RET_OK; } -int SigmoidInt8Run(void *cdata, int task_id) { +int SigmoidInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto activation_kernel = reinterpret_cast(cdata); auto error_code = activation_kernel->DoActivation(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/slice_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/slice_int8.cc index fdc84a2597b..996f86e8222 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/slice_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/slice_int8.cc @@ -66,7 +66,7 @@ int SliceInt8CPUKernel::DoSlice(int task_id) { return ret; } -int SliceInt8Run(void *cdata, int task_id) { +int SliceInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto slice_kernel = reinterpret_cast(cdata); auto ret = slice_kernel->DoSlice(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.cc index 14b208be0f9..dd901004fc2 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/softmax_int8.cc @@ -109,7 +109,7 @@ int SoftmaxInt8CPUKernel::DoSoftmax(int task_id) { return RET_OK; } -int SoftmaxRun(void *cdata, int task_id) { +int SoftmaxRun(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto softmax_kernel = reinterpret_cast(cdata); auto error_code = softmax_kernel->DoSoftmax(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/split_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/split_int8.cc index a7ab52b96f5..36c95d5f806 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/split_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/split_int8.cc @@ -78,7 +78,7 @@ int SplitInt8CPUKernel::Split(int task_id) { return RET_OK; } -int SplitInt8Run(void *cdata, int task_id) { +int SplitInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->Split(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/squeeze_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/squeeze_int8.cc index 951b69b1060..d35f0570175 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/squeeze_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/squeeze_int8.cc @@ -96,7 +96,7 @@ int SqueezeInt8CPUKernel::Run() { return ret; } -int SqueezeInt8Run(void *cdata, int task_id) { +int SqueezeInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto Squeeze = reinterpret_cast(cdata); Squeeze->DoExecute(task_id); return RET_OK; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/squeeze_int8.h b/mindspore/lite/src/runtime/kernel/arm/int8/squeeze_int8.h index b8fd7a21535..5778d31176b 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/squeeze_int8.h +++ b/mindspore/lite/src/runtime/kernel/arm/int8/squeeze_int8.h @@ -42,7 +42,7 @@ class SqueezeInt8CPUKernel : public InnerKernel { SqueezeQuantArg *quant_squeeze_param_; }; -int SqueezeInt8Run(void *cdata, int task_id); +int SqueezeInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale); } // namespace mindspore::kernel #endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_INT8_SQUEEZE_INT8_H_ diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/sub_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/sub_int8.cc index 1ceb3a5d2d9..052b10c1e24 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/sub_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/sub_int8.cc @@ -121,7 +121,7 @@ int SubInt8CPUKernel::DoExecute(int task_id) { return RET_OK; } -int SubInt8Run(void *cdata, int task_id) { +int SubInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto sub_kernel = reinterpret_cast(cdata); auto ret = sub_kernel->DoExecute(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/tanh_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/tanh_int8.cc index 394a323b403..1128ca6caa8 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/tanh_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/tanh_int8.cc @@ -56,7 +56,7 @@ int TanhInt8CPUKernel::DoActivation(int task_id) { return RET_OK; } -int TanhInt8Run(void *cdata, int task_id) { +int TanhInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto activation_kernel = reinterpret_cast(cdata); auto error_code = activation_kernel->DoActivation(task_id); if (error_code != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/transpose_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/transpose_int8.cc index 0ff973b6219..27a3e3f9a58 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/transpose_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/transpose_int8.cc @@ -30,7 +30,7 @@ int TransposeInt8CPUKernel::Init() { return ReSize(); } -int TransposeInt8Run(void *cdata, int task_id) { +int TransposeInt8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto transpose_int8 = reinterpret_cast(cdata); auto ret = transpose_int8->DoTranspose(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/unsqueeze_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/unsqueeze_int8.cc index f948129d2dd..de05cf193cf 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/unsqueeze_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/unsqueeze_int8.cc @@ -71,7 +71,7 @@ int Unsqueezeint8CPUKernel::DoUnsqueeze(int task_id) { return RET_OK; } -int UnsqueezeIn8Run(void *cdata, int task_id) { +int UnsqueezeIn8Run(void *cdata, int task_id, float lhs_scale, float rhs_scale) { auto g_kernel = reinterpret_cast(cdata); auto ret = g_kernel->DoUnsqueeze(task_id); if (ret != RET_OK) { diff --git a/mindspore/lite/src/runtime/parallel_executor.cc b/mindspore/lite/src/runtime/parallel_executor.cc index 95302b30bdf..1e75d1df42f 100644 --- a/mindspore/lite/src/runtime/parallel_executor.cc +++ b/mindspore/lite/src/runtime/parallel_executor.cc @@ -30,7 +30,7 @@ int ParallelExecutor::Prepare(const std::vector return RET_OK; } -static int RunKernel(void *data, int index) { +static int RunKernel(void *data, int index, float lhs_scale, float rhs_scale) { auto *executor = reinterpret_cast(data); auto kernel = executor->GetReadyKernel(index); auto ret = kernel->Execute();