提交 915d38c2 编写于 作者: 李滨

Merge branch 'master' into 'master'

Fix openmp get core count bug

See merge request !677
...@@ -36,7 +36,6 @@ namespace mace { ...@@ -36,7 +36,6 @@ namespace mace {
namespace { namespace {
#ifndef MACE_ENABLE_OPENMP
int GetCPUCount() { int GetCPUCount() {
char path[32]; char path[32];
int cpu_count = 0; int cpu_count = 0;
...@@ -54,7 +53,6 @@ int GetCPUCount() { ...@@ -54,7 +53,6 @@ int GetCPUCount() {
cpu_count++; cpu_count++;
} }
} }
#endif
int GetCPUMaxFreq(int cpu_id) { int GetCPUMaxFreq(int cpu_id) {
char path[64]; char path[64];
...@@ -98,11 +96,7 @@ MaceStatus GetCPUBigLittleCoreIDs(std::vector<int> *big_core_ids, ...@@ -98,11 +96,7 @@ MaceStatus GetCPUBigLittleCoreIDs(std::vector<int> *big_core_ids,
std::vector<int> *little_core_ids) { std::vector<int> *little_core_ids) {
MACE_CHECK_NOTNULL(big_core_ids); MACE_CHECK_NOTNULL(big_core_ids);
MACE_CHECK_NOTNULL(little_core_ids); MACE_CHECK_NOTNULL(little_core_ids);
#ifdef MACE_ENABLE_OPENMP
int cpu_count = omp_get_num_procs();
#else
int cpu_count = GetCPUCount(); int cpu_count = GetCPUCount();
#endif
std::vector<int> cpu_max_freq(cpu_count); std::vector<int> cpu_max_freq(cpu_count);
// set cpu max frequency // set cpu max frequency
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册