mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Device now adds dependencies on ExecutionEnvironment
- This allows for ExecutionEnvironment to live longer then platform after its global destruction - Device adds references to ExecutionEnvironment after creation - When device is destroyed it removes the dependency causing the cleanup - Platform upon destruction no longer destroys the device, but decrements the internal ref count. Change-Id: I22593ea44b2b50e3416575a9e97e3ce0a1f8b5c0
This commit is contained in:

committed by
sys_ocldev

parent
bc7aa63a37
commit
a95cca71e4
@ -161,6 +161,7 @@ bool Platform::initialize() {
|
||||
}
|
||||
|
||||
compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(pDevice->getDeviceInfo().deviceExtensions);
|
||||
pDevice->connectToExecutionEnvironment(this->executionEnvironment);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -191,7 +192,9 @@ void Platform::shutdown() {
|
||||
}
|
||||
|
||||
for (auto dev : this->devices) {
|
||||
delete dev;
|
||||
if (dev) {
|
||||
dev->decRefInternal();
|
||||
}
|
||||
}
|
||||
devices.clear();
|
||||
state = StateNone;
|
||||
@ -199,7 +202,6 @@ void Platform::shutdown() {
|
||||
delete platformInfo;
|
||||
platformInfo = nullptr;
|
||||
|
||||
DeviceFactory::releaseDevices();
|
||||
std::string().swap(compilerExtensions);
|
||||
|
||||
gtpinNotifyPlatformShutdown();
|
||||
|
Reference in New Issue
Block a user