diff --git a/mindspore/lite/internal/include/context.h b/mindspore/lite/internal/include/context.h index df6b51c7bd..fcb1f03fd2 100644 --- a/mindspore/lite/internal/include/context.h +++ b/mindspore/lite/internal/include/context.h @@ -19,9 +19,9 @@ /// \brief CpuBindMode defined for holding bind cpu strategy argument. typedef enum { - MID_CPU = -1, /**< bind middle cpu first */ + NO_BIND = 0, /**< no bind */ HIGHER_CPU = 1, /**< bind higher cpu first */ - NO_BIND = 0 /**< no bind */ + MID_CPU = 2 /**< bind middle cpu first */ } CpuBindMode; /// \brief DeviceType defined for holding user's preferred backend. diff --git a/mindspore/lite/src/runtime/thread_pool.h b/mindspore/lite/src/runtime/thread_pool.h index 76028150e7..e848b6be71 100644 --- a/mindspore/lite/src/runtime/thread_pool.h +++ b/mindspore/lite/src/runtime/thread_pool.h @@ -23,9 +23,9 @@ /// \brief BindMode defined for holding bind cpu strategy argument. typedef enum { - MID_MODE = -1, /**< bind middle cpu first */ - HIGHER_MODE = 1, /**< bind higher cpu first */ - NO_BIND_MODE = 0 /**< no bind */ + NO_BIND_MODE = 0, /**< no bind */ + HIGHER_MODE = 1, /**< bind higher cpu first */ + MID_MODE = 2 /**< bind middle cpu first */ } BindMode; /// \brief ThreadPoolId defined for specifying which thread pool to use. diff --git a/mindspore/lite/tools/benchmark/benchmark.cc b/mindspore/lite/tools/benchmark/benchmark.cc index 8cf7b692e3..17030812c1 100644 --- a/mindspore/lite/tools/benchmark/benchmark.cc +++ b/mindspore/lite/tools/benchmark/benchmark.cc @@ -281,7 +281,6 @@ int Benchmark::MarkPerformance() { time_min = std::min(time_min, time); time_max = std::max(time_max, time); time_avg += time; - session_->BindThread(false); } @@ -385,9 +384,9 @@ int Benchmark::RunBenchmark() { context->device_type_ = lite::DT_GPU; } - if (flags_->cpu_bind_mode_ == -1) { + if (flags_->cpu_bind_mode_ == 2) { context->cpu_bind_mode_ = MID_CPU; - } else if (flags_->cpu_bind_mode_ == 0) { + } else if (flags_->cpu_bind_mode_ == 1) { context->cpu_bind_mode_ = HIGHER_CPU; } else { context->cpu_bind_mode_ = NO_BIND; @@ -549,7 +548,7 @@ int Benchmark::Init() { return RET_ERROR; } - if (this->flags_->cpu_bind_mode_ == -1) { + if (this->flags_->cpu_bind_mode_ == 2) { MS_LOG(INFO) << "cpuBindMode = MID_CPU"; std::cout << "cpuBindMode = MID_CPU" << std::endl; } else if (this->flags_->cpu_bind_mode_ == 1) {