5#ifndef FLUTTER_FML_CPU_AFFINITY_H_
6#define FLUTTER_FML_CPU_AFFINITY_H_
78 std::vector<CpuIndexAndSpeed> cpu_speeds_;
79 std::vector<size_t> efficiency_;
80 std::vector<size_t> performance_;
81 std::vector<size_t> not_performance_;
A class that computes the correct CPU indices for a requested CPU affinity.
const std::vector< size_t > & GetIndices(CpuAffinity affinity) const
Return the set of CPU indices for the requested CPU affinity.
bool IsValid() const
The class is valid if it has more than one CPU index and a distinct set of efficiency or performance ...
@ kPerformance
Request CPU affinity for the performance cores.
@ kEfficiency
Request CPU affinity for the efficiency cores.
@ kNotPerformance
Request affinity for all non-performance cores.
std::optional< int64_t > ReadIntFromFile(const std::string &path)
bool RequestAffinity(CpuAffinity affinity)
Request the given affinity for the current thread.
std::optional< size_t > EfficiencyCoreCount()
Request count of efficiency cores.