From 7989d62ccda008484ea6f91fa0519c41bc9d7e27 Mon Sep 17 00:00:00 2001 From: haoyuan2 <98923620+haoyuan2@users.noreply.github.com> Date: Mon, 23 May 2022 21:52:42 -0700 Subject: [PATCH] SWDEV-338427 - fix test hang issue (#2690) destroy stream before exit [ROCm/hip commit: 5e0ab5c98b7c207c7a9bb88e76250e2902fd1385] --- projects/hip/tests/catch/unit/memory/hipMemcpyAsync.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/hip/tests/catch/unit/memory/hipMemcpyAsync.cc b/projects/hip/tests/catch/unit/memory/hipMemcpyAsync.cc index be5eb26b73..b9798f963e 100644 --- a/projects/hip/tests/catch/unit/memory/hipMemcpyAsync.cc +++ b/projects/hip/tests/catch/unit/memory/hipMemcpyAsync.cc @@ -1,5 +1,5 @@ /* -Copyright (c) 2021 - present Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2022 - present Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights @@ -124,6 +124,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_KernelLaunch", "", int, float, HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, stream)); HIP_CHECK(hipStreamSynchronize(stream)); + HIP_CHECK(hipStreamDestroy(stream)); HipTest::checkVectorADD(A_h, B_h, C_h, NUM_ELM); @@ -239,6 +240,8 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_H2H-H2D-D2H-H2PinMem", "", char, int, } } + HIP_CHECK(hipStreamDestroy(stream)); + HipTest::freeArrays(A_d, B_d, nullptr, A_h, B_h, nullptr, false); HipTest::freeArrays(nullptr, nullptr, nullptr, A_Ph, B_Ph, nullptr, true);