Revert "SWDEV-304151 - Reset file descriptor after Module Load"
This reverts commit 3b157b3d5f.
Reason for revert: To address SWDEV-316216
Change-Id: Ib8e6ac4b87c5e52757cd8f45958f39f012823c60
Этот коммит содержится в:
@@ -509,9 +509,6 @@ hipError_t DynCO::loadCodeObject(const char* fname, const void* image) {
|
||||
// Define Global functions
|
||||
IHIP_RETURN_ONFAIL(populateDynGlobalFuncs());
|
||||
|
||||
// Resets the file info such as desc, size and name
|
||||
// as they are not necessary once the code object is loaded
|
||||
fb_info_->ResetFileInfo();
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,20 @@ FatBinaryInfo::~FatBinaryInfo() {
|
||||
delete fbd;
|
||||
}
|
||||
|
||||
ResetFileInfo();
|
||||
if (fdesc_ > 0) {
|
||||
if (fsize_ && !amd::Os::MemoryUnmapFile(image_, fsize_)) {
|
||||
guarantee(false, "Cannot unmap file");
|
||||
}
|
||||
if (!amd::Os::CloseFileHandle(fdesc_)) {
|
||||
guarantee(false, "Cannot close file");
|
||||
}
|
||||
}
|
||||
|
||||
fname_ = std::string();
|
||||
fdesc_ = amd::Os::FDescInit();
|
||||
fsize_ = 0;
|
||||
image_ = nullptr;
|
||||
uri_ = std::string();
|
||||
}
|
||||
|
||||
hipError_t FatBinaryInfo::ExtractFatBinary(const std::vector<hip::Device*>& devices) {
|
||||
|
||||
@@ -67,24 +67,6 @@ public:
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
// Resets the file information
|
||||
void ResetFileInfo() {
|
||||
if (fdesc_ > 0) {
|
||||
if (fsize_ && !amd::Os::MemoryUnmapFile(image_, fsize_)) {
|
||||
guarantee(false, "Cannot unmap file");
|
||||
}
|
||||
if (!amd::Os::CloseFileHandle(fdesc_)) {
|
||||
guarantee(false, "Cannot close file");
|
||||
}
|
||||
}
|
||||
|
||||
fname_ = std::string();
|
||||
fdesc_ = amd::Os::FDescInit();
|
||||
fsize_ = 0;
|
||||
image_ = nullptr;
|
||||
uri_ = std::string();
|
||||
}
|
||||
|
||||
private:
|
||||
std::string fname_; // File name
|
||||
amd::Os::FileDesc fdesc_; // File descriptor
|
||||
|
||||
Ссылка в новой задаче
Block a user