mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Refactor MemoryPropertiesFlags
Rename: - MemoryPropertiesFlags to MemoryProperties - MemoryPropertiesParser to MemoryPropertiesParserHelper - getMemoryPropertiesFlags to getFlags - getMemoryPropertiesFlagsIntel to getFlagsIntel - functions involved with MemoryPropertiesFlags Related-To: NEO-4143 Change-Id: I4eec67bba95dd5354d0df43c31e6ca724909138e Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
9cdd0574c1
commit
b0ed3b2ab1
@@ -205,7 +205,7 @@ void *SVMAllocsManager::createZeroCopySvmAllocation(uint32_t rootDeviceIndex, si
|
||||
GraphicsAllocation::AllocationType::SVM_ZERO_COPY,
|
||||
false, // isMultiStorageAllocation
|
||||
deviceBitfield};
|
||||
MemoryPropertiesParser::fillCachePolicyInProperties(properties, false, svmProperties.readOnly, false);
|
||||
MemoryPropertiesParserHelper::fillCachePolicyInProperties(properties, false, svmProperties.readOnly, false);
|
||||
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
|
||||
if (!allocation) {
|
||||
return nullptr;
|
||||
@@ -229,7 +229,7 @@ void *SVMAllocsManager::createUnifiedAllocationWithDeviceStorage(uint32_t rootDe
|
||||
false, // isMultiStorageAllocation
|
||||
unifiedMemoryProperties.subdeviceBitfield};
|
||||
cpuProperties.alignment = 2 * MemoryConstants::megaByte;
|
||||
MemoryPropertiesParser::fillCachePolicyInProperties(cpuProperties, false, svmProperties.readOnly, false);
|
||||
MemoryPropertiesParserHelper::fillCachePolicyInProperties(cpuProperties, false, svmProperties.readOnly, false);
|
||||
GraphicsAllocation *allocationCpu = memoryManager->allocateGraphicsMemoryWithProperties(cpuProperties);
|
||||
if (!allocationCpu) {
|
||||
return nullptr;
|
||||
@@ -247,7 +247,7 @@ void *SVMAllocsManager::createUnifiedAllocationWithDeviceStorage(uint32_t rootDe
|
||||
unifiedMemoryProperties.subdeviceBitfield};
|
||||
|
||||
gpuProperties.alignment = 2 * MemoryConstants::megaByte;
|
||||
MemoryPropertiesParser::fillCachePolicyInProperties(gpuProperties, false, svmProperties.readOnly, false);
|
||||
MemoryPropertiesParserHelper::fillCachePolicyInProperties(gpuProperties, false, svmProperties.readOnly, false);
|
||||
GraphicsAllocation *allocationGpu = memoryManager->allocateGraphicsMemoryWithProperties(gpuProperties, svmPtr);
|
||||
if (!allocationGpu) {
|
||||
memoryManager->freeGraphicsMemory(allocationCpu);
|
||||
|
||||
@@ -27,7 +27,7 @@ struct SvmAllocationData {
|
||||
GraphicsAllocation *gpuAllocation = nullptr;
|
||||
size_t size = 0;
|
||||
InternalMemoryType memoryType = InternalMemoryType::SVM;
|
||||
MemoryPropertiesFlags allocationFlagsProperty;
|
||||
MemoryProperties allocationFlagsProperty;
|
||||
void *device = nullptr;
|
||||
};
|
||||
|
||||
@@ -76,7 +76,7 @@ class SVMAllocsManager {
|
||||
UnifiedMemoryProperties() = default;
|
||||
UnifiedMemoryProperties(InternalMemoryType memoryType) : memoryType(memoryType){};
|
||||
InternalMemoryType memoryType = InternalMemoryType::NOT_SPECIFIED;
|
||||
MemoryPropertiesFlags allocationFlags;
|
||||
MemoryProperties allocationFlags;
|
||||
void *device = nullptr;
|
||||
DeviceBitfield subdeviceBitfield;
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
struct MemoryPropertiesFlags {
|
||||
struct MemoryProperties {
|
||||
union {
|
||||
MemoryFlags flags;
|
||||
uint32_t allFlags = 0;
|
||||
@@ -19,6 +19,6 @@ struct MemoryPropertiesFlags {
|
||||
MemoryAllocFlags allocFlags;
|
||||
uint32_t allAllocFlags = 0;
|
||||
};
|
||||
static_assert(sizeof(MemoryPropertiesFlags::flags) == sizeof(MemoryPropertiesFlags::allFlags) && sizeof(MemoryPropertiesFlags::allocFlags) == sizeof(MemoryPropertiesFlags::allAllocFlags), "");
|
||||
static_assert(sizeof(MemoryProperties::flags) == sizeof(MemoryProperties::allFlags) && sizeof(MemoryProperties::allocFlags) == sizeof(MemoryProperties::allAllocFlags), "");
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user