File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1584,7 +1584,7 @@ static void initialize_cpu_thread_affinity_mask(ncnn::CpuSet& mask_all, ncnn::Cp
15841584 }
15851585
15861586 // A map from processor number to whether it is an E core
1587- std::vector<bool > processorCoreType (g_cpucount, false ) ;
1587+ std::vector<std::pair<DWORD, bool >> processorCoreType;
15881588 BYTE maxEfficiencyClass = 0 ; // In a system without E cores, all cores EfficiencyClass is 0
15891589
15901590 BYTE* ptr = buffer.data ();
@@ -1601,7 +1601,7 @@ static void initialize_cpu_thread_affinity_mask(ncnn::CpuSet& mask_all, ncnn::Cp
16011601 for (int bit = 0 ; bit < 64 ; ++bit) { // for each bit in the mask
16021602 if (mask & (static_cast <KAFFINITY>(1 ) << bit)) {
16031603 DWORD processorNumber = group * 64 + bit;
1604- processorCoreType[ processorNumber] = isECore;
1604+ processorCoreType. push_back (std::pair<DWORD, bool >( processorNumber, isECore)) ;
16051605 }
16061606 }
16071607 }
@@ -1616,7 +1616,16 @@ static void initialize_cpu_thread_affinity_mask(ncnn::CpuSet& mask_all, ncnn::Cp
16161616 }
16171617 else {
16181618 for (int i = 0 ; i < g_cpucount; i++) {
1619- if (processorCoreType[i]) {
1619+ bool isECore = false ;
1620+ for (auto & p : processorCoreType) {
1621+ if (p.first == i) {
1622+ isECore = p.second ;
1623+ break ;
1624+ }
1625+ }
1626+ // fprintf(stderr, "processor %d is %s\n", i, isECore ? "E" : "P");
1627+
1628+ if (isECore) {
16201629 mask_little.enable (i);
16211630 }
16221631 else {
You can’t perform that action at this time.
0 commit comments