From 143ef3f742138f615e32abeda3aa959686ddd52b Mon Sep 17 00:00:00 2001 From: Jatin Chaudhary Date: Wed, 8 Nov 2023 00:01:28 +0000 Subject: [PATCH] SWDEV-431399 - fix first set of memory leaks in tests Change-Id: I73254b2f17df69726110070ebb457df14d647f27 [ROCm/hip-tests commit: 96cf008176e0c576b9128e502ee4a42382aff7ec] --- projects/hip-tests/catch/unit/rtc/linker.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/hip-tests/catch/unit/rtc/linker.cc b/projects/hip-tests/catch/unit/rtc/linker.cc index 151980b24c..cd3af5089d 100644 --- a/projects/hip-tests/catch/unit/rtc/linker.cc +++ b/projects/hip-tests/catch/unit/rtc/linker.cc @@ -60,6 +60,8 @@ TEST_CASE("Unit_RTC_LinkerAPI") { std::vector code(codesize, '\0'); HIPRTC_CHECK(hiprtcGetBitcode(program, &code[0])); + HIPRTC_CHECK(hiprtcDestroyProgram(&program)); + const char* isaopts[] = {"-mllvm", "-inline-threshold=1", "-mllvm", "-inlinehint-threshold=1"}; std::vector jit_options = {HIPRTC_JIT_IR_TO_ISA_OPT_EXT, HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT}; @@ -119,6 +121,7 @@ TEST_CASE("Unit_RTC_LinkerAPI") { HIP_CHECK(hipFree(dY)); HIP_CHECK(hipFree(dOut)); + HIPRTC_CHECK(hiprtcLinkDestroy(linkstate)); HIP_CHECK(hipModuleUnload(module)); for (size_t i = 0; i < n; ++i) {