mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Improve waiting for MemObj completion
Change-Id: I62078224daa21ee1d6f58f1e6dc59e306ae420b6 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
a8db48dbca
commit
cbe4e06165
@@ -69,7 +69,7 @@ MemObj::~MemObj() {
|
||||
needWait = true;
|
||||
}
|
||||
if (needWait && graphicsAllocation->isUsed()) {
|
||||
waitForCsrCompletion();
|
||||
memoryManager->waitForEnginesCompletion(*graphicsAllocation);
|
||||
}
|
||||
destroyGraphicsAllocation(graphicsAllocation, doAsyncDestrucions);
|
||||
graphicsAllocation = nullptr;
|
||||
@@ -283,11 +283,6 @@ void MemObj::releaseAllocatedMapPtr() {
|
||||
allocatedMapPtr = nullptr;
|
||||
}
|
||||
|
||||
void MemObj::waitForCsrCompletion() {
|
||||
auto osContextId = context->getDevice(0)->getDefaultEngine().osContext->getContextId();
|
||||
memoryManager->getDefaultCommandStreamReceiver(0)->waitForCompletionWithTimeout(false, TimeoutControls::maxTimeout, graphicsAllocation->getTaskCount(osContextId));
|
||||
}
|
||||
|
||||
void MemObj::destroyGraphicsAllocation(GraphicsAllocation *allocation, bool asyncDestroy) {
|
||||
if (asyncDestroy) {
|
||||
memoryManager->checkGpuUsageAndDestroyGraphicsAllocations(allocation);
|
||||
|
||||
Reference in New Issue
Block a user