SWDEV-409113,SWDEV-409114,SWDEV-409112,SWDEV-409111,SWDEV-409110,SWDEV-409109,SWDEV-409096,SWDEV-409105 - Remove strong assumptions on hipMemGetInfo reported memory. (#373)

Change-Id: I6751e20690b93a3db35d98e45d295e5465387c5a
This commit is contained in:
ROCm CI Service Account
2023-07-20 10:20:05 +05:30
committed by GitHub
parent 74c143392b
commit b8fb6f88b9
5 changed files with 3 additions and 601 deletions
+1 -15
View File
@@ -31,9 +31,7 @@ static constexpr auto CHUNK_LOOP{100};
static constexpr auto BIG_SIZE{100};
/*
This API verifies hipMalloc3D API by allocating memory in smaller chunks for
CHUNK_LOOP iterations and checks for the memory leaks by get the memory
info before and after the hipMalloc3D API and the difference should
match with the allocated memory
CHUNK_LOOP iterations
*/
static void MemoryAlloc3DDiffSizes(int gpu) {
HIPCHECK(hipSetDevice(gpu));
@@ -53,10 +51,6 @@ static void MemoryAlloc3DDiffSizes(int gpu) {
for (int i = 0; i < CHUNK_LOOP; i++) {
HIPCHECK(hipFree(devPitchedPtr[i].ptr));
}
HIPCHECK(hipMemGetInfo(&avail, &tot));
if ((pavail != avail)) {
HIPASSERT(false);
}
}
}
@@ -95,8 +89,6 @@ TEST_CASE("Unit_hipMalloc3D_MultiThread") {
devCnt = HipTest::getDeviceCount();
size_t tot, avail, ptot, pavail;
HIP_CHECK(hipMemGetInfo(&pavail, &ptot));
for (int i = 0; i < devCnt; i++) {
threadlist.push_back(std::thread(Malloc3DThreadFunc, i));
}
@@ -104,10 +96,4 @@ TEST_CASE("Unit_hipMalloc3D_MultiThread") {
for (auto &t : threadlist) {
t.join();
}
HIP_CHECK(hipMemGetInfo(&avail, &tot));
if (pavail != avail) {
WARN("Memory leak of hipMalloc3D API in multithreaded scenario");
REQUIRE(false);
}
}