Remove ifdef guards in VMM tests (#196)

This commit is contained in:
Arandjelovic, Marko
2025-05-22 17:19:57 +02:00
committed by GitHub
parent 91de6c98c3
commit 74e743dcb9
5 changed files with 0 additions and 34 deletions
@@ -138,25 +138,15 @@ TEST_CASE("Unit_hipMemAddressReserve_Negative") {
}
SECTION("pass size as 0") {
#if HT_AMD
REQUIRE(hipMemAddressReserve(&ptrA, 0, 0, 0, 0) == hipErrorMemoryAllocation);
#else
REQUIRE(hipMemAddressReserve(&ptrA, 0, 0, 0, 0) == hipErrorInvalidValue);
#endif
}
#if HT_NVIDIA
SECTION("pass non power of two for alignment") {
REQUIRE(hipMemAddressReserve(&ptrA, size_mem, 3, 0, 0) == hipErrorInvalidValue);
}
#endif
SECTION("pass size as non multiple of host page size") {
#if HT_AMD
REQUIRE(hipMemAddressReserve(&ptrA, (size_mem - 1), 0, 0, 0) == hipErrorMemoryAllocation);
#else
REQUIRE(hipMemAddressReserve(&ptrA, (size_mem - 1), 0, 0, 0) == hipErrorInvalidValue);
#endif
}
CTX_DESTROY();
@@ -447,22 +447,14 @@ TEST_CASE("Unit_hipMemCreate_Negative") {
SECTION("pass location id as -1") {
prop.location.id = -1; // set to non existing device
#if HT_AMD
REQUIRE(hipMemCreate(&handle, granularity, &prop, 0) == hipErrorInvalidValue);
#else
REQUIRE(hipMemCreate(&handle, granularity, &prop, 0) == hipErrorInvalidDevice);
#endif
}
SECTION("pass location id as > highest device number") {
int numDevices = 0;
HIP_CHECK(hipGetDeviceCount(&numDevices));
prop.location.id = numDevices; // set to non existing device
#if HT_AMD
REQUIRE(hipMemCreate(&handle, granularity, &prop, 0) == hipErrorInvalidValue);
#else
REQUIRE(hipMemCreate(&handle, granularity, &prop, 0) == hipErrorInvalidDevice);
#endif
}
CTX_DESTROY();
@@ -105,13 +105,11 @@ TEST_CASE("Unit_hipMemExportToShareableHandle_Negative_Parameters") {
HIP_CHECK(hipMemCreate(&handle, granularity * 2, &prop, 0));
void* shareable_handle = nullptr;
#if HT_NVIDIA
SECTION("shareableHandle == nullptr") {
HIP_CHECK_ERROR(
hipMemExportToShareableHandle(nullptr, handle, hipMemHandleTypePosixFileDescriptor, 0),
hipErrorInvalidValue);
}
#endif
SECTION("handle == nullptr") {
HIP_CHECK_ERROR(
@@ -1269,20 +1269,12 @@ TEST_CASE("Unit_hipMemSetAccess_negative") {
}
SECTION("pass a size less than reserved size") {
#if HT_AMD
REQUIRE(hipMemSetAccess(ptrA, size_mem - 1, &accessDesc, 1) == hipSuccess);
#else
REQUIRE(hipMemSetAccess(ptrA, size_mem - 1, &accessDesc, 1) == hipErrorInvalidValue);
#endif
}
SECTION("invalid location type") {
accessDesc.location.type = hipMemLocationTypeInvalid;
#if HT_AMD
REQUIRE(hipMemSetAccess(ptrA, size_mem, &accessDesc, 1) == hipSuccess);
#else
REQUIRE(hipMemSetAccess(ptrA, size_mem, &accessDesc, 1) == hipErrorInvalidValue);
#endif
}
SECTION("invalid id") {
@@ -1299,11 +1291,7 @@ TEST_CASE("Unit_hipMemSetAccess_negative") {
SECTION("invalid flag") {
accessDesc.flags = static_cast<hipMemAccessFlags>(-1);
#if HT_AMD
REQUIRE(hipMemSetAccess(ptrA, size_mem, &accessDesc, 1) == hipSuccess);
#else
REQUIRE(hipMemSetAccess(ptrA, size_mem, &accessDesc, 1) == hipErrorInvalidValue);
#endif
}
SECTION(" pass zero to count") {
@@ -79,11 +79,9 @@ TEST_CASE("Unit_hipMemUnmap_negative") {
SECTION("pass zero to size") { REQUIRE(hipMemUnmap(ptrA, 0) == hipErrorInvalidValue); }
#if HT_NVIDIA
SECTION("unmap a smaller size") {
REQUIRE(hipMemUnmap(ptrA, (size_mem - 1)) == hipErrorInvalidValue);
}
#endif
HIP_CHECK(hipMemRelease(handle));
HIP_CHECK(hipMemUnmap(ptrA, size_mem));