mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
Add preemption allocation for each of the Csr
Change-Id: Id14fbfbf6e9a6a85f035e75b4a20ca198c0996e5 Signed-off-by: Hinz <daria.hinz@intel.com>
This commit is contained in:
@@ -179,6 +179,11 @@ void CommandStreamReceiver::cleanupResources() {
|
||||
tagAllocation = nullptr;
|
||||
tagAddress = nullptr;
|
||||
}
|
||||
|
||||
if (preemptionAllocation) {
|
||||
getMemoryManager()->freeGraphicsMemory(preemptionAllocation);
|
||||
preemptionAllocation = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool CommandStreamReceiver::waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMicroseconds, uint32_t taskCountToWait) {
|
||||
@@ -364,6 +369,15 @@ bool CommandStreamReceiver::initializeTagAllocation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CommandStreamReceiver::createPreemptionAllocation() {
|
||||
auto hwInfo = executionEnvironment.getHardwareInfo();
|
||||
AllocationProperties properties{true, hwInfo->capabilityTable.requiredPreemptionSurfaceSize, GraphicsAllocation::AllocationType::PREEMPTION, false};
|
||||
properties.flags.uncacheable = hwInfo->workaroundTable.waCSRUncachable;
|
||||
properties.alignment = 256 * MemoryConstants::kiloByte;
|
||||
this->preemptionAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||
return this->preemptionAllocation != nullptr;
|
||||
}
|
||||
|
||||
std::unique_lock<CommandStreamReceiver::MutexType> CommandStreamReceiver::obtainUniqueOwnership() {
|
||||
return std::unique_lock<CommandStreamReceiver::MutexType>(this->ownershipMutex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user