SWDEV-507019 - Change the function lock to the module lock

Multiple functions can be located in the same module.

Change-Id: Ia4ca3db64fe5b0822584059d3770c91103665c63


[ROCm/clr commit: 45a12208b6]
Цей коміт міститься в:
German Andryeyev committed 2025-01-09 12:35:29 -05:00
1 джерело ef2a812d0a
коміт 5a76761960
3 files changed
+5 -2

No files matched your search

+4
Переглянути файл
@@ -109,6 +109,9 @@ public:
return hipSuccess;
}
//! Returns the lock for this fatbinary access
amd::Monitor& FatBinaryLock() { return fb_lock_; }
private:
std::string fname_; //!< File name
amd::Os::FileDesc fdesc_; //!< File descriptor
@@ -126,6 +129,7 @@ private:
std::vector<FatBinaryDeviceInfo*> fatbin_dev_info_;
std::shared_ptr<UniqueFD> ufd_; //!< Unique file descriptor
amd::Monitor fb_lock_{true}; //!< Lock for the fat binary access
};
}; // namespace hip
+1 -1
Переглянути файл
@@ -162,7 +162,7 @@ hipError_t Function::getStatFunc(hipFunction_t* hfunc, int deviceId) {
*hfunc = dFunc_[deviceId]->asHipFunction();
return hipSuccess;
}
amd::ScopedLock lock(fc_lock_);
amd::ScopedLock lock((*modules_)->FatBinaryLock());
// Check for the compiled kernel again, to make sure only one thread does compilation
if (dFunc_[deviceId] != nullptr) {
*hfunc = dFunc_[deviceId]->asHipFunction();
-1
Переглянути файл
@@ -96,7 +96,6 @@ private:
std::vector<DeviceFunc*> dFunc_; //!< DeviceFuncObj per Device
std::string name_; //!< name of the func(not unique identifier)
FatBinaryInfo** modules_; //!< static module where it is referenced
amd::Monitor fc_lock_{true}; //!< Lock for the function create
};
class Var {