From 4e3fc2d937dfccc9281273c90ff3b80125df4390 Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Mon, 4 Mar 2024 16:03:45 -0500 Subject: [PATCH] SWDEV-311271 - Reset default mempool state Multiple subtests will fail if the default mem pool will keep information of the previous subtests. Change-Id: Ic9ab8ed93771e71735594a85235b5bb734d6680c --- catch/include/resource_guards.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/catch/include/resource_guards.hh b/catch/include/resource_guards.hh index c2f32e39f5..bb1f607cee 100644 --- a/catch/include/resource_guards.hh +++ b/catch/include/resource_guards.hh @@ -421,6 +421,11 @@ class MemPoolGuard { ~MemPoolGuard() { if (mempool_type_ == MemPools::created) { static_cast(hipMemPoolDestroy(mempool_)); + } else { + // Reset max states for default mem pool, so subtests won't fail + uint64_t value = 0; + HIP_CHECK(hipMemPoolSetAttribute(mempool_, hipMemPoolAttrUsedMemHigh, &value)); + HIP_CHECK(hipMemPoolSetAttribute(mempool_, hipMemPoolAttrReservedMemHigh, &value)); } }