MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / get_cpu_capacities

Function get_cpu_capacities

src/common/cpuinfo/CpuInfo.cpp:291–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290#if defined(__ANDROID__)
291std::vector<uint32_t> get_cpu_capacities()
292{
293 std::vector<uint32_t> cpu_capacities;
294 for (int i = 0; i < get_max_cpus(); ++i)
295 {
296 std::stringstream str;
297 str << "/sys/devices/system/cpu/cpu" << i << "/cpu_capacity";
298 std::ifstream file(str.str(), std::ios::in);
299 if (file.is_open())
300 {
301 std::string line;
302 if (bool(getline(file, line)))
303 {
304 cpu_capacities.emplace_back(support::cpp11::stoul(line));
305 }
306 }
307 }
308
309 return cpu_capacities;
310}
311
312uint32_t not_little_num_cpus_internal()
313{

Callers 1

Calls 4

get_max_cpusFunction · 0.85
stoulFunction · 0.85
strMethod · 0.80
is_openMethod · 0.45

Tested by

no test coverage detected