SWDEV-400119 - Added Unit_hipMemGetInfo_FreeLessThanTotal (#329)
Change-Id: Ia023d41ce4f941a03bccb8bf7dd59021e19d83b8
[ROCm/hip-tests commit: 839f3f5f02]
This commit is contained in:
committed by
GitHub
parent
230833b77b
commit
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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user