From 719600ccc46fb7437b0227ed00f8dfd59ce9dbfc Mon Sep 17 00:00:00 2001 From: Marko Arandjelovic Date: Wed, 30 Oct 2024 15:43:46 +0100 Subject: [PATCH] SWDEV-489617 - Enable Unit_hipMemcpyAsync_Positive_Synchronization_Behavior - Since any-host-to-any-host as always synchronous, there's no need for separate functions - Removed 'return' statement as it skips the rest of the test. Change-Id: If70e0b21ad8151311d5ac7c5de789f6265cf44b6 [ROCm/hip-tests commit: 3809d1bb758b0e1f4d2a49dc74ebd8f7763ba0ed] --- .../catch/include/memcpy1d_tests_common.hh | 14 ++------------ .../hip-tests/catch/unit/memory/hipMemcpyAsync.cc | 11 ++--------- .../catch/unit/memory/hipMemcpyWithStream.cc | 2 -- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/projects/hip-tests/catch/include/memcpy1d_tests_common.hh b/projects/hip-tests/catch/include/memcpy1d_tests_common.hh index 69a968d7f6..c0b4d99799 100644 --- a/projects/hip-tests/catch/include/memcpy1d_tests_common.hh +++ b/projects/hip-tests/catch/include/memcpy1d_tests_common.hh @@ -298,9 +298,8 @@ template void MemcpyHtoHSyncBehavior(F memcpy_func, const bool should_sync, const hipStream_t kernel_stream = nullptr) { using LA = LinearAllocs; - const auto [src_alloc_type, dst_alloc_type] = GENERATE( - std::make_tuple(LA::malloc, LA::hipHostMalloc), - std::make_tuple(LA::hipHostMalloc, LA::malloc), std::make_tuple(LA::malloc, LA::malloc)); + auto src_alloc_type = GENERATE(LA::malloc, LA::hipHostMalloc); + auto dst_alloc_type = GENERATE(LA::malloc, LA::hipHostMalloc); LinearAllocGuard src_alloc(src_alloc_type, kPageSize); LinearAllocGuard dst_alloc(dst_alloc_type, kPageSize); @@ -308,15 +307,6 @@ void MemcpyHtoHSyncBehavior(F memcpy_func, const bool should_sync, should_sync, kernel_stream); } -template -void MemcpyHPinnedtoHPinnedSyncBehavior(F memcpy_func, const bool should_sync, - const hipStream_t kernel_stream = nullptr) { - LinearAllocGuard src_alloc(LinearAllocs::hipHostMalloc, kPageSize); - LinearAllocGuard dst_alloc(LinearAllocs::hipHostMalloc, kPageSize); - MemcpySyncBehaviorCheck(std::bind(memcpy_func, dst_alloc.ptr(), src_alloc.ptr(), kPageSize), - should_sync, kernel_stream); -} - // Common negative tests template void MemcpyCommonNegativeTests(F f, void* dst, void* src, size_t count) { SECTION("dst == nullptr") { HIP_CHECK_ERROR(f(nullptr, src, count), hipErrorInvalidValue); } diff --git a/projects/hip-tests/catch/unit/memory/hipMemcpyAsync.cc b/projects/hip-tests/catch/unit/memory/hipMemcpyAsync.cc index 41dc72c868..b91f0fc1c1 100644 --- a/projects/hip-tests/catch/unit/memory/hipMemcpyAsync.cc +++ b/projects/hip-tests/catch/unit/memory/hipMemcpyAsync.cc @@ -41,14 +41,10 @@ TEST_CASE("Unit_hipMemcpyAsync_Positive_Synchronization_Behavior") { // This behavior differs on NVIDIA and AMD, on AMD the hipMemcpy calls is synchronous with // respect to the host SECTION("Host pageable memory to device memory") { -#if HT_AMD - HipTest::HIP_SKIP_TEST( - "EXSWCPHIPT-127 - MemcpyAsync from host to device memory behavior differs on AMD and " - "Nvidia"); - return; -#endif +#if HT_NVIDIA MemcpyHPageabletoDSyncBehavior( std::bind(hipMemcpyAsync, _1, _2, _3, hipMemcpyHostToDevice, nullptr), false); +#endif } SECTION("Host pinned memory to device memory") { @@ -79,9 +75,6 @@ TEST_CASE("Unit_hipMemcpyAsync_Positive_Synchronization_Behavior") { SECTION("Host memory to host memory") { MemcpyHtoHSyncBehavior(std::bind(hipMemcpyAsync, _1, _2, _3, hipMemcpyHostToHost, nullptr), true); - - MemcpyHPinnedtoHPinnedSyncBehavior( - std::bind(hipMemcpyAsync, _1, _2, _3, hipMemcpyHostToHost, nullptr), true); } } diff --git a/projects/hip-tests/catch/unit/memory/hipMemcpyWithStream.cc b/projects/hip-tests/catch/unit/memory/hipMemcpyWithStream.cc index d8f9b5bc0f..36f5c93168 100644 --- a/projects/hip-tests/catch/unit/memory/hipMemcpyWithStream.cc +++ b/projects/hip-tests/catch/unit/memory/hipMemcpyWithStream.cc @@ -65,8 +65,6 @@ TEST_CASE("Unit_hipMemcpy_Positive_Synchronization_Behavior") { // respect to the host SECTION("Host memory to host memory") { MemcpyHtoHSyncBehavior(std::bind(hipMemcpy, _1, _2, _3, hipMemcpyHostToHost), true); - MemcpyHPinnedtoHPinnedSyncBehavior( - std::bind(hipMemcpyAsync, _1, _2, _3, hipMemcpyHostToHost, nullptr), true); } }