mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: rename pageSize2Mb to pageSize2M
The previous name "pageSize2Mb" defined in shared/source/helpers/constant.h is inconsistent to other variable, i.e. pageSize64k. Furthermore, it's a bit misleading because the page size is defined in Megabytes (MB), not in Megabits (Mb). Related-to: NEO-7695 Signed-off-by: Young Jin Yoon <young.jin.yoon@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f24ac10986
commit
81822e3716
@@ -37,7 +37,7 @@ inline constexpr size_t minBufferAlignment = 4;
|
||||
inline constexpr size_t cacheLineSize = 64;
|
||||
inline constexpr size_t pageSize = 4 * kiloByte;
|
||||
inline constexpr size_t pageSize64k = 64 * kiloByte;
|
||||
inline constexpr size_t pageSize2Mb = 2 * megaByte;
|
||||
inline constexpr size_t pageSize2M = 2 * megaByte;
|
||||
inline constexpr size_t preferredAlignment = pageSize; // alignment preferred for performance reasons, i.e. internal allocations
|
||||
inline constexpr size_t allocationAlignment = pageSize; // alignment required to gratify incoming pointer, i.e. passed host_ptr
|
||||
inline constexpr size_t slmWindowAlignment = 128 * kiloByte;
|
||||
|
||||
@@ -73,8 +73,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment
|
||||
|
||||
auto alignment = allocationData.alignment;
|
||||
if (allocationData.type == AllocationType::SVM_CPU) {
|
||||
alignment = MemoryConstants::pageSize2Mb;
|
||||
sizeAligned = alignUp(allocationData.size, MemoryConstants::pageSize2Mb);
|
||||
alignment = MemoryConstants::pageSize2M;
|
||||
sizeAligned = alignUp(allocationData.size, MemoryConstants::pageSize2M);
|
||||
}
|
||||
|
||||
if (GraphicsAllocation::isDebugSurfaceAllocationType(allocationData.type)) {
|
||||
@@ -577,7 +577,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool(
|
||||
adjustedAllocationData.alignment = MemoryConstants::pageSize64k;
|
||||
allocation = static_cast<MemoryAllocation *>(allocate32BitGraphicsMemoryImpl(adjustedAllocationData, true));
|
||||
} else if (allocationData.type == AllocationType::SVM_GPU) {
|
||||
auto storage = allocateSystemMemory(allocationData.size, MemoryConstants::pageSize2Mb);
|
||||
auto storage = allocateSystemMemory(allocationData.size, MemoryConstants::pageSize2M);
|
||||
auto canonizedGpuAddress = gmmHelper->canonize(reinterpret_cast<uint64_t>(allocationData.hostPtr));
|
||||
allocation = new MemoryAllocation(allocationData.rootDeviceIndex, numHandles, allocationData.type, storage, storage, canonizedGpuAddress,
|
||||
allocationData.size, counter, MemoryPool::LocalMemory, false, allocationData.flags.flushL3, maxOsContextCount);
|
||||
|
||||
@@ -61,11 +61,11 @@ DrmMemoryManager::DrmMemoryManager(gemCloseWorkerMode mode,
|
||||
|
||||
alignmentSelector.addCandidateAlignment(MemoryConstants::pageSize64k, true, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD64KB);
|
||||
if (DebugManager.flags.AlignLocalMemoryVaTo2MB.get() != 0) {
|
||||
alignmentSelector.addCandidateAlignment(MemoryConstants::pageSize2Mb, false, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB);
|
||||
alignmentSelector.addCandidateAlignment(MemoryConstants::pageSize2M, false, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB);
|
||||
}
|
||||
const size_t customAlignment = static_cast<size_t>(DebugManager.flags.ExperimentalEnableCustomLocalMemoryAlignment.get());
|
||||
if (customAlignment > 0) {
|
||||
const auto heapIndex = customAlignment >= MemoryConstants::pageSize2Mb ? HeapIndex::HEAP_STANDARD2MB : HeapIndex::HEAP_STANDARD64KB;
|
||||
const auto heapIndex = customAlignment >= MemoryConstants::pageSize2M ? HeapIndex::HEAP_STANDARD2MB : HeapIndex::HEAP_STANDARD64KB;
|
||||
alignmentSelector.addCandidateAlignment(customAlignment, true, AlignmentSelector::anyWastage, heapIndex);
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ DrmAllocation *DrmMemoryManager::allocateGraphicsMemoryWithAlignmentImpl(const A
|
||||
|
||||
auto mmapAlignment = cAlignment;
|
||||
if (alignedStorageSize >= 2 * MemoryConstants::megaByte) {
|
||||
mmapAlignment = MemoryConstants::pageSize2Mb;
|
||||
mmapAlignment = MemoryConstants::pageSize2M;
|
||||
}
|
||||
|
||||
auto drmAllocation = createAllocWithAlignment(allocationData, cSize, mmapAlignment, alignedStorageSize, alignedGpuAddress);
|
||||
@@ -511,8 +511,8 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(con
|
||||
auto offsetInPage = ptrDiff(allocationData.hostPtr, alignedPtr);
|
||||
auto rootDeviceIndex = allocationData.rootDeviceIndex;
|
||||
|
||||
alignedSize = alignUp(alignedSize, MemoryConstants::pageSize2Mb);
|
||||
auto gpuVirtualAddress = acquireGpuRangeWithCustomAlignment(alignedSize, rootDeviceIndex, HeapIndex::HEAP_STANDARD, MemoryConstants::pageSize2Mb);
|
||||
alignedSize = alignUp(alignedSize, MemoryConstants::pageSize2M);
|
||||
auto gpuVirtualAddress = acquireGpuRangeWithCustomAlignment(alignedSize, rootDeviceIndex, HeapIndex::HEAP_STANDARD, MemoryConstants::pageSize2M);
|
||||
if (!gpuVirtualAddress) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -669,7 +669,7 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) const {
|
||||
}
|
||||
|
||||
void Drm::setNewResourceBoundToVM(BufferObject *bo, uint32_t vmHandleId) {
|
||||
if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired() && isAligned(bo->peekAddress(), MemoryConstants::pageSize2Mb)) {
|
||||
if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired() && isAligned(bo->peekAddress(), MemoryConstants::pageSize2M)) {
|
||||
return;
|
||||
}
|
||||
const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines(bo->getRootDeviceIndex());
|
||||
|
||||
@@ -338,7 +338,7 @@ class Drm : public DriverModel {
|
||||
bool setPairAvailable = false;
|
||||
bool chunkingAvailable = false;
|
||||
uint32_t chunkingMode = 0;
|
||||
uint32_t minimalChunkingSize = MemoryConstants::pageSize2Mb;
|
||||
uint32_t minimalChunkingSize = MemoryConstants::pageSize2M;
|
||||
bool contextDebugSupported = false;
|
||||
bool pageFaultSupported = false;
|
||||
bool completionFenceSupported = false;
|
||||
|
||||
@@ -419,7 +419,7 @@ uint32_t ProductHelperHw<gfxProduct>::getThreadEuRatioForScratch(const HardwareI
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
size_t ProductHelperHw<gfxProduct>::getSvmCpuAlignment() const {
|
||||
return MemoryConstants::pageSize2Mb;
|
||||
return MemoryConstants::pageSize2M;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
|
||||
@@ -62,7 +62,7 @@ WddmMemoryManager::WddmMemoryManager(ExecutionEnvironment &executionEnvironment)
|
||||
alignmentSelector.addCandidateAlignment(MemoryConstants::pageSize64k, true, AlignmentSelector::anyWastage);
|
||||
if (DebugManager.flags.AlignLocalMemoryVaTo2MB.get() != 0) {
|
||||
constexpr static float maxWastage2Mb = 0.1f;
|
||||
alignmentSelector.addCandidateAlignment(MemoryConstants::pageSize2Mb, false, maxWastage2Mb);
|
||||
alignmentSelector.addCandidateAlignment(MemoryConstants::pageSize2M, false, maxWastage2Mb);
|
||||
}
|
||||
const size_t customAlignment = static_cast<size_t>(DebugManager.flags.ExperimentalEnableCustomLocalMemoryAlignment.get());
|
||||
if (customAlignment > 0) {
|
||||
|
||||
@@ -778,7 +778,7 @@ struct MemoryManagerDirectSubmissionImplicitScalingTest : public ::testing::Test
|
||||
constexpr auto enableLocalMemory = true;
|
||||
memoryManager = std::make_unique<MockMemoryManager>(false, enableLocalMemory, *executionEnvironment);
|
||||
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(1u, MemoryConstants::pageSize2Mb);
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(1u, MemoryConstants::pageSize2M);
|
||||
EXPECT_NE(0u, memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->getLeastOccupiedBank(allTilesMask));
|
||||
}
|
||||
|
||||
|
||||
@@ -567,7 +567,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenSingleTileWhenCreatingStorageInfoForRing
|
||||
TEST_F(MultiDeviceStorageInfoTest, givenMultiTileWhenCreatingStorageInfoForSemaphoreBufferThenFirstBankIsSelectedEvenIfOtherTileIsLessOccupied) {
|
||||
constexpr uint32_t firstAvailableTileMask = 2u;
|
||||
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2Mb);
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2M);
|
||||
EXPECT_NE(1u, memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->getLeastOccupiedBank(allTilesMask));
|
||||
|
||||
AffinityMaskHelper affinityMaskHelper{false};
|
||||
@@ -586,7 +586,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileWhenCreatingStorageInfoForSemap
|
||||
TEST_F(MultiDeviceStorageInfoTest, givenMultiTileWhenCreatingStorageInfoForCommandBufferThenFirstBankIsSelectedEvenIfOtherTileIsLessOccupied) {
|
||||
constexpr uint32_t firstAvailableTileMask = 2u;
|
||||
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2Mb);
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2M);
|
||||
EXPECT_NE(1u, memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->getLeastOccupiedBank(allTilesMask));
|
||||
|
||||
AffinityMaskHelper affinityMaskHelper{false};
|
||||
@@ -605,7 +605,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenMultiTileWhenCreatingStorageInfoForComma
|
||||
TEST_F(MultiDeviceStorageInfoTest, givenMultiTileWhenCreatingStorageInfoForRingBufferThenFirstBankIsSelectedEvenIfOtherTileIsLessOccupied) {
|
||||
constexpr uint32_t firstAvailableTileMask = 2u;
|
||||
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2Mb);
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2M);
|
||||
EXPECT_NE(1u, memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->getLeastOccupiedBank(allTilesMask));
|
||||
|
||||
AffinityMaskHelper affinityMaskHelper{false};
|
||||
@@ -627,7 +627,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenDirectSubmissionForceLocalMemoryStorageD
|
||||
DebugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(0);
|
||||
constexpr uint32_t firstAvailableTileMask = 2u;
|
||||
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2Mb);
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2M);
|
||||
EXPECT_NE(1u, memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->getLeastOccupiedBank(allTilesMask));
|
||||
|
||||
AffinityMaskHelper affinityMaskHelper{false};
|
||||
@@ -652,7 +652,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenDirectSubmissionForceLocalMemoryStorageE
|
||||
DebugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(1);
|
||||
constexpr uint32_t firstAvailableTileMask = 2u;
|
||||
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2Mb);
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2M);
|
||||
EXPECT_NE(1u, memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->getLeastOccupiedBank(allTilesMask));
|
||||
|
||||
AffinityMaskHelper affinityMaskHelper{false};
|
||||
@@ -682,7 +682,7 @@ TEST_F(MultiDeviceStorageInfoTest, givenDirectSubmissionForceLocalMemoryStorageE
|
||||
constexpr uint32_t firstAvailableTileMask = 2u;
|
||||
constexpr uint32_t leastOccupiedTileMask = 4u;
|
||||
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2Mb);
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(firstAvailableTileMask, MemoryConstants::pageSize2M);
|
||||
EXPECT_NE(1u, memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->getLeastOccupiedBank(allTilesMask));
|
||||
|
||||
AffinityMaskHelper affinityMaskHelper{false};
|
||||
|
||||
@@ -1247,8 +1247,8 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationSetWhenCreateS
|
||||
EXPECT_NE(allocation, nullptr);
|
||||
|
||||
auto drmAllocation = static_cast<DrmAllocation *>(allocation);
|
||||
EXPECT_EQ(ptr, alignUp(drmAllocation->getMmapPtr(), MemoryConstants::pageSize2Mb));
|
||||
EXPECT_EQ(size, drmAllocation->getMmapSize() - MemoryConstants::pageSize2Mb);
|
||||
EXPECT_EQ(ptr, alignUp(drmAllocation->getMmapPtr(), MemoryConstants::pageSize2M));
|
||||
EXPECT_EQ(size, drmAllocation->getMmapSize() - MemoryConstants::pageSize2M);
|
||||
|
||||
auto &bos = drmAllocation->getBOs();
|
||||
EXPECT_EQ(2u, bos.size());
|
||||
@@ -1294,8 +1294,8 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateKmdMigratedSharedAlloca
|
||||
EXPECT_NE(allocation, nullptr);
|
||||
|
||||
auto drmAllocation = static_cast<DrmAllocation *>(allocation);
|
||||
EXPECT_EQ(ptr, alignUp(drmAllocation->getMmapPtr(), MemoryConstants::pageSize2Mb));
|
||||
EXPECT_EQ(size, drmAllocation->getMmapSize() - MemoryConstants::pageSize2Mb);
|
||||
EXPECT_EQ(ptr, alignUp(drmAllocation->getMmapPtr(), MemoryConstants::pageSize2M));
|
||||
EXPECT_EQ(size, drmAllocation->getMmapSize() - MemoryConstants::pageSize2M);
|
||||
|
||||
auto &bos = drmAllocation->getBOs();
|
||||
EXPECT_EQ(1u, bos.size());
|
||||
|
||||
@@ -3057,8 +3057,8 @@ TEST_F(DrmMemoryManagerBasic, givenDrmMemoryManagerWhenAllocateGraphicsMemoryFor
|
||||
auto allocation = static_cast<DrmAllocation *>(memoryManager->allocateGraphicsMemoryForNonSvmHostPtr(allocationData));
|
||||
|
||||
EXPECT_EQ(static_cast<DrmAllocation *>(allocation)->getBO()->peekAddress(), castToUint64(allocation->getReservedAddressPtr()));
|
||||
EXPECT_TRUE(isAligned<MemoryConstants::pageSize2Mb>(static_cast<DrmAllocation *>(allocation)->getBO()->peekAddress()));
|
||||
EXPECT_TRUE(isAligned<MemoryConstants::pageSize2Mb>(allocation->getReservedAddressSize()));
|
||||
EXPECT_TRUE(isAligned<MemoryConstants::pageSize2M>(static_cast<DrmAllocation *>(allocation)->getBO()->peekAddress()));
|
||||
EXPECT_TRUE(isAligned<MemoryConstants::pageSize2M>(allocation->getReservedAddressSize()));
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
@@ -4490,7 +4490,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenAffinityMaskDeviceWith
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, whenWddmMemoryManagerIsCreatedThenAlignmentSelectorHasExpectedAlignments) {
|
||||
std::vector<AlignmentSelector::CandidateAlignment> expectedAlignments = {
|
||||
{MemoryConstants::pageSize2Mb, false, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB},
|
||||
{MemoryConstants::pageSize2M, false, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB},
|
||||
{MemoryConstants::pageSize64k, true, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD64KB},
|
||||
};
|
||||
|
||||
@@ -4526,7 +4526,7 @@ TEST_F(DrmMemoryManagerTest, givenCustomAlignmentWhenWddmMemoryManagerIsCreatedT
|
||||
{
|
||||
DebugManager.flags.ExperimentalEnableCustomLocalMemoryAlignment.set(MemoryConstants::megaByte);
|
||||
std::vector<AlignmentSelector::CandidateAlignment> expectedAlignments = {
|
||||
{MemoryConstants::pageSize2Mb, false, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB},
|
||||
{MemoryConstants::pageSize2M, false, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB},
|
||||
{MemoryConstants::megaByte, true, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD64KB},
|
||||
{MemoryConstants::pageSize64k, true, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD64KB},
|
||||
};
|
||||
@@ -4535,10 +4535,10 @@ TEST_F(DrmMemoryManagerTest, givenCustomAlignmentWhenWddmMemoryManagerIsCreatedT
|
||||
}
|
||||
|
||||
{
|
||||
DebugManager.flags.ExperimentalEnableCustomLocalMemoryAlignment.set(2 * MemoryConstants::pageSize2Mb);
|
||||
DebugManager.flags.ExperimentalEnableCustomLocalMemoryAlignment.set(2 * MemoryConstants::pageSize2M);
|
||||
std::vector<AlignmentSelector::CandidateAlignment> expectedAlignments = {
|
||||
{2 * MemoryConstants::pageSize2Mb, true, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB},
|
||||
{MemoryConstants::pageSize2Mb, false, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB},
|
||||
{2 * MemoryConstants::pageSize2M, true, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB},
|
||||
{MemoryConstants::pageSize2M, false, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD2MB},
|
||||
{MemoryConstants::pageSize64k, true, AlignmentSelector::anyWastage, HeapIndex::HEAP_STANDARD64KB},
|
||||
};
|
||||
TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment);
|
||||
@@ -5291,7 +5291,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
|
||||
AllocationData allocData;
|
||||
allocData.allFlags = 0;
|
||||
allocData.size = MemoryConstants::pageSize2Mb;
|
||||
allocData.size = MemoryConstants::pageSize2M;
|
||||
allocData.type = AllocationType::BUFFER;
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
@@ -5315,7 +5315,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
|
||||
AllocationData allocData;
|
||||
allocData.allFlags = 0;
|
||||
allocData.size = MemoryConstants::pageSize2Mb;
|
||||
allocData.size = MemoryConstants::pageSize2M;
|
||||
allocData.type = AllocationType::BUFFER;
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
@@ -5337,7 +5337,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
|
||||
AllocationData allocData;
|
||||
allocData.allFlags = 0;
|
||||
allocData.size = MemoryConstants::pageSize2Mb;
|
||||
allocData.size = MemoryConstants::pageSize2M;
|
||||
allocData.type = AllocationType::BUFFER;
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
@@ -5362,7 +5362,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
|
||||
AllocationData allocData;
|
||||
allocData.allFlags = 0;
|
||||
allocData.size = MemoryConstants::pageSize2Mb;
|
||||
allocData.size = MemoryConstants::pageSize2M;
|
||||
allocData.type = AllocationType::BUFFER;
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
@@ -5406,7 +5406,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
|
||||
AllocationData allocData;
|
||||
allocData.allFlags = 0;
|
||||
allocData.size = MemoryConstants::pageSize2Mb;
|
||||
allocData.size = MemoryConstants::pageSize2M;
|
||||
allocData.type = AllocationType::BUFFER;
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
@@ -5859,7 +5859,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, given2MbAlignmentAllowedWhenAll
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
EXPECT_EQ(MemoryManager::AllocationStatus::Success, allocationStatus);
|
||||
EXPECT_TRUE(isAllocationWithinHeap(*memoryManager, *allocation, HeapIndex::HEAP_STANDARD2MB));
|
||||
EXPECT_TRUE(isAligned(allocation->getGpuAddress(), MemoryConstants::pageSize2Mb));
|
||||
EXPECT_TRUE(isAligned(allocation->getGpuAddress(), MemoryConstants::pageSize2M));
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
}
|
||||
@@ -5884,7 +5884,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, givenExtendedHeapPreferredAnd2M
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocationData, allocationStatus);
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
EXPECT_EQ(MemoryManager::AllocationStatus::Success, allocationStatus);
|
||||
EXPECT_TRUE(isAligned(allocation->getGpuAddress(), MemoryConstants::pageSize2Mb));
|
||||
EXPECT_TRUE(isAligned(allocation->getGpuAddress(), MemoryConstants::pageSize2M));
|
||||
EXPECT_TRUE(isAllocationWithinHeap(*memoryManager, *allocation, HeapIndex::HEAP_EXTENDED));
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
@@ -5904,7 +5904,7 @@ TEST_F(DrmMemoryManagerLocalMemoryAlignmentTest, givenExtendedHeapPreferredAnd2M
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
EXPECT_EQ(MemoryManager::AllocationStatus::Success, allocationStatus);
|
||||
EXPECT_TRUE(isAllocationWithinHeap(*memoryManager, *allocation, HeapIndex::HEAP_EXTENDED));
|
||||
EXPECT_TRUE(isAligned(allocation->getGpuAddress(), MemoryConstants::pageSize2Mb));
|
||||
EXPECT_TRUE(isAligned(allocation->getGpuAddress(), MemoryConstants::pageSize2M));
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
}
|
||||
@@ -6244,7 +6244,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenOversize
|
||||
}
|
||||
auto largerSize = 6 * MemoryConstants::megaByte;
|
||||
|
||||
auto gpuAddress0 = memoryManager->getGfxPartition(rootDeviceIndex)->heapAllocateWithCustomAlignment(heap, largerSize, MemoryConstants::pageSize2Mb);
|
||||
auto gpuAddress0 = memoryManager->getGfxPartition(rootDeviceIndex)->heapAllocateWithCustomAlignment(heap, largerSize, MemoryConstants::pageSize2M);
|
||||
EXPECT_NE(0u, gpuAddress0);
|
||||
EXPECT_EQ(6 * MemoryConstants::megaByte, largerSize);
|
||||
auto gpuAddress1 = memoryManager->getGfxPartition(rootDeviceIndex)->heapAllocate(heap, largerSize);
|
||||
@@ -6296,7 +6296,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenAllocati
|
||||
ASSERT_NE(nullptr, allocation2);
|
||||
EXPECT_EQ(allocData.size, allocation2->getUnderlyingBufferSize());
|
||||
EXPECT_EQ(allocData.size, static_cast<DrmAllocation *>(allocation2)->getBO()->peekSize());
|
||||
EXPECT_TRUE(allocation2->getGpuAddress() % MemoryConstants::pageSize2Mb == 0u);
|
||||
EXPECT_TRUE(allocation2->getGpuAddress() % MemoryConstants::pageSize2M == 0u);
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
memoryManager->freeGraphicsMemory(allocation2);
|
||||
@@ -6321,7 +6321,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenDebugVar
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
EXPECT_EQ(allocData.size, allocation->getUnderlyingBufferSize());
|
||||
EXPECT_EQ(allocData.size, static_cast<DrmAllocation *>(allocation)->getBO()->peekSize());
|
||||
EXPECT_TRUE(allocation->getGpuAddress() % MemoryConstants::pageSize2Mb == 0u);
|
||||
EXPECT_TRUE(allocation->getGpuAddress() % MemoryConstants::pageSize2M == 0u);
|
||||
|
||||
size = 32 * MemoryConstants::megaByte;
|
||||
allocData.size = size;
|
||||
@@ -6330,7 +6330,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenDebugVar
|
||||
ASSERT_NE(nullptr, allocation2);
|
||||
EXPECT_EQ(allocData.size, allocation2->getUnderlyingBufferSize());
|
||||
EXPECT_EQ(allocData.size, static_cast<DrmAllocation *>(allocation2)->getBO()->peekSize());
|
||||
EXPECT_TRUE(allocation2->getGpuAddress() % MemoryConstants::pageSize2Mb == 0u);
|
||||
EXPECT_TRUE(allocation2->getGpuAddress() % MemoryConstants::pageSize2M == 0u);
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
memoryManager->freeGraphicsMemory(allocation2);
|
||||
|
||||
@@ -507,7 +507,7 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2WhenIsBlitterForImagesSupportedIsCalledT
|
||||
|
||||
DG2TEST_F(ProductHelperTestDg2, WhenGetSvmCpuAlignmentThenProperValueIsReturned) {
|
||||
|
||||
EXPECT_EQ(MemoryConstants::pageSize2Mb, productHelper->getSvmCpuAlignment());
|
||||
EXPECT_EQ(MemoryConstants::pageSize2M, productHelper->getSvmCpuAlignment());
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductHelperTestDg2, givenB0rCSteppingWhenAskingIfTile64With3DSurfaceOnBCSIsSupportedThenReturnTrue) {
|
||||
|
||||
Reference in New Issue
Block a user