SWDEV-298757 - Moved long running tests into stress category. (#2461)

This commit is contained in:
lthakur
2022-02-24 01:28:08 +05:30
committed by GitHub
parent 990f546b38
commit 6e696a028b
3 changed files with 231 additions and 249 deletions
@@ -262,79 +262,3 @@ TEST_CASE("Unit_hipMallocManaged_AccessMultiStream") {
}
}
TEST_CASE("Unit_hipMallocManaged_ExtremeSizes") {
int managed = HmmAttrPrint();
if (managed == 1) {
bool IfTestPassed = true;
hipError_t err;
void *Hmm = NULL;
size_t totalDevMem = 0, freeDevMem = 0;
int NumDevs = 0;
HIP_CHECK(hipGetDeviceCount(&NumDevs));
// Testing allocation of extreme and unusual mem values
for (int i = 0; i < NumDevs; i++) {
HIP_CHECK(hipSetDevice(i));
HIP_CHECK(hipMemGetInfo(&freeDevMem, &totalDevMem));
err = hipMallocManaged(&Hmm, 1, hipMemAttachGlobal);
if (hipSuccess == err) {
HIP_CHECK(hipFree(Hmm));
} else {
WARN("Observed error while allocating memory on GPU: " << i);
WARN(" size 1 with");
WARN(" hipMallocManaged() api with flag 'hipMemAttachGlobal'\n");
WARN("Error: " << hipGetErrorString(err));
IfTestPassed = false;
}
err = hipMallocManaged(&Hmm, freeDevMem, hipMemAttachGlobal);
if (hipSuccess == err) {
HIP_CHECK(hipFree(Hmm));
} else {
WARN("Observed error while allocating max free memory on GPU: " << i);
WARN(" with hipMallocManaged() api with flag 'hipMemAttachGlobal'\n");
WARN("Error: " << hipGetErrorString(err));
IfTestPassed = false;
}
err = hipMallocManaged(&Hmm, (freeDevMem - 1), hipMemAttachGlobal);
if (hipSuccess == err) {
HIP_CHECK(hipFree(Hmm));
} else {
WARN("Observed error while allocating max (free - 1) memory on ");
WARN("GPU: " << i);
WARN(" using hipMallocManaged() api with flag 'hipMemAttachGlobal'\n");
WARN("Error: " << hipGetErrorString(err));
IfTestPassed = false;
}
err = hipMallocManaged(&Hmm, 1, hipMemAttachHost);
if (hipSuccess == err) {
HIP_CHECK(hipFree(Hmm));
} else {
WARN("Observed error while allocating memory size 1 on GPU: " << i);
WARN(" with hipMallocManaged() api with flag 'hipMemAttachHost'\n");
WARN("Error: " << hipGetErrorString(err));
IfTestPassed = false;
}
err = hipMallocManaged(&Hmm, freeDevMem, hipMemAttachHost);
if (hipSuccess == err) {
HIP_CHECK(hipFree(Hmm));
} else {
WARN("Observed error while allocating max free memory on GPU: " << i);
WARN(" with hipMallocManaged() api with flag 'hipMemAttachHost'\n");
WARN("Error: " << hipGetErrorString(err));
IfTestPassed = false;
}
err = hipMallocManaged(&Hmm, (freeDevMem - 1), hipMemAttachHost);
if (hipSuccess == err) {
HIP_CHECK(hipFree(Hmm));
} else {
WARN("Observed error while allocating max (freeDevMem - 1) memory"
" on GPU: " << i);
WARN(" with hipMallocManaged() api with flag 'hipMemAttachHost'\n");
WARN("Error: " << hipGetErrorString(err));
IfTestPassed = false;
}
}
REQUIRE(IfTestPassed);
} else {
SUCCEED("Gpu doesnt support HMM! Hence skipping the test with PASS result");
}
}