Undo temporary namespace change

Change-Id: I7f4c06f7037713db855b51367256cf4c7ba41860


[ROCm/ROCR-Runtime commit: 5a3230af66]
Esse commit está contido em:
Chris Freehill
2017-10-20 20:02:13 -05:00
commit 42bbc5ee85
4 arquivos alterados com 19 adições e 41 exclusões
@@ -59,22 +59,16 @@
#include "rocm_smi/rocm_smi.h"
// Temporary "using namespace" to transition from rocrtst::smi to amd::smi
// namespace amd { }
using namespace rocrtst;
using namespace amd;
static RocrTstGlobals *sRocrtstGlvalues = nullptr;
static bool GetMonitorDevices(const std::shared_ptr<smi::Device> &d,
static bool GetMonitorDevices(const std::shared_ptr<amd::smi::Device> &d,
void *p) {
std::string val_str;
assert(p != nullptr);
std::vector<std::shared_ptr<smi::Device>> *device_list =
reinterpret_cast<std::vector<std::shared_ptr<smi::Device>> *>(p);
std::vector<std::shared_ptr<amd::smi::Device>> *device_list =
reinterpret_cast<std::vector<std::shared_ptr<amd::smi::Device>> *>(p);
if (d->monitor() != nullptr) {
device_list->push_back(d);
@@ -205,7 +199,7 @@ int main(int argc, char** argv) {
return 1;
}
smi::RocmSMI hw;
amd::smi::RocmSMI hw;
hw.DiscoverDevices();
hw.IterateSMIDevices(
GetMonitorDevices, reinterpret_cast<void *>(&settings.monitor_devices));
@@ -52,11 +52,6 @@
#include "common/base_rocr.h"
#include "rocm_smi/rocm_smi.h"
// Temporary "using namespace" to transition from rocrtst::smi to amd::smi
// namespace amd { }
using namespace rocrtst;
using namespace amd;
class TestBase : public rocrtst::BaseRocR {
public:
TestBase(void);
@@ -86,17 +81,17 @@ class TestBase : public rocrtst::BaseRocR {
void set_description(std::string d);
void set_monitor_devices(
std::vector<std::shared_ptr<smi::Device>> *m) {
std::vector<std::shared_ptr<amd::smi::Device>> *m) {
monitor_devices_ = m;
}
std::vector<std::shared_ptr<smi::Device>> *
std::vector<std::shared_ptr<amd::smi::Device>> *
monitor_devices(void) const {
return monitor_devices_;
}
private:
std::string description_;
std::vector<std::shared_ptr<smi::Device>> *monitor_devices_;
std::vector<std::shared_ptr<amd::smi::Device>> *monitor_devices_;
};
#endif // ROCRTST_SUITES_TEST_COMMON_TEST_BASE_H_
@@ -53,12 +53,6 @@
#include "suites/test_common/test_base.h"
#include "suites/test_common/test_common.h"
// Temporary "using namespace" to transition from rocrtst::smi to amd::smi
// namespace amd { }
using namespace rocrtst;
using namespace amd;
static const struct option long_options[] = {
{"iterations", required_argument, nullptr, 'i'},
{"verbose", required_argument, nullptr, 'v'},
@@ -154,7 +148,7 @@ void DumpMonitorInfo(const TestBase *test) {
std::cout.setf(std::ios::dec, std::ios::basefield);
for (auto dev : *test->monitor_devices()) {
auto print_vector =
[&](smi::DevInfoTypes type, std::string label) {
[&](amd::smi::DevInfoTypes type, std::string label) {
ret = dev->readDevInfo(type, &val_vec);
if (print_attr_label(label)) {
for (auto vs : val_vec) {
@@ -164,7 +158,7 @@ void DumpMonitorInfo(const TestBase *test) {
}
};
auto print_val_str =
[&](smi::DevInfoTypes type, std::string label) {
[&](amd::smi::DevInfoTypes type, std::string label) {
ret = dev->readDevInfo(type, &val_str);
std::cout << "\t** " << label;
@@ -176,30 +170,30 @@ void DumpMonitorInfo(const TestBase *test) {
std::cout << std:: endl;
};
print_val_str(smi::kDevDevID, "Device ID: ");
print_val_str(smi::kDevPerfLevel, "Performance Level: ");
print_val_str(smi::kDevOverDriveLevel, "OverDrive Level: ");
print_vector(smi::kDevGPUMClk,
print_val_str(amd::smi::kDevDevID, "Device ID: ");
print_val_str(amd::smi::kDevPerfLevel, "Performance Level: ");
print_val_str(amd::smi::kDevOverDriveLevel, "OverDrive Level: ");
print_vector(amd::smi::kDevGPUMClk,
"Supported GPU Memory clock frequencies:\n");
print_vector(smi::kDevGPUSClk,
print_vector(amd::smi::kDevGPUSClk,
"Supported GPU clock frequencies:\n");
if (dev->monitor() != nullptr) {
ret = dev->monitor()->readMonitor(smi::kMonName, &val_str);
ret = dev->monitor()->readMonitor(amd::smi::kMonName, &val_str);
if (print_attr_label("Monitor name: ")) {
std::cout << val_str << std::endl;
}
ret = dev->monitor()->readMonitor(smi::kMonTemp, &value);
ret = dev->monitor()->readMonitor(amd::smi::kMonTemp, &value);
if (print_attr_label("Temperature: ")) {
std::cout << static_cast<float>(value)/1000.0 << "C" << std::endl;
}
std::cout.setf(std::ios::dec, std::ios::basefield);
ret = dev->monitor()->readMonitor(smi::kMonMaxFanSpeed, &value);
ret = dev->monitor()->readMonitor(amd::smi::kMonMaxFanSpeed, &value);
if (ret == 0) {
ret = dev->monitor()->readMonitor(smi::kMonFanSpeed, &value2);
ret = dev->monitor()->readMonitor(amd::smi::kMonFanSpeed, &value2);
}
if (print_attr_label("Current Fan Speed: ")) {
std::cout << value2/static_cast<float>(value) * 100 << "% (" <<
@@ -51,16 +51,11 @@
#include "rocm_smi/rocm_smi.h"
// Temporary "using namespace" to transition from rocrtst::smi to amd::smi
// namespace amd { }
using namespace rocrtst;
using namespace amd;
struct RocrTstGlobals {
uint32_t verbosity;
uint32_t monitor_verbosity;
uint32_t num_iterations;
std::vector<std::shared_ptr<smi::Device>> monitor_devices;
std::vector<std::shared_ptr<amd::smi::Device>> monitor_devices;
};
uint32_t ProcessCmdline(RocrTstGlobals* test, int arg_cnt, char** arg_list);