SWDEV-381898 - Move the lock after code object loading since COMGR is thread safe now and VDI also have locks.

Change-Id: I15547f3ae3711d12a1ddf5cb7e9abd40a95ded89
This commit is contained in:
kjayapra-amd authored and Karthik Jayaprakash committed 2023-02-15 10:23:28 -05:00
1 parent 2801be2372
commit 68139f9ddb
1 file changed
+1 -2
+1 -2
View File
@@ -673,8 +673,6 @@ void PlatformState::init() {
}
hipError_t PlatformState::loadModule(hipModule_t* module, const char* fname, const void* image) {
amd::ScopedLock lock(lock_);
if (module == nullptr) {
return hipErrorInvalidValue;
}
@@ -689,6 +687,7 @@ hipError_t PlatformState::loadModule(hipModule_t* module, const char* fname, con
*module = dynCo->module();
assert(*module != nullptr);
amd::ScopedLock lock(lock_);
if (dynCO_map_.find(*module) != dynCO_map_.end()) {
delete dynCo;
return hipErrorAlreadyMapped;