From aa7c62db37b9794014c3363fbcb3219a6364fa7f Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Mon, 26 Jun 2023 19:54:48 -0400 Subject: [PATCH] SWDEV-407691 - Always unmap file if HIP Runtime unbundler is used. Change-Id: Ica15df31dfee3c495cf067a998e7e3b7c7397f40 --- hipamd/src/hip_fatbin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hipamd/src/hip_fatbin.cpp b/hipamd/src/hip_fatbin.cpp index 079b9a961b..56bca305da 100644 --- a/hipamd/src/hip_fatbin.cpp +++ b/hipamd/src/hip_fatbin.cpp @@ -35,7 +35,9 @@ FatBinaryInfo::~FatBinaryInfo() { } if (fdesc_ > 0) { - if (fsize_ && image_mapped_ && !amd::Os::MemoryUnmapFile(image_, fsize_)) { + if (fsize_ + && (HIP_USE_RUNTIME_UNBUNDLER || image_mapped_) + && !amd::Os::MemoryUnmapFile(image_, fsize_)) { guarantee(false, "Cannot unmap file for fdesc: %d fsize: %d \n", fdesc_, fsize_); } if (!amd::Os::CloseFileHandle(fdesc_)) {