mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Don't use the entire std namespace
Change-Id: I2014117a154fb2c1a61af5c31baa228b4fb3dbc2 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
6de2b4e1cd
commit
441ff1fcdf
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "shared/source/utilities/debug_file_reader.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -32,7 +31,7 @@ SettingsFileReader::~SettingsFileReader() {
|
||||
int32_t SettingsFileReader::getSetting(const char *settingName, int32_t defaultValue) {
|
||||
int32_t value = defaultValue;
|
||||
|
||||
map<string, string>::iterator it = settingStringMap.find(string(settingName));
|
||||
std::map<std::string, std::string>::iterator it = settingStringMap.find(std::string(settingName));
|
||||
if (it != settingStringMap.end()) {
|
||||
value = atoi(it->second.c_str());
|
||||
}
|
||||
@@ -46,7 +45,7 @@ bool SettingsFileReader::getSetting(const char *settingName, bool defaultValue)
|
||||
|
||||
std::string SettingsFileReader::getSetting(const char *settingName, const std::string &value) {
|
||||
std::string returnValue = value;
|
||||
map<string, string>::iterator it = settingStringMap.find(string(settingName));
|
||||
std::map<std::string, std::string>::iterator it = settingStringMap.find(std::string(settingName));
|
||||
if (it != settingStringMap.end())
|
||||
returnValue = it->second;
|
||||
|
||||
@@ -58,14 +57,14 @@ const char *SettingsFileReader::appSpecificLocation(const std::string &name) {
|
||||
}
|
||||
|
||||
void SettingsFileReader::parseStream(std::istream &inputStream) {
|
||||
stringstream ss;
|
||||
string key;
|
||||
string value;
|
||||
std::stringstream ss;
|
||||
std::string key;
|
||||
std::string value;
|
||||
char temp = 0;
|
||||
|
||||
while (!inputStream.eof()) {
|
||||
string tempString;
|
||||
string tempStringValue;
|
||||
std::string tempString;
|
||||
std::string tempStringValue;
|
||||
getline(inputStream, tempString);
|
||||
|
||||
ss << tempString;
|
||||
@@ -74,10 +73,10 @@ void SettingsFileReader::parseStream(std::istream &inputStream) {
|
||||
ss >> value;
|
||||
|
||||
if (!ss.fail()) {
|
||||
settingStringMap.insert(pair<string, string>(key, value));
|
||||
settingStringMap.insert(std::pair<std::string, std::string>(key, value));
|
||||
}
|
||||
|
||||
ss.str(string()); // for reset string inside stringstream
|
||||
ss.str(std::string()); // for reset string inside stringstream
|
||||
ss.clear();
|
||||
key.clear();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -63,12 +62,12 @@ PerfProfiler::PerfProfiler(int id, std::unique_ptr<std::ostream> logOut, std::un
|
||||
if (logOut != nullptr) {
|
||||
this->logFile = std::move(logOut);
|
||||
} else {
|
||||
stringstream filename;
|
||||
std::stringstream filename;
|
||||
filename << "PerfReport_Thread_" << id << ".xml";
|
||||
|
||||
std::unique_ptr<std::ofstream> logToFile = std::unique_ptr<std::ofstream>(new std::ofstream());
|
||||
logToFile->exceptions(std::ios::failbit | std::ios::badbit);
|
||||
logToFile->open(filename.str().c_str(), ios::trunc);
|
||||
logToFile->open(filename.str().c_str(), std::ios::trunc);
|
||||
this->logFile = std::move(logToFile);
|
||||
}
|
||||
|
||||
@@ -77,12 +76,12 @@ PerfProfiler::PerfProfiler(int id, std::unique_ptr<std::ostream> logOut, std::un
|
||||
if (sysLogOut != nullptr) {
|
||||
this->sysLogFile = std::move(sysLogOut);
|
||||
} else {
|
||||
stringstream filename;
|
||||
std::stringstream filename;
|
||||
filename << "SysPerfReport_Thread_" << id << ".xml";
|
||||
|
||||
std::unique_ptr<std::ofstream> sysLogToFile = std::unique_ptr<std::ofstream>(new std::ofstream());
|
||||
sysLogToFile->exceptions(std::ios::failbit | std::ios::badbit);
|
||||
sysLogToFile->open(filename.str().c_str(), ios::trunc);
|
||||
sysLogToFile->open(filename.str().c_str(), std::ios::trunc);
|
||||
this->sysLogFile = std::move(sysLogToFile);
|
||||
}
|
||||
|
||||
@@ -160,7 +159,7 @@ void PerfProfiler::SysLogBuilder::read(std::istream &str, long long &start, unsi
|
||||
}
|
||||
|
||||
void PerfProfiler::logTimes(long long start, long long end, long long span, unsigned long long totalSystem, const char *function) {
|
||||
stringstream str;
|
||||
std::stringstream str;
|
||||
LogBuilder::write(str, start, end, span, totalSystem, function);
|
||||
*logFile << str.str();
|
||||
logFile->flush();
|
||||
|
||||
Reference in New Issue
Block a user