mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
Simplify memory manager API [1/n]
pass struct with properties to allocate graphics memory methods: for protected methods use AllocationData for public methods use AllocationProperties Change-Id: Ie1c3cb6b5e330bc4adac2ca8b0bf02d30ec76065 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
ace20aba5b
commit
c8748b77a0
@@ -143,10 +143,11 @@ bool Device::createDeviceImpl(const HardwareInfo *pHwInfo, Device &outDevice) {
|
||||
outDevice.executionEnvironment->memoryManager->setForce32BitAllocations(outDevice.getDeviceInfo().force32BitAddressess);
|
||||
|
||||
if (outDevice.preemptionMode == PreemptionMode::MidThread || outDevice.isSourceLevelDebuggerActive()) {
|
||||
size_t requiredSize = pHwInfo->capabilityTable.requiredPreemptionSurfaceSize;
|
||||
size_t alignment = 256 * MemoryConstants::kiloByte;
|
||||
bool uncacheable = outDevice.getWaTable()->waCSRUncachable;
|
||||
outDevice.preemptionAllocation = outDevice.executionEnvironment->memoryManager->allocateGraphicsMemory(requiredSize, alignment, false, uncacheable);
|
||||
AllocationProperties properties;
|
||||
properties.size = pHwInfo->capabilityTable.requiredPreemptionSurfaceSize;
|
||||
properties.flags.uncacheable = outDevice.getWaTable()->waCSRUncachable;
|
||||
properties.alignment = 256 * MemoryConstants::kiloByte;
|
||||
outDevice.preemptionAllocation = outDevice.executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(properties);
|
||||
if (!outDevice.preemptionAllocation) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user