SWDEV-400119 - Added Unit_hipMemGetInfo_FreeLessThanTotal (#329)

Change-Id: Ia023d41ce4f941a03bccb8bf7dd59021e19d83b8
Este cometimento está contido em:
ROCm CI Service Account criou e GitHub cometeu 2023-06-29 08:59:50 +05:30
1 ascendente 01697418be
cometimento 839f3f5f02
1 ficheiro modificado
+15
+15
Ver ficheiro
@@ -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));
}