Revert "Revert "Merge branch 'amd-master-next' into amd-npi-next""

This reverts commit 9142674ef0.

Reason for revert: <INSERT REASONING HERE>

Change-Id: I92ceb171e31026ed1864704cef2fc1497b883ef9
This commit is contained in:
Vladislav Sytchenko
2020-10-05 13:20:58 -04:00
parent 9142674ef0
commit d5aa0f607d
111 changed files with 6800 additions and 753 deletions
+5 -2
View File
@@ -12,7 +12,7 @@ FatBinaryDeviceInfo::~FatBinaryDeviceInfo() {
}
FatBinaryInfo::FatBinaryInfo(const char* fname, const void* image)
: fdesc_(-1), fsize_(0), image_(image), uri_(std::string()) {
: fdesc_(amd::Os::FDescInit()), fsize_(0), image_(image), uri_(std::string()) {
guarantee(fname || image);
if (fname != nullptr) {
@@ -41,7 +41,7 @@ FatBinaryInfo::~FatBinaryInfo() {
}
fname_ = std::string();
fdesc_ = -1;
fdesc_ = amd::Os::FDescInit();
fsize_ = 0;
image_ = nullptr;
uri_ = std::string();
@@ -64,6 +64,9 @@ hipError_t FatBinaryInfo::ExtractFatBinary(const std::vector<hip::Device*>& devi
if (!amd::Os::GetFileHandle(fname_.c_str(), &fdesc_, &fsize_)) {
return hipErrorFileNotFound;
}
if (fsize_ == 0) {
return hipErrorInvalidKernelFile;
}
// Extract the code object from file
hip_error = CodeObject::ExtractCodeObjectFromFile(fdesc_, fsize_,