SWDEV-400119 - Added Unit_hipMemGetInfo_FreeLessThanTotal (#329)

Change-Id: Ia023d41ce4f941a03bccb8bf7dd59021e19d83b8

[ROCm/hip-tests commit: 839f3f5f02]
Tá an tiomantas seo le fáil i:
ROCm CI Service Account
2023-06-29 08:59:50 +05:30
tiomanta ag GitHub
tuismitheoir 230833b77b
tiomantas 428a607884
@@ -574,3 +574,18 @@ TEST_CASE("Unit_hipMemGetInfo_Negative") {
HIP_CHECK(hipFree(A_mem));
}
TEST_CASE("Unit_hipMemGetInfo_FreeLessThanTotal") {
unsigned int *A_mem{nullptr};
size_t freeMemInit, totalMemInit;
size_t freeMem, totalMem;
HIP_CHECK(hipMemGetInfo(&freeMemInit, &totalMemInit));
REQUIRE(freeMemInit <= totalMemInit);
HIP_CHECK(hipMalloc(&A_mem, 1024));
HIP_CHECK(hipMemGetInfo(&freeMem, &totalMem));
REQUIRE(freeMem < totalMem);
REQUIRE(totalMem == totalMemInit);
HIP_CHECK(hipFree(A_mem));
}