aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2018-03-14 17:55:27 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:16 +0000
commit7fad9b1d00f3ee1488ba4038d1371f6ea219f8b7 (patch)
treeded71e1cfa8e0c085f8bce5dfc26a99786d60e52 /support
parent1562be3e8a449360a90af75f6f1481a30d41be75 (diff)
downloadComputeLibrary-7fad9b1d00f3ee1488ba4038d1371f6ea219f8b7.tar.gz
COMPMID-1021: CPUInfo refactoring.
Removed CPUTarget in favor of the CPUModel type. CPUInfo now holds a vector of N CPUs. CPUInfo autoinitialise upon construction with 1 GENERIC CPU. CPPScheduler fills CPUInfo's vector upon construction (runtime). IScheduler has a single CPUInfo obj and ThreadInfo always gets a pointer to it (avoid copying the vector) Change-Id: I30f293258c959c87f6bac5eac8b963beb6a4d365 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/124626 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'support')
-rw-r--r--support/ToolchainSupport.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h
index cb156f39c7..88c17009cc 100644
--- a/support/ToolchainSupport.h
+++ b/support/ToolchainSupport.h
@@ -69,12 +69,17 @@ inline std::string to_string(T && value)
*
* @return Integer representation of @p str.
*/
-inline int stoi(const std::string &str)
+inline int stoi(const std::string &str, std::size_t *pos = 0, int base = 10)
{
- std::stringstream stream(str);
- int value = 0;
- stream >> value;
- return value;
+ unsigned int x;
+ std::stringstream ss;
+ if(base == 16)
+ {
+ ss << std::hex;
+ }
+ ss << str;
+ ss >> x;
+ return x;
}
/** Convert string values to unsigned long.
@@ -86,10 +91,15 @@ inline int stoi(const std::string &str)
*
* @return Unsigned long representation of @p str.
*/
-inline unsigned long stoul(const std::string &str)
+inline unsigned long stoul(const std::string &str, std::size_t *pos = 0, int base = 10)
{
- std::stringstream stream(str);
+ std::stringstream stream;
unsigned long value = 0;
+ if(base == 16)
+ {
+ stream << std::hex;
+ }
+ stream << str;
stream >> value;
return value;
}