SWDEV-224639 - Device memory is still occupied

- Add cache free on OCL context destroy
- Remove std::mem_fun() usage, since it was removed in c++17

Change-Id: If6acd08f13a2298912ecd78fc025dcf0b32aee54
Этот коммит содержится в:
German Andryeyev
2020-03-27 17:42:49 -04:00
родитель 7ef8dfdfe7
Коммит 9f795d750d
4 изменённых файлов: 28 добавлений и 14 удалений
+10 -6
Просмотреть файл
@@ -75,12 +75,18 @@ Context::Context(const std::vector<Device*>& devices, const Info& info)
Context::~Context() {
static const bool VALIDATE_ONLY = false;
// Dissociate OCL context with any external device
if (info_.flags_ & (GLDeviceKhr | D3D10DeviceKhr | D3D11DeviceKhr)) {
// Loop through all devices
for (const auto& it : devices_) {
// Loop through all devices
for (const auto& it : devices_) {
// Dissociate OCL context with any external device
if (info_.flags_ & (GLDeviceKhr | D3D10DeviceKhr | D3D11DeviceKhr)) {
it->unbindExternalDevice(info_.flags_, info_.hDev_, info_.hCtx_, VALIDATE_ONLY);
}
// Notify device about context destroy
it->ContextDestroy();
// Release device
it->release();
}
if (properties_ != NULL) {
@@ -91,8 +97,6 @@ Context::~Context() {
glenv_ = NULL;
}
std::for_each(devices_.begin(), devices_.end(), std::mem_fun(&Device::release));
#ifdef WITH_LIQUID_FLASH
lfTerminate();
#endif