Browse Source

core api change

tags/v1.1.0
zhaodezan 5 years ago
parent
commit
f160906698
3 changed files with 8 additions and 9 deletions
  1. +2
    -2
      mindspore/lite/internal/include/context.h
  2. +3
    -3
      mindspore/lite/src/runtime/thread_pool.h
  3. +3
    -4
      mindspore/lite/tools/benchmark/benchmark.cc

+ 2
- 2
mindspore/lite/internal/include/context.h View File

@@ -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.


+ 3
- 3
mindspore/lite/src/runtime/thread_pool.h View File

@@ -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.


+ 3
- 4
mindspore/lite/tools/benchmark/benchmark.cc View File

@@ -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) {


Loading…
Cancel
Save