SWDEV-371332 - [ABI Break]remove if def for cu/cuda memtype
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com> Change-Id: I0754ef8bc7c9384bab65599a41719de0fd71b415
Tá an tiomantas seo le fáil i:
1 tuismitheoir
baaaff9d7f
tiomantas
bfa6d77ce5
3 comhad athraithe
+8
-28
Níor tháinig aon chomhaid le do chuardach
@@ -135,11 +135,9 @@ TEST_CASE("Unit_hipDrvPtrGetAttributes_Functional") {
|
|||||||
reinterpret_cast<hipDeviceptr_t>(A_d + 100)));
|
reinterpret_cast<hipDeviceptr_t>(A_d + 100)));
|
||||||
|
|
||||||
REQUIRE(dev_ptr == dev_ptr1);
|
REQUIRE(dev_ptr == dev_ptr1);
|
||||||
#if HT_NVIDIA
|
|
||||||
REQUIRE(memory_type == CU_MEMORYTYPE_DEVICE);
|
|
||||||
#else
|
|
||||||
REQUIRE(memory_type == hipMemoryTypeDevice);
|
REQUIRE(memory_type == hipMemoryTypeDevice);
|
||||||
#endif
|
|
||||||
REQUIRE(device_ordinal == deviceId);
|
REQUIRE(device_ordinal == deviceId);
|
||||||
REQUIRE(range_size == Nbytes);
|
REQUIRE(range_size == Nbytes);
|
||||||
REQUIRE(start_addr == dev);
|
REQUIRE(start_addr == dev);
|
||||||
|
|||||||
@@ -72,11 +72,9 @@ TEST_CASE("Unit_hipPointerGetAttribute_MemoryTypes") {
|
|||||||
HIP_CHECK(hipPointerGetAttribute(&datatype,
|
HIP_CHECK(hipPointerGetAttribute(&datatype,
|
||||||
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
||||||
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
||||||
#if HT_NVIDIA
|
|
||||||
REQUIRE(datatype == CU_MEMORYTYPE_DEVICE);
|
|
||||||
#else
|
|
||||||
REQUIRE(datatype == hipMemoryTypeDevice);
|
REQUIRE(datatype == hipMemoryTypeDevice);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#if HT_AMD
|
#if HT_AMD
|
||||||
SECTION("Malloc Array Allocation") {
|
SECTION("Malloc Array Allocation") {
|
||||||
@@ -86,11 +84,8 @@ TEST_CASE("Unit_hipPointerGetAttribute_MemoryTypes") {
|
|||||||
HIP_CHECK(hipPointerGetAttribute(&datatype,
|
HIP_CHECK(hipPointerGetAttribute(&datatype,
|
||||||
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
||||||
reinterpret_cast<hipDeviceptr_t>(B_d)));
|
reinterpret_cast<hipDeviceptr_t>(B_d)));
|
||||||
#if HT_NVIDIA
|
|
||||||
REQUIRE(datatype == CU_MEMORYTYPE_ARRAY);
|
|
||||||
#else
|
|
||||||
REQUIRE(datatype == hipMemoryTypeArray);
|
REQUIRE(datatype == hipMemoryTypeArray);
|
||||||
#endif
|
|
||||||
HIP_CHECK(hipFreeArray(B_d));
|
HIP_CHECK(hipFreeArray(B_d));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,11 +100,8 @@ TEST_CASE("Unit_hipPointerGetAttribute_MemoryTypes") {
|
|||||||
HIP_CHECK(hipPointerGetAttribute(&datatype,
|
HIP_CHECK(hipPointerGetAttribute(&datatype,
|
||||||
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
||||||
reinterpret_cast<hipDeviceptr_t>(arr)));
|
reinterpret_cast<hipDeviceptr_t>(arr)));
|
||||||
#if HT_NVIDIA
|
|
||||||
REQUIRE(datatype == CU_MEMORYTYPE_ARRAY);
|
|
||||||
#else
|
|
||||||
REQUIRE(datatype == hipMemoryTypeArray);
|
REQUIRE(datatype == hipMemoryTypeArray);
|
||||||
#endif
|
|
||||||
HIP_CHECK(hipFreeArray(arr));
|
HIP_CHECK(hipFreeArray(arr));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -171,11 +163,9 @@ TEST_CASE("Unit_hipPointerGetAttribute_PeerGPU") {
|
|||||||
HIP_CHECK(hipPointerGetAttribute(&data,
|
HIP_CHECK(hipPointerGetAttribute(&data,
|
||||||
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
||||||
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
||||||
#if HT_NVIDIA
|
|
||||||
REQUIRE(data == CU_MEMORYTYPE_DEVICE);
|
|
||||||
#else
|
|
||||||
REQUIRE(data == hipMemoryTypeDevice);
|
REQUIRE(data == hipMemoryTypeDevice);
|
||||||
#endif
|
|
||||||
HIP_CHECK(hipPointerGetAttribute(&data,
|
HIP_CHECK(hipPointerGetAttribute(&data,
|
||||||
HIP_POINTER_ATTRIBUTE_DEVICE_ORDINAL,
|
HIP_POINTER_ATTRIBUTE_DEVICE_ORDINAL,
|
||||||
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
||||||
|
|||||||
@@ -96,19 +96,11 @@ TEST_CASE("Unit_hipPtrGetAttribute_Simple") {
|
|||||||
unsigned int datatype;
|
unsigned int datatype;
|
||||||
HIP_CHECK(hipPointerGetAttribute(&datatype, HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
HIP_CHECK(hipPointerGetAttribute(&datatype, HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
||||||
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
reinterpret_cast<hipDeviceptr_t>(A_d)));
|
||||||
#ifdef __HIP_PLATFORM_NVCC__
|
|
||||||
REQUIRE(datatype == CU_MEMORYTYPE_DEVICE);
|
|
||||||
#else
|
|
||||||
REQUIRE(datatype == hipMemoryTypeDevice);
|
REQUIRE(datatype == hipMemoryTypeDevice);
|
||||||
#endif
|
|
||||||
|
|
||||||
HIP_CHECK(hipPointerGetAttribute(&datatype, HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
HIP_CHECK(hipPointerGetAttribute(&datatype, HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
|
||||||
reinterpret_cast<hipDeviceptr_t>(A_Pinned_h)));
|
reinterpret_cast<hipDeviceptr_t>(A_Pinned_h)));
|
||||||
#ifdef __HIP_PLATFORM_NVCC__
|
|
||||||
REQUIRE(datatype == CU_MEMORYTYPE_HOST);
|
|
||||||
#else
|
|
||||||
REQUIRE(datatype == hipMemoryTypeHost);
|
REQUIRE(datatype == hipMemoryTypeHost);
|
||||||
#endif
|
|
||||||
|
|
||||||
// HIP_POINTER_ATTRIBUTE_IS_MANAGED
|
// HIP_POINTER_ATTRIBUTE_IS_MANAGED
|
||||||
bool isHmm;
|
bool isHmm;
|
||||||
|
|||||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir