SWDEV-298757 - Moved long running tests into stress category. (#2461)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user