SWDEV-377571 - adding scopelock for hipDeviceReset
Change-Id: I3dd95a40d6abff721a4774f26e99d1162bafdfa1
[ROCm/clr commit: 03f62b90ef]
This commit is contained in:
@@ -107,13 +107,16 @@ void Device::RemoveStreamFromPools(Stream* stream) {
|
||||
|
||||
// ================================================================================================
|
||||
void Device::Reset() {
|
||||
auto it = mem_pools_.begin();
|
||||
while (it != mem_pools_.end()) {
|
||||
auto current = it++;
|
||||
(*current)->ReleaseAllMemory();
|
||||
delete *current;
|
||||
{
|
||||
amd::ScopedLock lock(lock_);
|
||||
auto it = mem_pools_.begin();
|
||||
while (it != mem_pools_.end()) {
|
||||
auto current = it++;
|
||||
(*current)->ReleaseAllMemory();
|
||||
delete *current;
|
||||
}
|
||||
mem_pools_.clear();
|
||||
}
|
||||
mem_pools_.clear();
|
||||
flags_ = hipDeviceScheduleSpin;
|
||||
hip::Stream::destroyAllStreams(deviceId_);
|
||||
amd::MemObjMap::Purge(devices()[0]);
|
||||
|
||||
@@ -382,7 +382,7 @@ namespace hip {
|
||||
|
||||
/// HIP Device class
|
||||
class Device {
|
||||
amd::Monitor lock_{"Device lock"};
|
||||
amd::Monitor lock_{"Device lock", true};
|
||||
/// ROCclr context
|
||||
amd::Context* context_;
|
||||
/// Device's ID
|
||||
|
||||
Reference in New Issue
Block a user