Make sure to remove the global var from amd::MemObjMap

We need this otherwise ROCr can give us a matching address
for another allocation and doing "insert" in ROCclr will not
update the map with the newest object. We would then end up
using stale objects (yikes)
SWDEV-234992

Change-Id: I3475adf9781a9309d64a024fae45181d7e5afb04
This commit is contained in:
Christophe Paquot
2020-05-13 00:26:19 -07:00
förälder 374fd36f31
incheckning 2cc0fb9381
+5
Visa fil
@@ -229,6 +229,11 @@ std::vector< std::pair<hipModule_t, bool> >* PlatformState::unregisterVar(hipMod
= reinterpret_cast<texture<float, hipTextureType1D, hipReadModeElementType> *>(dvar.shadowVptr);
delete tex_hptr;
}
for (size_t dev = 0; dev < g_devices.size(); ++dev) {
if (dvar.rvars[dev].getdeviceptr()) {
amd::MemObjMap::RemoveMemObj(dvar.rvars[dev].getdeviceptr());
}
}
vars_.erase(it++);
} else {
++it;