mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 16:24:18 +08:00
fix: track registered CSR clients
In L0 its not possible to track objects relations. For example CmdList may be removed before Event. In such case, Event needs to safely skip unregister call, without accessing CmdList/CmdQueue object. Related-To: NEO-8884 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ace5e67b51
commit
53f635e392
@@ -94,6 +94,8 @@ CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvi
|
||||
productHelper.fillStateBaseAddressPropertiesSupportStructure(sbaSupportFlags);
|
||||
this->doubleSbaWa = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo);
|
||||
this->l1CachePolicyData.init(productHelper);
|
||||
|
||||
registeredClients.reserve(16);
|
||||
}
|
||||
|
||||
CommandStreamReceiver::~CommandStreamReceiver() {
|
||||
@@ -1070,5 +1072,24 @@ bool CommandStreamReceiver::isRayTracingStateProgramingNeeded(Device &device) co
|
||||
return device.getRTMemoryBackedBuffer() && getBtdCommandDirty();
|
||||
}
|
||||
|
||||
void CommandStreamReceiver::registerClient(void *client) {
|
||||
std::unique_lock<MutexType> lock(registeredClientsMutex);
|
||||
auto element = std::find(registeredClients.begin(), registeredClients.end(), client);
|
||||
if (element == registeredClients.end()) {
|
||||
registeredClients.push_back(client);
|
||||
numClients++;
|
||||
}
|
||||
}
|
||||
|
||||
void CommandStreamReceiver::unregisterClient(void *client) {
|
||||
std::unique_lock<MutexType> lock(registeredClientsMutex);
|
||||
|
||||
auto element = std::find(registeredClients.begin(), registeredClients.end(), client);
|
||||
if (element != registeredClients.end()) {
|
||||
registeredClients.erase(element);
|
||||
numClients--;
|
||||
}
|
||||
}
|
||||
|
||||
std::function<void()> CommandStreamReceiver::debugConfirmationFunction = []() { std::cin.get(); };
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user