Skip to content

Commit

Permalink
SWDEV-416218 - Set the image mapped flag correctly on COMGR path.
Browse files Browse the repository at this point in the history
Change-Id: I6c0908731f10c8ff5b3e159c0cfb68ce096c7bdf
  • Loading branch information
kjayapra-amd committed Aug 10, 2023
1 parent 4969004 commit d18f4b1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions hipamd/src/hip_fatbin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vector<hip::Devi
return hipErrorInvalidValue;

// If image_ is nullptr, then file path is passed via hipMod* APIs, so map the file.
if (image_ == nullptr && !amd::Os::MemoryMapFileDesc(fdesc_, fsize_, foffset_, &image_)
&& (image_mapped_ = true)) {
LogError("Cannot map the file descriptor");
amd::Os::CloseFileHandle(fdesc_);
return hipErrorInvalidValue;
if (image_ == nullptr) {
if(!amd::Os::MemoryMapFileDesc(fdesc_, fsize_, foffset_, &image_)) {
LogError("Cannot map the file descriptor");
amd::Os::CloseFileHandle(fdesc_);
return hipErrorInvalidValue;
}
image_mapped_ = true;
}
}

Expand Down

0 comments on commit d18f4b1

Please sign in to comment.