SWDEV-330661 - Add test for hipHostGetDevicePointer null check (#2745)

Change-Id: I19668385003a107e21f8484ef28e114b7c6d8a42
Tento commit je obsažen v:
ROCm CI Service Account
2022-06-17 09:35:56 +05:30
odevzdal GitHub
rodič 3a84eb3a5f
revize d3a062a4eb
+12
Zobrazit soubor
@@ -231,4 +231,16 @@ TEST_CASE("Unit_hipHostMalloc_Default") {
CheckHostPointer(numElements, A, 0, SYNC_DEVICE, ptrType);
CheckHostPointer(numElements, A, 0, SYNC_STREAM, ptrType);
CheckHostPointer(numElements, A, 0, SYNC_EVENT, ptrType);
}
TEST_CASE("Unit_hipHostGetDevicePointer_NullCheck") {
int* d_a;
HIP_CHECK(hipHostMalloc(reinterpret_cast<void**>(&d_a), sizeof(int)));
auto res = hipHostGetDevicePointer(nullptr,d_a,0);
REQUIRE(res == hipErrorInvalidValue);
HIP_CHECK(hipHostFree(d_a));
}