Temporary change to namespaces to adjust for smi change
Change-Id: Ic91bfb678912a82214f0a462a4b57e531f12977a
[ROCm/ROCR-Runtime commit: 50a3d9402a]
Этот коммит содержится в:
@@ -59,17 +59,22 @@
|
||||
|
||||
#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<rocrtst::smi::Device> &d,
|
||||
static bool GetMonitorDevices(const std::shared_ptr<smi::Device> &d,
|
||||
void *p) {
|
||||
std::string val_str;
|
||||
|
||||
assert(p != nullptr);
|
||||
|
||||
std::vector<std::shared_ptr<rocrtst::smi::Device>> *device_list =
|
||||
reinterpret_cast<std::vector<std::shared_ptr<rocrtst::smi::Device>> *>(p);
|
||||
std::vector<std::shared_ptr<smi::Device>> *device_list =
|
||||
reinterpret_cast<std::vector<std::shared_ptr<smi::Device>> *>(p);
|
||||
|
||||
if (d->monitor() != nullptr) {
|
||||
device_list->push_back(d);
|
||||
@@ -200,7 +205,7 @@ int main(int argc, char** argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
rocrtst::smi::RocmSMI hw;
|
||||
smi::RocmSMI hw;
|
||||
hw.DiscoverDevices();
|
||||
hw.IterateSMIDevices(
|
||||
GetMonitorDevices, reinterpret_cast<void *>(&settings.monitor_devices));
|
||||
|
||||
@@ -52,6 +52,11 @@
|
||||
#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);
|
||||
@@ -81,17 +86,17 @@ class TestBase : public rocrtst::BaseRocR {
|
||||
void set_description(std::string d);
|
||||
|
||||
void set_monitor_devices(
|
||||
std::vector<std::shared_ptr<rocrtst::smi::Device>> *m) {
|
||||
std::vector<std::shared_ptr<smi::Device>> *m) {
|
||||
monitor_devices_ = m;
|
||||
}
|
||||
std::vector<std::shared_ptr<rocrtst::smi::Device>> *
|
||||
std::vector<std::shared_ptr<smi::Device>> *
|
||||
monitor_devices(void) const {
|
||||
return monitor_devices_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string description_;
|
||||
std::vector<std::shared_ptr<rocrtst::smi::Device>> *monitor_devices_;
|
||||
std::vector<std::shared_ptr<smi::Device>> *monitor_devices_;
|
||||
};
|
||||
|
||||
#endif // ROCRTST_SUITES_TEST_COMMON_TEST_BASE_H_
|
||||
|
||||
@@ -322,7 +322,7 @@ void TestExample::Run(void) {
|
||||
int id = p_timer.CreateTimer();
|
||||
p_timer.StartTimer(id);
|
||||
|
||||
AtomicSetPacketHeader(aql_header, aql().setup, queue_aql_packet);
|
||||
::AtomicSetPacketHeader(aql_header, aql().setup, queue_aql_packet);
|
||||
|
||||
hsa_signal_store_screlease(main_queue()->doorbell_signal, index);
|
||||
|
||||
|
||||
@@ -53,6 +53,11 @@
|
||||
#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'},
|
||||
@@ -149,7 +154,7 @@ void DumpMonitorInfo(const TestBase *test) {
|
||||
std::cout.setf(std::ios::dec, std::ios::basefield);
|
||||
for (auto dev : *test->monitor_devices()) {
|
||||
auto print_vector =
|
||||
[&](rocrtst::smi::DevInfoTypes type, std::string label) {
|
||||
[&](smi::DevInfoTypes type, std::string label) {
|
||||
ret = dev->readDevInfo(type, &val_vec);
|
||||
if (print_attr_label(label)) {
|
||||
for (auto vs : val_vec) {
|
||||
@@ -159,7 +164,7 @@ void DumpMonitorInfo(const TestBase *test) {
|
||||
}
|
||||
};
|
||||
auto print_val_str =
|
||||
[&](rocrtst::smi::DevInfoTypes type, std::string label) {
|
||||
[&](smi::DevInfoTypes type, std::string label) {
|
||||
ret = dev->readDevInfo(type, &val_str);
|
||||
|
||||
std::cout << "\t** " << label;
|
||||
@@ -171,30 +176,30 @@ void DumpMonitorInfo(const TestBase *test) {
|
||||
std::cout << std:: endl;
|
||||
};
|
||||
|
||||
print_val_str(rocrtst::smi::kDevDevID, "Device ID: ");
|
||||
print_val_str(rocrtst::smi::kDevPerfLevel, "Performance Level: ");
|
||||
print_val_str(rocrtst::smi::kDevOverDriveLevel, "OverDrive Level: ");
|
||||
print_vector(rocrtst::smi::kDevGPUMClk,
|
||||
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,
|
||||
"Supported GPU Memory clock frequencies:\n");
|
||||
print_vector(rocrtst::smi::kDevGPUSClk,
|
||||
print_vector(smi::kDevGPUSClk,
|
||||
"Supported GPU clock frequencies:\n");
|
||||
|
||||
if (dev->monitor() != nullptr) {
|
||||
ret = dev->monitor()->readMonitor(rocrtst::smi::kMonName, &val_str);
|
||||
ret = dev->monitor()->readMonitor(smi::kMonName, &val_str);
|
||||
if (print_attr_label("Monitor name: ")) {
|
||||
std::cout << val_str << std::endl;
|
||||
}
|
||||
|
||||
ret = dev->monitor()->readMonitor(rocrtst::smi::kMonTemp, &value);
|
||||
ret = dev->monitor()->readMonitor(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(rocrtst::smi::kMonMaxFanSpeed, &value);
|
||||
ret = dev->monitor()->readMonitor(smi::kMonMaxFanSpeed, &value);
|
||||
if (ret == 0) {
|
||||
ret = dev->monitor()->readMonitor(rocrtst::smi::kMonFanSpeed, &value2);
|
||||
ret = dev->monitor()->readMonitor(smi::kMonFanSpeed, &value2);
|
||||
}
|
||||
if (print_attr_label("Current Fan Speed: ")) {
|
||||
std::cout << value2/static_cast<float>(value) * 100 << "% (" <<
|
||||
|
||||
@@ -51,11 +51,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;
|
||||
|
||||
struct RocrTstGlobals {
|
||||
uint32_t verbosity;
|
||||
uint32_t monitor_verbosity;
|
||||
uint32_t num_iterations;
|
||||
std::vector<std::shared_ptr<rocrtst::smi::Device>> monitor_devices;
|
||||
std::vector<std::shared_ptr<smi::Device>> monitor_devices;
|
||||
};
|
||||
|
||||
uint32_t ProcessCmdline(RocrTstGlobals* test, int arg_cnt, char** arg_list);
|
||||
|
||||
Ссылка в новой задаче
Block a user