From b78d8c33a67e91203842eac870f8ae59501a591b Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Tue, 23 Aug 2022 09:35:39 +0530 Subject: [PATCH 1/2] SWDEV-344135 - Enable stream ordered memory and mempool tests (#2837) - Enable stream ordered memory and mempool tests for Nvidia platform - Fix build errors Change-Id: I90337e73d7b5df944a72cb41f2bde9ab2eec653c --- tests/catch/unit/memory/CMakeLists.txt | 1 + tests/catch/unit/memory/hipMemPoolApi.cc | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/catch/unit/memory/CMakeLists.txt b/tests/catch/unit/memory/CMakeLists.txt index aff4c7ef5e..f24c63ad8c 100644 --- a/tests/catch/unit/memory/CMakeLists.txt +++ b/tests/catch/unit/memory/CMakeLists.txt @@ -138,6 +138,7 @@ set(TEST_SRC hipMemRangeGetAttribute.cc hipMemcpyFromSymbol.cc hipPtrGetAttribute.cc + hipMemPoolApi.cc hipMemcpyPeer.cc hipMemcpyPeerAsync.cc hipMemcpyWithStream.cc diff --git a/tests/catch/unit/memory/hipMemPoolApi.cc b/tests/catch/unit/memory/hipMemPoolApi.cc index e799c4feec..bdb8ccfef4 100644 --- a/tests/catch/unit/memory/hipMemPoolApi.cc +++ b/tests/catch/unit/memory/hipMemPoolApi.cc @@ -65,7 +65,7 @@ TEST_CASE("Unit_hipMemPoolApi_Basic") { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); - HIP_CHECK(hipMallocAsync(&A, numElements * sizeof(float), stream)); + HIP_CHECK(hipMallocAsync(reinterpret_cast(&A), numElements * sizeof(float), stream)); INFO("hipMallocAsync result: " << A); HIP_CHECK(hipFreeAsync(A, stream)); @@ -84,16 +84,25 @@ TEST_CASE("Unit_hipMemPoolApi_Basic") { HIP_CHECK(hipMemPoolGetAttribute(mem_pool, attr, &value)); - hipMemAccessDesc desc_list = {}; + hipMemAccessDesc desc_list = { + { + hipMemLocationTypeDevice, + 0 + }, + hipMemAccessFlagsProtReadWrite + }; int count = 1; HIP_CHECK(hipMemPoolSetAccess(mem_pool, &desc_list, count)); hipMemAccessFlags flags = hipMemAccessFlagsProtNone; - hipMemLocation location = {}; + hipMemLocation location = { + hipMemLocationTypeDevice, + 0 + }; HIP_CHECK(hipMemPoolGetAccess(&flags, mem_pool, &location)); HIP_CHECK(hipMemPoolCreate(&mem_pool, &kPoolProps)); - HIP_CHECK(hipMallocFromPoolAsync(&B, numElements * sizeof(float), mem_pool, stream)); + HIP_CHECK(hipMallocFromPoolAsync(reinterpret_cast(&B), numElements * sizeof(float), mem_pool, stream)); HIP_CHECK(hipMemPoolDestroy(mem_pool)); HIP_CHECK(hipStreamDestroy(stream)); @@ -527,8 +536,8 @@ TEST_CASE("Unit_hipMemPoolApi_Default") { std::uint64_t value64 = 0; attr = hipMemPoolAttrReservedMemCurrent; HIP_CHECK(hipMemPoolGetAttribute(mem_pool, attr, &value64)); - // Make sure the current reserved just 4KB alloc - REQUIRE(sizeof(float) * 1024 == value64); + // Make sure the current reserved is at least allocation size of buffer C (4KB) + REQUIRE(sizeof(float) * 1024 <= value64); attr = hipMemPoolAttrUsedMemHigh; HIP_CHECK(hipMemPoolGetAttribute(mem_pool, attr, &value64)); From 946d5d6ea89ece3029395a45aaf62c13d65cee33 Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Fri, 26 Aug 2022 00:54:13 +0530 Subject: [PATCH 2/2] SWDEV-345944 - Remove use of MINSIGSTKSZ. (#2857) Change-Id: Ia0cdb2b48ea44ced325f3c442237420c8cee2312 --- tests/catch/external/Catch2/catch.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/catch/external/Catch2/catch.hpp b/tests/catch/external/Catch2/catch.hpp index 0384171ae4..6897dae0d0 100644 --- a/tests/catch/external/Catch2/catch.hpp +++ b/tests/catch/external/Catch2/catch.hpp @@ -10819,7 +10819,7 @@ namespace Catch { // 32kb for the alternate stack seems to be sufficient. However, this value // is experimentally determined, so that's not guaranteed. - static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; + static constexpr std::size_t sigStackSize = 32768; static SignalDefs signalDefs[] = { { SIGINT, "SIGINT - Terminal interrupt signal" },