SWDEV-504658 - Reduce the lock scope for kernel look-up

The vector with all kernels is preallocated on the executable init.
Thus, reduce the scope  of global lock to the binary creation only.

Change-Id: I73035013a6562175069137e895bba815f466ee35
This commit is contained in:
German Andryeyev
2024-12-13 19:10:39 -05:00
parent cd9db5a2fa
commit 0640d36019
3 changed files with 17 additions and 16 deletions
-3
View File
@@ -1379,13 +1379,10 @@ const char* StatCO::getStatFuncName(const void* hostFunction) {
}
hipError_t StatCO::getStatFunc(hipFunction_t* hfunc, const void* hostFunction, int deviceId) {
amd::ScopedLock lock(sclock_);
const auto it = functions_.find(hostFunction);
if (it == functions_.end()) {
return hipErrorInvalidSymbol;
}
return it->second->getStatFunc(hfunc, deviceId);
}