SWDEV-1 - fix build errors for file descriptor
Change-Id: I38b3962744f20ce758c32077f2c725013c666a35
[ROCm/clr commit: 3337f6912d]
Этот коммит содержится в:
коммит произвёл
Ajay GunaShekar
родитель
43670ec526
Коммит
a9e57c70b5
@@ -53,7 +53,7 @@ FatBinaryInfo::~FatBinaryInfo() {
|
||||
|
||||
if (!HIP_USE_RUNTIME_UNBUNDLER) {
|
||||
// Using COMGR Unbundler
|
||||
if (ufd_ && ufd_->fdesc_ > 0) {
|
||||
if (ufd_ && amd::Os::isValidFileDesc(ufd_->fdesc_)) {
|
||||
// Check for ufd_ != nullptr, since sometimes, we never create unique_file_desc.
|
||||
if (ufd_->fsize_ && image_mapped_
|
||||
&& !amd::Os::MemoryUnmapFile(image_, ufd_->fsize_)) {
|
||||
@@ -282,7 +282,7 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vector<hip::Devi
|
||||
image_mapped_ = false;
|
||||
}
|
||||
|
||||
if (fdesc_ > 0) {
|
||||
if (amd::Os::isValidFileDesc(fdesc_)) {
|
||||
guarantee(fsize_ > 0, "Size has to greater than 0 too");
|
||||
if (!amd::Os::CloseFileHandle(fdesc_))
|
||||
guarantee(false, "Cannot close the file handle");
|
||||
|
||||
Ссылка в новой задаче
Block a user