!7378 bind core api change

Merge pull request !7378 from zhaodezan/master
This commit is contained in:
mindspore-ci-bot 2020-10-16 15:42:07 +08:00 committed by Gitee
commit e52588285b
3 changed files with 8 additions and 9 deletions

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.

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.

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;
@ -573,7 +572,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) {