Lines Matching +full:- +full:- +full:cpus
2 * Copyright (c) 2021-2023 Arm Limited.
4 * SPDX-License-Identifier: MIT
66 /** Extract MIDR using CPUID information that are exposed to user-space
68 * @param[in] max_num_cpus Maximum number of possible CPUs
74 std::vector<uint32_t> cpus; in midr_from_cpuid() local
85 … cpus.emplace_back(support::cpp11::stoul(line, nullptr, support::cpp11::NumericBase::BASE_16)); in midr_from_cpuid()
89 return cpus; in midr_from_cpuid()
92 /** Extract MIDR by parsing the /proc/cpuinfo meta-data
94 * @param[in] max_num_cpus Maximum number of possible CPUs
100 std::vector<uint32_t> cpus; in midr_from_proc_cpuinfo() local
115 // If "long-form" cpuinfo is present, parse that to populate models. in midr_from_proc_cpuinfo()
129 int curcpu = -1; in midr_from_proc_cpuinfo()
137 std::string id = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so)); in midr_from_proc_cpuinfo()
142 … // Matched a new CPU ID without any description of the previous one - looks like old format. in midr_from_proc_cpuinfo()
148 cpus.emplace_back(midr); in midr_from_proc_cpuinfo()
164 std::string subexp = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so)); in midr_from_proc_cpuinfo()
174 std::string subexp = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so)); in midr_from_proc_cpuinfo()
184 std::string subexp = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so)); in midr_from_proc_cpuinfo()
194 std::string subexp = line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so)); in midr_from_proc_cpuinfo()
205 cpus.emplace_back(midr); in midr_from_proc_cpuinfo()
220 return cpus; in midr_from_proc_cpuinfo()
223 /** Get the maximim number of CPUs in the system by parsing /sys/devices/system/cpu/present
225 * @return int Maximum number of CPUs
241 * 0-5, or 1-3,5,7 or similar. As we are interested in the in get_max_cpus()
243 * delimiter ('-' or ',') and parse the integer immediately after that. in get_max_cpus()
249 if(*i == '-' || *i == ',') in get_max_cpus()
298 CpuInfo::CpuInfo(CpuIsaInfo isa, std::vector<CpuModel> cpus) in CpuInfo() argument
299 : _isa(std::move(isa)), _cpus(std::move(cpus)) in CpuInfo()
331 [](uint32_t midr) -> CpuModel { return midr_to_model(midr); }); in build()
397 std::vector<std::string> cpus; in num_threads_hint() local
398 cpus.reserve(64); in num_threads_hint()
417 cpus.emplace_back(line.substr(match[1].rm_so, (match[1].rm_eo - match[1].rm_so))); in num_threads_hint()
424 std::sort(std::begin(cpus), std::end(cpus)); in num_threads_hint()
425 auto least_frequent_cpu_occurences = [](const std::vector<std::string> &cpus) -> uint32_t in num_threads_hint()
428 for(const auto &cpu : cpus) in num_threads_hint()
433 uint32_t vmin = cpus.size() + 1; in num_threads_hint()
442 …num_threads_hint = cpus.empty() ? std::thread::hardware_concurrency() : least_frequent_cpu_occuren… in num_threads_hint()