SWDEV-1 - fix build errors for file descriptor
Change-Id: I38b3962744f20ce758c32077f2c725013c666a35
[ROCm/clr commit: 3337f6912d]
Šī revīzija ir iekļauta:
revīziju iesūtīja
Ajay GunaShekar
vecāks
43670ec526
revīzija
a9e57c70b5
@@ -53,7 +53,7 @@ FatBinaryInfo::~FatBinaryInfo() {
|
|||||||
|
|
||||||
if (!HIP_USE_RUNTIME_UNBUNDLER) {
|
if (!HIP_USE_RUNTIME_UNBUNDLER) {
|
||||||
// Using COMGR 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.
|
// Check for ufd_ != nullptr, since sometimes, we never create unique_file_desc.
|
||||||
if (ufd_->fsize_ && image_mapped_
|
if (ufd_->fsize_ && image_mapped_
|
||||||
&& !amd::Os::MemoryUnmapFile(image_, ufd_->fsize_)) {
|
&& !amd::Os::MemoryUnmapFile(image_, ufd_->fsize_)) {
|
||||||
@@ -282,7 +282,7 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vector<hip::Devi
|
|||||||
image_mapped_ = false;
|
image_mapped_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fdesc_ > 0) {
|
if (amd::Os::isValidFileDesc(fdesc_)) {
|
||||||
guarantee(fsize_ > 0, "Size has to greater than 0 too");
|
guarantee(fsize_ > 0, "Size has to greater than 0 too");
|
||||||
if (!amd::Os::CloseFileHandle(fdesc_))
|
if (!amd::Os::CloseFileHandle(fdesc_))
|
||||||
guarantee(false, "Cannot close the file handle");
|
guarantee(false, "Cannot close the file handle");
|
||||||
|
|||||||
Atsaukties uz šo jaunā problēmā
Block a user