SWDEV-301667 - Optimize lock for graph global capture mode
Remove unneeded lock and add smaller scope Change-Id: I03a437057d54ce2d72c07a080bb872693b7f3f6c
This commit is contained in:
committato da
Maneesh Gupta
parent
0442501849
commit
6e86d29a58
@@ -166,7 +166,6 @@ static amd::Monitor g_hipInitlock{"hipInit lock"};
|
||||
if (hip::tls.capture_streams_.size() != 0) { \
|
||||
HIP_RETURN(hipErrorStreamCaptureUnsupported); \
|
||||
} \
|
||||
amd::ScopedLock lock(g_captureStreamsLock); \
|
||||
if (g_captureStreams.size() != 0) { \
|
||||
HIP_RETURN(hipErrorStreamCaptureUnsupported); \
|
||||
} \
|
||||
|
||||
@@ -470,10 +470,12 @@ hipError_t hipStreamDestroy(hipStream_t stream) {
|
||||
}
|
||||
s->GetDevice()->RemoveStreamFromPools(s);
|
||||
|
||||
amd::ScopedLock lock(g_captureStreamsLock);
|
||||
const auto& g_it = std::find(g_captureStreams.begin(), g_captureStreams.end(), s);
|
||||
if (g_it != g_captureStreams.end()) {
|
||||
g_captureStreams.erase(g_it);
|
||||
{
|
||||
amd::ScopedLock lock(g_captureStreamsLock);
|
||||
const auto& g_it = std::find(g_captureStreams.begin(), g_captureStreams.end(), s);
|
||||
if (g_it != g_captureStreams.end()) {
|
||||
g_captureStreams.erase(g_it);
|
||||
}
|
||||
}
|
||||
const auto& l_it = std::find(hip::tls.capture_streams_.begin(),
|
||||
hip::tls.capture_streams_.end(), s);
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user