SWDEV-389689 - Rework oversubscription test to use threads instead of process. Also consider system memory when oversubscribing (#317)

Change-Id: If063552e9e2815f07e944259237310f6fef37ad5

[ROCm/hip-tests commit: 329a350ec0]
Cette révision appartient à :
ROCm CI Service Account
2023-06-28 12:47:48 +05:30
révisé par GitHub
Parent 16eee59975
révision be8a0d7d2c
8 fichiers modifiés avec 180 ajouts et 231 suppressions
+13 -1
Voir le fichier
@@ -31,6 +31,8 @@ THE SOFTWARE.
#include <random>
#include <fstream>
#include <streambuf>
#include <thread>
#include <future>
namespace hip {
/*
@@ -46,6 +48,7 @@ class SpawnProc {
std::string exeName;
std::string resultStr;
std::string tmpFileName;
std::future<int> ret_from_run;
bool captureOutput;
std::string getRandomString(size_t len = 6) {
@@ -68,7 +71,7 @@ class SpawnProc {
exeName = dir.string();
// On Windows, fs::exists returns false without extension.
if (TestContext::get().isWindows()) {
if(fs::path(exeName).extension().empty()) {
if (fs::path(exeName).extension().empty()) {
exeName += ".exe";
}
}
@@ -112,6 +115,15 @@ class SpawnProc {
#endif
}
void run_async(std::string commandLineArgs = "") {
ret_from_run = std::async(std::launch::async, &hip::SpawnProc::run, this, commandLineArgs);
}
int wait() {
ret_from_run.wait();
return ret_from_run.get();
}
std::string getOutput() { return resultStr; }
};
} // namespace hip