Add hwInfo to args of fillPoliciesInProperties()

Related-To: NEO-4207

Change-Id: I74b672dd48d9797dfbc871a9e79b92fc2aae9639
Signed-off-by: Andrzej Swierczynski <andrzej.swierczynski@intel.com>
This commit is contained in:
Andrzej Swierczynski
2020-03-11 12:42:44 +01:00
committed by sys_ocldev
parent e9778d40c1
commit f8500ac3a8
12 changed files with 27 additions and 25 deletions

View File

@@ -228,7 +228,7 @@ Buffer *Buffer::create(Context *context,
}
if (!memory) {
AllocationProperties allocProperties = MemoryPropertiesParser::getAllocationProperties(rootDeviceIndex, memoryProperties, allocateMemory, size, allocationType, context->areMultiStorageAllocationsPreferred());
AllocationProperties allocProperties = MemoryPropertiesParser::getAllocationProperties(rootDeviceIndex, memoryProperties, allocateMemory, size, allocationType, context->areMultiStorageAllocationsPreferred(), context->getDevice(0)->getHardwareInfo());
memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties, hostPtr);
}
@@ -241,7 +241,7 @@ Buffer *Buffer::create(Context *context,
allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
zeroCopyAllowed = false;
copyMemoryFromHostPtr = true;
AllocationProperties allocProperties = MemoryPropertiesParser::getAllocationProperties(rootDeviceIndex, memoryProperties, true, size, allocationType, context->areMultiStorageAllocationsPreferred());
AllocationProperties allocProperties = MemoryPropertiesParser::getAllocationProperties(rootDeviceIndex, memoryProperties, true, size, allocationType, context->areMultiStorageAllocationsPreferred(), context->getDevice(0)->getHardwareInfo());
memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties);
}

View File

@@ -268,7 +268,7 @@ Image *Image::create(Context *context,
if (memoryProperties.flags.useHostPtr) {
if (!context->isSharedContext) {
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(rootDeviceIndex, imgInfo, false, memoryProperties);
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(rootDeviceIndex, imgInfo, false, memoryProperties, context->getDevice(0)->getHardwareInfo());
memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties, hostPtr);
@@ -292,7 +292,7 @@ Image *Image::create(Context *context,
mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr);
}
} else {
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(rootDeviceIndex, imgInfo, true, memoryProperties);
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(rootDeviceIndex, imgInfo, true, memoryProperties, context->getDevice(0)->getHardwareInfo());
memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties);
if (memory && MemoryPool::isSystemMemoryPool(memory->getMemoryPool())) {

View File

@@ -32,7 +32,7 @@ class MemObjHelper {
static bool validateMemoryPropertiesForBuffer(const MemoryPropertiesFlags &memoryProperties, cl_mem_flags flags, cl_mem_flags_intel flagsIntel);
static bool validateMemoryPropertiesForImage(const MemoryPropertiesFlags &memoryProperties, cl_mem_flags flags, cl_mem_flags_intel flagsIntel, cl_mem parent);
static AllocationProperties getAllocationPropertiesWithImageInfo(uint32_t rootDeviceIndex, ImageInfo &imgInfo, bool allocateMemory, const MemoryPropertiesFlags &memoryProperties);
static AllocationProperties getAllocationPropertiesWithImageInfo(uint32_t rootDeviceIndex, ImageInfo &imgInfo, bool allocateMemory, const MemoryPropertiesFlags &memoryProperties, const HardwareInfo &hwInfo);
static bool checkMemFlagsForSubBuffer(cl_mem_flags flags);
static SVMAllocsManager::SvmAllocationProperties getSvmAllocationProperties(cl_mem_flags flags);
static bool isSuitableForRenderCompression(bool renderCompressed, const MemoryPropertiesFlags &properties, Context &context, bool preferCompression);

View File

@@ -67,9 +67,9 @@ bool MemObjHelper::validateMemoryPropertiesForImage(const MemoryPropertiesFlags
return validateExtraMemoryProperties(memoryProperties, flags, flagsIntel);
}
AllocationProperties MemObjHelper::getAllocationPropertiesWithImageInfo(uint32_t rootDeviceIndex, ImageInfo &imgInfo, bool allocateMemory, const MemoryPropertiesFlags &memoryProperties) {
AllocationProperties MemObjHelper::getAllocationPropertiesWithImageInfo(uint32_t rootDeviceIndex, ImageInfo &imgInfo, bool allocateMemory, const MemoryPropertiesFlags &memoryProperties, const HardwareInfo &hwInfo) {
AllocationProperties allocationProperties{rootDeviceIndex, allocateMemory, imgInfo, GraphicsAllocation::AllocationType::IMAGE};
MemoryPropertiesParser::fillPoliciesInProperties(allocationProperties, memoryProperties);
MemoryPropertiesParser::fillPoliciesInProperties(allocationProperties, memoryProperties, hwInfo);
return allocationProperties;
}

View File

@@ -59,7 +59,7 @@ Pipe *Pipe::create(Context *context,
auto size = static_cast<size_t>(packetSize * (maxPackets + 1) + intelPipeHeaderReservedSpace);
auto rootDeviceIndex = context->getDevice(0)->getRootDeviceIndex();
AllocationProperties allocProperties =
MemoryPropertiesParser::getAllocationProperties(rootDeviceIndex, memoryPropertiesFlags, true, size, GraphicsAllocation::AllocationType::PIPE, false);
MemoryPropertiesParser::getAllocationProperties(rootDeviceIndex, memoryPropertiesFlags, true, size, GraphicsAllocation::AllocationType::PIPE, false, context->getDevice(0)->getHardwareInfo());
GraphicsAllocation *memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties);
if (!memory) {
errcodeRet = CL_OUT_OF_HOST_MEMORY;