By default, only consider AMD GPU's in RSMI device list
With newly added initialization parameters that can be passed to rsmi_init(), you can tell RSMI to consider other devices. Also: -fixed incorrect header file name that would break in C builds -modified rsmi_init() and rsmi_shut_down() to reinitialize and clear static structures
Этот коммит содержится в:
1 родитель
34c977bd06
Коммит
1dfef717bb
9 files changed
+120
-23
No files matched your search
@@ -138,7 +138,7 @@ void TestPciReadWrite::Run(void) {
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\tInitial PCIe is " << bw.transfer_rate.current <<
|
||||
std::cout << "\tInitial PCIe BW index is " << bw.transfer_rate.current <<
|
||||
std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
|
||||
#include "rocm_smi/rocm_smi.h"
|
||||
#include "gtest/gtest.h"
|
||||
@@ -79,6 +80,7 @@ static void SetFlags(TestBase *test) {
|
||||
|
||||
test->set_verbosity(sRSMIGlvalues->verbosity);
|
||||
test->set_dont_fail(sRSMIGlvalues->dont_fail);
|
||||
test->set_init_options(sRSMIGlvalues->init_options);
|
||||
}
|
||||
|
||||
|
||||
@@ -207,10 +209,30 @@ int main(int argc, char** argv) {
|
||||
settings.monitor_verbosity = 1;
|
||||
settings.num_iterations = 1;
|
||||
settings.dont_fail = false;
|
||||
settings.init_options = 0;
|
||||
|
||||
if (ProcessCmdline(&settings, argc, argv)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ret = 0;
|
||||
sRSMIGlvalues = &settings;
|
||||
ret = RUN_ALL_TESTS();
|
||||
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
settings.init_options = RSMI_INIT_FLAG_ALL_GPUS;
|
||||
|
||||
std::cout << "****************************************" << std::endl;
|
||||
std::cout << "****************************************" << std::endl;
|
||||
std::cout << "****************************************" << std::endl;
|
||||
std::cout << "Re-running tests with init options: " << std::hex <<
|
||||
settings.init_options << std::endl;
|
||||
std::cout << "****************************************" << std::endl;
|
||||
std::cout << "****************************************" << std::endl;
|
||||
std::cout << "****************************************" << std::endl;
|
||||
settings.init_options = RSMI_INIT_FLAG_ALL_GPUS;
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
@@ -84,7 +84,7 @@ void TestBase::SetUp(void) {
|
||||
MakeHeaderStr(kSetupLabel, &label);
|
||||
printf("\n\t%s\n", label.c_str());
|
||||
|
||||
err = rsmi_init(0);
|
||||
err = rsmi_init(init_options());
|
||||
ASSERT_EQ(err, RSMI_STATUS_SUCCESS);
|
||||
|
||||
err = rsmi_num_monitor_devices(&num_monitor_devs_);
|
||||
|
||||
@@ -99,6 +99,12 @@ class TestBase {
|
||||
uint32_t num_monitor_devs(void) const {
|
||||
return num_monitor_devs_;
|
||||
}
|
||||
void set_init_options(uint64_t x) {
|
||||
init_options_ = x;
|
||||
}
|
||||
uint64_t init_options(void) const {
|
||||
return init_options_;
|
||||
}
|
||||
|
||||
protected:
|
||||
void PrintDeviceHeader(uint32_t dv_ind);
|
||||
@@ -109,6 +115,7 @@ class TestBase {
|
||||
std::string title_; ///< Displayed title of test
|
||||
uint32_t verbosity_; ///< How much additional output to produce
|
||||
bool dont_fail_; ///< Don't quit test on individual failure if true
|
||||
uint64_t init_options_; ///< rsmi initialization options
|
||||
};
|
||||
|
||||
#define IF_VERB(VB) if (verbosity() && verbosity() >= (TestBase::VERBOSE_##VB))
|
||||
|
||||
@@ -55,6 +55,7 @@ struct RSMITstGlobals {
|
||||
uint32_t verbosity;
|
||||
uint32_t monitor_verbosity;
|
||||
uint32_t num_iterations;
|
||||
uint64_t init_options;
|
||||
bool dont_fail;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user