aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CPUUtils.cpp
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2018-05-24 11:40:15 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:52:54 +0000
commit65f9982e99a6d9bea8084b7e15bc6c72ff535d8b (patch)
tree32a8871f4ee8ca43495e9588e4f46ba06c1bf77a /src/runtime/CPUUtils.cpp
parent1fad27af728ac73f0635994abf042b6d9e7075c6 (diff)
downloadComputeLibrary-65f9982e99a6d9bea8084b7e15bc6c72ff535d8b.tar.gz
COMPMID-1038: stoi and stoul cleanup.
Change-Id: I0d981a06655cdd86c71fddbd07303d781577d0fd Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/132620 Reviewed-by: Giorgio Arena <giorgio.arena@arm.com> Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/CPUUtils.cpp')
-rw-r--r--src/runtime/CPUUtils.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/runtime/CPUUtils.cpp b/src/runtime/CPUUtils.cpp
index 7e8bf2bb3f..cf29ce0053 100644
--- a/src/runtime/CPUUtils.cpp
+++ b/src/runtime/CPUUtils.cpp
@@ -126,7 +126,7 @@ void populate_models_cpuid(std::vector<PerCPUData> &cpusv)
std::string line;
if(bool(getline(file, line)))
{
- const unsigned long midr = support::cpp11::stoul(line, nullptr, 16);
+ const unsigned long midr = support::cpp11::stoul(line, nullptr, support::cpp11::NumericBase::BASE_16);
c.midr = (midr & 0xffffffff);
c.model = midr_to_model(c.midr);
c.model_set = true;
@@ -160,7 +160,7 @@ void populate_models_cpuinfo(std::vector<PerCPUData> &cpusv)
if(std::regex_match(line, match, proc_regex))
{
std::string id = match[1];
- int newcpu = support::cpp11::stoi(id, nullptr, 0);
+ int newcpu = support::cpp11::stoi(id, nullptr);
if(curcpu >= 0 && midr == 0)
{
@@ -183,28 +183,28 @@ void populate_models_cpuinfo(std::vector<PerCPUData> &cpusv)
if(std::regex_match(line, match, imp_regex))
{
- int impv = support::cpp11::stoi(match[1], nullptr, 16);
+ int impv = support::cpp11::stoi(match[1], nullptr, support::cpp11::NumericBase::BASE_16);
midr |= (impv << 24);
continue;
}
if(std::regex_match(line, match, var_regex))
{
- int varv = support::cpp11::stoi(match[1], nullptr, 16);
+ int varv = support::cpp11::stoi(match[1], nullptr, support::cpp11::NumericBase::BASE_16);
midr |= (varv << 16);
continue;
}
if(std::regex_match(line, match, part_regex))
{
- int partv = support::cpp11::stoi(match[1], nullptr, 16);
+ int partv = support::cpp11::stoi(match[1], nullptr, support::cpp11::NumericBase::BASE_16);
midr |= (partv << 4);
continue;
}
if(std::regex_match(line, match, rev_regex))
{
- int regv = support::cpp11::stoi(match[1], nullptr, 10);
+ int regv = support::cpp11::stoi(match[1], nullptr);
midr |= (regv);
midr |= (0xf << 16);
continue;
@@ -251,7 +251,7 @@ int get_max_cpus()
line.erase(line.begin(), startfrom);
- max_cpus = support::cpp11::stoi(line, nullptr, 0) + 1;
+ max_cpus = support::cpp11::stoi(line, nullptr) + 1;
success = true;
}
}
@@ -262,7 +262,6 @@ int get_max_cpus()
max_cpus = std::thread::hardware_concurrency();
}
#endif /* BARE_METAL */
-
return max_cpus;
}
#endif /* !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) */