From e6c7681bf564b0e56cfa4de32cf09cf14ff7edcd Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 7 Nov 2014 14:08:41 -0500
Subject: [PATCH] P4 to Git Change 1094976 by yaxunl@yaxunl_stg_win50 on
2014/11/07 13:55:14
EPR #405357 - [CQE DTB][valgrind][OCL2.0]:MemLeaks are observed with MonteCarloAsian sample.
Need to delete amdrtFunctions when it is no longer used.
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/linker.cpp#116 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/include/llvm/AMDLLVMContextHook.h#23 edit
[ROCm/clr commit: 1837e47b4a105e21048e935ffc5c0c3f9cdd3ae0]
---
projects/clr/rocclr/compiler/lib/backends/common/linker.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/projects/clr/rocclr/compiler/lib/backends/common/linker.cpp b/projects/clr/rocclr/compiler/lib/backends/common/linker.cpp
index 670d8cf9a7..6fdd180772 100644
--- a/projects/clr/rocclr/compiler/lib/backends/common/linker.cpp
+++ b/projects/clr/rocclr/compiler/lib/backends/common/linker.cpp
@@ -799,6 +799,7 @@ amdcl::OCLLinker::link(llvm::Module* input, std::vector &libs)
int ret = 0;
if (Options()->oVariables->UseJIT) {
+ delete hookup_.amdrtFunctions;
hookup_.amdrtFunctions = amd::getAmdRtFunctions();
} else {
hookup_.amdrtFunctions = NULL;