A class that computes the correct CPU indices for a requested CPU affinity. More...
#include <cpu_affinity.h>
Public Member Functions | |
| CPUSpeedTracker (std::vector< CpuIndexAndSpeed > data) | |
| bool | IsValid () const |
| The class is valid if it has more than one CPU index and a distinct set of efficiency or performance CPUs. | |
| const std::vector< size_t > & | GetIndices (CpuAffinity affinity) const |
| Return the set of CPU indices for the requested CPU affinity. | |
A class that computes the correct CPU indices for a requested CPU affinity.
Definition at line 64 of file cpu_affinity.h.
|
explicit |
Definition at line 35 of file cpu_affinity.cc.
References data.
| const std::vector< size_t > & fml::CPUSpeedTracker::GetIndices | ( | CpuAffinity | affinity | ) | const |
Return the set of CPU indices for the requested CPU affinity.
If the tracker is valid, this will always return a non-empty set.
Definition at line 74 of file cpu_affinity.cc.
References fml::kEfficiency, fml::kNotEfficiency, fml::kNotPerformance, and fml::kPerformance.
Referenced by fml::AndroidEfficiencyCoreCount(), and fml::AndroidRequestAffinity().
| bool fml::CPUSpeedTracker::IsValid | ( | ) | const |
The class is valid if it has more than one CPU index and a distinct set of efficiency or performance CPUs.
If all CPUs are the same speed this returns false, and all requests to set affinity are ignored.
Definition at line 70 of file cpu_affinity.cc.
Referenced by fml::SetUpCPUTracker().