From 720a5bcf9af09b3a5c7863dc9a39c9f513d8b009 Mon Sep 17 00:00:00 2001 From: "systems-assistant[bot]" <221163467+systems-assistant[bot]@users.noreply.github.com> Date: Thu, 13 Nov 2025 11:16:41 +0100 Subject: [PATCH] SWDEV-547526 - Add missing free calls (#531) Co-authored-by: Vladana Stojiljkovic --- .../module/hipExtLaunchMultiKernelMultiDevice.cc | 12 +++++------- projects/hip-tests/catch/unit/module/hipModule.cc | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/projects/hip-tests/catch/unit/module/hipExtLaunchMultiKernelMultiDevice.cc b/projects/hip-tests/catch/unit/module/hipExtLaunchMultiKernelMultiDevice.cc index 823032f72a..8302b71548 100644 --- a/projects/hip-tests/catch/unit/module/hipExtLaunchMultiKernelMultiDevice.cc +++ b/projects/hip-tests/catch/unit/module/hipExtLaunchMultiKernelMultiDevice.cc @@ -119,6 +119,7 @@ TEST_CASE("Unit_hipExtLaunchMultiKernelMultiDevice_Functional") { for (int j = 0; j < nGpu; j++) { HIP_CHECK(hipStreamSynchronize(stream[j])); + HIP_CHECK(hipStreamDestroy(stream[j])); hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, j)); @@ -130,15 +131,12 @@ TEST_CASE("Unit_hipExtLaunchMultiKernelMultiDevice_Functional") { for (size_t i = 0; i < N; i++) { REQUIRE(fabs(C_h[i] - (A_h[i] * A_h[i])) < 0.00000000001); } + + HIP_CHECK(hipFree(A_d[j])); + HIP_CHECK(hipFree(C_d[j])); } - for (int i = 0; i < nGpu; i++) { - HIP_CHECK(hipFree(A_d[i])); - HIP_CHECK(hipFree(C_d[i])); - HIP_CHECK(hipStreamDestroy(stream[i])); - } - - free(launchParamsList); free(A_h); free(C_h); + free(launchParamsList); } diff --git a/projects/hip-tests/catch/unit/module/hipModule.cc b/projects/hip-tests/catch/unit/module/hipModule.cc index fce45df32a..eed3759dad 100644 --- a/projects/hip-tests/catch/unit/module/hipModule.cc +++ b/projects/hip-tests/catch/unit/module/hipModule.cc @@ -91,6 +91,7 @@ bool testCodeObjFile(const char* codeObjFile) { HIP_CHECK(hipModuleLaunchKernel(Function, 1, 1, 1, LEN, 1, 1, 0, stream, NULL, reinterpret_cast(&config))); + HIP_CHECK(hipStreamSynchronize(stream)); HIP_CHECK(hipStreamDestroy(stream)); HIP_CHECK(hipMemcpy(B, Bd, SIZE, hipMemcpyDeviceToHost));