From 68139f9ddbba188aaba595ba9cd90fc1014b2b2d Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Mon, 13 Feb 2023 18:18:23 -0800 Subject: [PATCH] SWDEV-381898 - Move the lock after code object loading since COMGR is thread safe now and VDI also have locks. Change-Id: I15547f3ae3711d12a1ddf5cb7e9abd40a95ded89 --- hipamd/src/hip_platform.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hipamd/src/hip_platform.cpp b/hipamd/src/hip_platform.cpp index aebd7f9990..20d1316217 100644 --- a/hipamd/src/hip_platform.cpp +++ b/hipamd/src/hip_platform.cpp @@ -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;