SWDEV-449111 - Lesser CU size tends to have block & thread dim = 0. OOM as PAL uses half of CPU memory once GPU memory exhausts.

Change-Id: I2399f7247f5172fdc7980a4652ff68df4b5598c5
This commit is contained in:
Jaydeep Patel authored and Jaydeepkumar Patel committed 2024-04-17 07:58:37 -04:00
1 parent 016c533399
commit 7def265d94
2 files changed
+28 -8

No files matched your search

+16 -8
View File
@@ -107,20 +107,28 @@ TEMPLATE_TEST_CASE("Unit_hipFreeMipmappedArrayMultiTArray", "", char, int) {
extent.height = GENERATE(64, 256, 1024);
extent.depth = GENERATE(0, 64, 256, 1024);
for (auto& ptr : ptrs) {
HIP_CHECK(hipMallocMipmappedArray(&ptr, &desc, extent, numLevels, flags));
int i = 0;
for (; i < ptrs.size(); i++) {
if (hipErrorOutOfMemory == hipMallocMipmappedArray(&ptrs[i], &desc, extent,
numLevels, flags)) {
break;
}
}
for (auto ptr : ptrs) {
threads.emplace_back(([ptr] {
HIP_CHECK_THREAD(hipFreeMipmappedArray(ptr));
HIP_CHECK_THREAD(hipStreamQuery(nullptr));
}));
for (int j = 0; j < i; j++) {
threads.emplace_back([ptrs,j] {
if (hipSuccess != hipFreeMipmappedArray(ptrs[j])) {
return;
}
if (hipSuccess != hipStreamQuery(nullptr)) {
return;
}
});
}
for (auto& t : threads) {
t.join();
}
HIP_CHECK_THREAD_FINALIZE();
}