SWDEV-367463 - Add unit test for hipMallocManaged call w/ large size (#3089)

Change-Id: I9e9f6687ec837f3aaa1567d8b00f15925b7dd2c2
このコミットが含まれているのは:
ROCm CI Service Account
2022-11-28 14:04:01 +05:30
committed by GitHub
コミット 5e50c01e44
+20 -2
ファイルの表示
@@ -20,8 +20,10 @@
/* Test Case Description:
1) This testcase verifies the hipMallocManaged basic scenario - supported on
all devices
2) This testcase verifies the hipMallocManaged basic scenario - supported
only on HMM enabled devices
2) This testcase verifies the hipMallocManaged advanced scenario - supported
only on HMM enabled devices
3) This testcase verifies that hipMallocManaged returns an OutOfMemory error
for allocations much larger than the available memory - supported on all devices
*/
#include "hipMallocManagedCommon.hh"
@@ -138,3 +140,19 @@ TEST_CASE("Unit_hipMallocManaged_Advanced") {
HIP_CHECK(hipFree(B));
REQUIRE(maxError != 0.0f);
}
/*
This testcase verifies that hipMallocManaged returns an OutOfMemory error for allocations much
larger than the available memory - supported on all devices
*/
TEST_CASE("Unit_hipMallocManaged_Large") {
auto managed = HmmAttrPrint();
if (managed != 1) {
WARN(
"GPU doesn't support hipDeviceAttributeManagedMemory attribute so defaulting to system "
"memory.");
}
float* A;
HIP_CHECK_ERROR(hipMallocManaged(&A, std::numeric_limits<size_t>::max()), hipErrorOutOfMemory);
}