From a2ce848fabc52d2aa3dd2cd1266fa13ccee03270 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 15 Jan 2020 18:32:44 -0500
Subject: [PATCH] P4 to Git Change 2057410 by skudchad@skudchad_rocm on
2020/01/15 18:24:33
SWDEV-219341 - Free memory correctly. hiprtcProgram is a pointer by itself. So release *prog
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_rtc.cpp#10 edit
[ROCm/clr commit: 37c900f2a1dc8fa631606734d269dd8d13732c72]
---
projects/clr/hipamd/api/hip/hip_rtc.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/projects/clr/hipamd/api/hip/hip_rtc.cpp b/projects/clr/hipamd/api/hip/hip_rtc.cpp
index e3cfd3f885..093c828975 100644
--- a/projects/clr/hipamd/api/hip/hip_rtc.cpp
+++ b/projects/clr/hipamd/api/hip/hip_rtc.cpp
@@ -312,7 +312,9 @@ hiprtcResult hiprtcDestroyProgram(hiprtcProgram* prog) {
if (prog == NULL) {
HIPRTC_RETURN(HIPRTC_ERROR_INVALID_INPUT);
}
- amd::Program* program = as_amd(reinterpret_cast(prog));
+
+ // Release program. hiprtcProgram is a double pointer so free *prog
+ amd::Program* program = as_amd(reinterpret_cast(*prog));
program->release();