From e19e50052d2c37a2442467f00d38d0c6de6a3e4e Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Thu, 9 Feb 2023 18:52:27 +0530 Subject: [PATCH] SWDEV-1 - Fix warnings and update disabled test list (#163) - Fix warnings in some test cases due to unused variables or signed/unsigned comparison. - Disabled vulkan tests on MI200. [ROCm/hip-tests commit: 88fbbd666b73cb1df6441218700bcc2a0ea015ef] --- .../hipTestMain/config/config_amd_linux_MI2xx.json | 13 ++++++++++++- .../hip-tests/catch/unit/memory/hipMemAdvise.cc | 6 +++--- .../catch/unit/memory/hipPointerGetAttributes.cc | 2 -- .../unit/vulkan_interop/hipDestroyExternalMemory.cc | 4 +++- .../hipExternalMemoryGetMappedBuffer.cc | 4 +++- .../unit/vulkan_interop/hipImportExternalMemory.cc | 4 +++- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_MI2xx.json b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_MI2xx.json index 5e27deaa80..ee1afd5acc 100644 --- a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_MI2xx.json +++ b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_MI2xx.json @@ -8,7 +8,18 @@ "Unit_BuiltinAtomicsRTC_fmaxCoherentGlobalMem", "Unit_BuiltinAtomicsRTC__fminCoherentGlobalMem", "Unit_BuiltInAtomicAdd_CoherentGlobalMemWithRtc", - "Unit_hipMemGetAddressRange_Negative" + "Unit_hipMemGetAddressRange_Negative", + "Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write", + "Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters", + "Unit_hipImportExternalMemory_Vulkan_Negative_Parameters", + "Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore", + "Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores", + "Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters", + "Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore", + "Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores", + "Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters", + "Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters", + "Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters" ] } diff --git a/projects/hip-tests/catch/unit/memory/hipMemAdvise.cc b/projects/hip-tests/catch/unit/memory/hipMemAdvise.cc index 87059a594e..ed4d74445a 100644 --- a/projects/hip-tests/catch/unit/memory/hipMemAdvise.cc +++ b/projects/hip-tests/catch/unit/memory/hipMemAdvise.cc @@ -148,10 +148,10 @@ TEST_CASE("Unit_hipMemAdvise_Rounding") { unsigned int attribute = 0; HIP_CHECK(hipMemRangeGetAttribute(&attribute, sizeof(attribute), hipMemRangeAttributeAccessedBy, reinterpret_cast(base), rounded_up)); - REQUIRE(device == attribute); + REQUIRE(device == static_cast(attribute)); HIP_CHECK(hipMemRangeGetAttribute(&attribute, sizeof(attribute), hipMemRangeAttributeAccessedBy, alloc.ptr(), 3 * kPageSize)); - REQUIRE((rounded_up == 3 * kPageSize ? device : hipInvalidDeviceId) == attribute); + REQUIRE((rounded_up == 3 * kPageSize ? device : hipInvalidDeviceId) == static_cast(attribute)); } TEST_CASE("Unit_hipMemAdvise_Flags_Do_Not_Cause_Prefetch") { @@ -193,7 +193,7 @@ TEST_CASE("Unit_hipMemAdvise_Read_Write_After_Advise") { std::fill_n(alloc.ptr(), count, -1); ArrayFindIfNot(alloc.ptr(), -1, count); - for (int i = 0; i < supported_devices.size(); ++i) { + for (int i = 0; i < static_cast(supported_devices.size()); ++i) { HIP_CHECK(hipSetDevice(supported_devices[i])); VectorIncrement<<>>(alloc.ptr(), 1, count); HIP_CHECK(hipGetLastError()); diff --git a/projects/hip-tests/catch/unit/memory/hipPointerGetAttributes.cc b/projects/hip-tests/catch/unit/memory/hipPointerGetAttributes.cc index cbc4554b3a..ceefa1f9ba 100644 --- a/projects/hip-tests/catch/unit/memory/hipPointerGetAttributes.cc +++ b/projects/hip-tests/catch/unit/memory/hipPointerGetAttributes.cc @@ -213,12 +213,10 @@ TEST_CASE("Unit_hipPointerGetAttributes_Basic") { char* A_d; char* A_Pinned_h; - char* A_OSAlloc_h; hipError_t e; HIP_CHECK(hipMalloc(&A_d, Nbytes)); HIP_CHECK(hipHostMalloc(reinterpret_cast(&A_Pinned_h), Nbytes, hipHostMallocDefault)); - A_OSAlloc_h = reinterpret_cast(malloc(Nbytes)); size_t free, total; HIP_CHECK(hipMemGetInfo(&free, &total)); diff --git a/projects/hip-tests/catch/unit/vulkan_interop/hipDestroyExternalMemory.cc b/projects/hip-tests/catch/unit/vulkan_interop/hipDestroyExternalMemory.cc index 3f7c3cc13d..cb1b0766cd 100644 --- a/projects/hip-tests/catch/unit/vulkan_interop/hipDestroyExternalMemory.cc +++ b/projects/hip-tests/catch/unit/vulkan_interop/hipDestroyExternalMemory.cc @@ -21,7 +21,9 @@ THE SOFTWARE. #include "vulkan_test.hh" +#if HT_AMD && 0 constexpr bool enable_validation = false; +#endif TEST_CASE("Unit_hipDestroyExternalMemory_Vulkan_Negative_Parameters") { SECTION("extMem == nullptr") { @@ -42,4 +44,4 @@ TEST_CASE("Unit_hipDestroyExternalMemory_Vulkan_Negative_Parameters") { HIP_CHECK_ERROR(hipDestroyExternalMemory(ext_memory), hipErrorInvalidValue); } #endif -} \ No newline at end of file +} diff --git a/projects/hip-tests/catch/unit/vulkan_interop/hipExternalMemoryGetMappedBuffer.cc b/projects/hip-tests/catch/unit/vulkan_interop/hipExternalMemoryGetMappedBuffer.cc index c4ad1443c4..e627ae4f85 100644 --- a/projects/hip-tests/catch/unit/vulkan_interop/hipExternalMemoryGetMappedBuffer.cc +++ b/projects/hip-tests/catch/unit/vulkan_interop/hipExternalMemoryGetMappedBuffer.cc @@ -112,7 +112,9 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters") { hipExternalMemoryBufferDesc external_mem_buffer_desc = {}; external_mem_buffer_desc.size = vk_storage.size; +#if HT_NVIDIA void* hip_dev_ptr = nullptr; +#endif // Disabled on AMD due to defect - EXSWHTEC-176 #if HT_NVIDIA @@ -150,4 +152,4 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters") { hipErrorInvalidValue); } #endif -} \ No newline at end of file +} diff --git a/projects/hip-tests/catch/unit/vulkan_interop/hipImportExternalMemory.cc b/projects/hip-tests/catch/unit/vulkan_interop/hipImportExternalMemory.cc index 5abfada9d5..ffc6807c70 100644 --- a/projects/hip-tests/catch/unit/vulkan_interop/hipImportExternalMemory.cc +++ b/projects/hip-tests/catch/unit/vulkan_interop/hipImportExternalMemory.cc @@ -25,9 +25,11 @@ constexpr bool enable_validation = false; TEST_CASE("Unit_hipImportExternalMemory_Vulkan_Negative_Parameters") { VulkanTest vkt(enable_validation); +#if HT_NVIDIA const auto storage = vkt.CreateMappedStorage(1, VK_BUFFER_USAGE_TRANSFER_DST_BIT, true); auto desc = vkt.BuildMemoryDescriptor(storage.memory, sizeof(*storage.host_ptr)); hipExternalMemory_t ext_memory; +#endif // Disabled due to defect - EXSWHTEC-182 #if HT_NVIDIA @@ -73,4 +75,4 @@ TEST_CASE("Unit_hipImportExternalMemory_Vulkan_Negative_Parameters") { HIP_CHECK_ERROR(hipImportExternalMemory(&ext_memory, &desc), hipErrorInvalidValue); } #endif -} \ No newline at end of file +}