Move AllocationType enum out of GraphicsAllocation class

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2022-02-04 13:59:01 +00:00
committed by Compute-Runtime-Automation
parent fd27098194
commit 4b0d986876
262 changed files with 2075 additions and 2063 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -154,7 +154,7 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledOnDisabledDebugManagerW
}
TEST(AllocationInfoLogging, givenBaseGraphicsAllocationWhenGettingImplementationSpecificAllocationInfoThenReturnEmptyInfoString) {
GraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull);
GraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull);
EXPECT_STREQ(graphicsAllocation.getAllocationInfoString().c_str(), "");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -36,7 +36,7 @@ struct DirectSubmissionDispatchBufferFixture : public DirectSubmissionFixture {
DirectSubmissionFixture::SetUp();
MemoryManager *memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get();
const AllocationProperties commandBufferProperties{pDevice->getRootDeviceIndex(), 0x1000,
GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()};
AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()};
commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties);
batchBuffer.endCmdPtr = &bbStart[0];

View File

@@ -236,7 +236,7 @@ HWTEST_F(BlitTests, givenMemoryWhenFillPatternWithBlitThenCommandIsProgrammed) {
uint32_t pattern[4] = {1, 0, 0, 0};
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -253,7 +253,7 @@ HWTEST_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWhe
uint32_t pattern[4] = {1, 0, 0, 0};
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth) - 1,
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
@@ -275,7 +275,7 @@ HWTEST_F(BlitTests, givenMemoryPointerOffsetVerifyCorrectDestinationBaseAddress)
uint32_t pattern[4] = {5, 0, 0, 0};
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
@@ -303,7 +303,7 @@ HWTEST_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBli
uint32_t pattern[4] = {1, 0, 0, 0};
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -331,7 +331,7 @@ HWTEST_F(BlitTests, givenMemorySizeIsLessThanTwicenMaxWidthWhenFillPatternWithBl
uint32_t pattern[4] = {1, 0, 0, 0};
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, ((BlitterConstants::maxBlitWidth + 1) * sizeof(uint32_t)),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -363,7 +363,7 @@ HWTEST2_F(BlitTests, givenMemoryWhenFillPatternSizeIs4BytesThen32BitMaskISSetCor
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -32,7 +32,7 @@ class GivenLinearStreamWhenCallDispatchBlitMemoryColorFillThenCorrectDepthIsProg
void TestBodyImpl(size_t patternSize, COLOR_DEPTH expectedDepth) {
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
uint32_t patternToCommand[4];

View File

@@ -77,10 +77,10 @@ HWTEST2_F(BlitTests, givenIncorrectBytePerPixelWhenAppendColorDepthThenAbortIsTh
HWTEST2_F(BlitTests, givenSrcAndDestinationImagesWhenAppendSliceOffsetsThenAdressAreCorectOffseted, IsGen12LP) {
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
mockAllocationSrc.setGmm(gmm.get(), 0);
@@ -115,10 +115,10 @@ HWTEST2_F(BlitTests, givenSrcAndDestinationImagesWhenAppendSliceOffsetsThenAdres
HWTEST2_F(BlitTests, givenInputAndDefaultSlicePitchWhenAppendBlitCommandsForImagesThenSlicePitchesAreCorrect, IsGen12LP) {
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
@@ -179,10 +179,10 @@ HWTEST2_F(BlitTests, givenTiledSrcAndDestinationImagesWhenAppendImageCommandsThe
myResourecInfo->pitch = 0x100;
myResourecInfo->flags.Info.TiledY = 1;
gmm->gmmResourceInfo.reset(myResourecInfo.release());
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
mockAllocationSrc.setGmm(gmm.get(), 0);
@@ -210,10 +210,10 @@ HWTEST2_F(BlitTests, givenLinearSrcAndDestinationImagesWhenAppendImageCommandsTh
myResourecInfo->pitch = 0x100;
myResourecInfo->flags.Info.Linear = 1;
gmm->gmmResourceInfo.reset(myResourecInfo.release());
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
mockAllocationSrc.setGmm(gmm.get(), 0);

View File

@@ -19,7 +19,7 @@ HWTEST2_F(BlitTests, givenOneBytePatternWhenFillPatternWithBlitThenCommandIsProg
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -35,7 +35,7 @@ HWTEST2_F(BlitTests, givenDeviceWithoutDefaultGmmWhenAppendBlitCommandsForVillBu
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -58,7 +58,7 @@ HWTEST2_F(BlitTests, givenGmmWithDisabledCompresionWhenAppendBlitCommandsForVill
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
mockAllocation.setGmm(gmm.get(), 0u);
@@ -82,7 +82,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForVillB
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
mockAllocation.setGmm(gmm.get(), 0u);
@@ -112,7 +112,7 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForVillBuffer
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -135,7 +135,7 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndSystemMe
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -158,7 +158,7 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndLocalMem
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -179,7 +179,7 @@ HWTEST2_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWh
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth) - 1,
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -199,7 +199,7 @@ HWTEST2_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBl
uint32_t pattern = 1;
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);

View File

@@ -35,7 +35,7 @@ struct CompressionParamsSupportedMatcher {
HWTEST2_F(BlitTests, givenDeviceWithoutDefaultGmmWhenAppendBlitCommandsForFillBufferThenDstCompressionDisabled, CompressionParamsSupportedMatcher) {
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -48,7 +48,7 @@ HWTEST2_F(BlitTests, givenGmmWithDisabledCompresionWhenAppendBlitCommandsForFill
auto blitCmd = FamilyType::cmdInitXyColorBlt;
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
gmm->isCompressionEnabled = false;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
mockAllocation.setGmm(gmm.get(), 0);
@@ -62,7 +62,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForFillB
auto blitCmd = FamilyType::cmdInitXyColorBlt;
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
gmm->isCompressionEnabled = true;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
mockAllocation.setGmm(gmm.get(), 0);
@@ -78,7 +78,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForFillB
auto gmmContext = pDevice->getGmmClientContext();
auto gmm = std::make_unique<MockGmm>(gmmContext);
gmm->isCompressionEnabled = true;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast<void *>(0x1234),
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast<void *>(0x1234),
0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory);
mockAllocation.setGmm(gmm.get(), 0);
@@ -98,7 +98,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionAndDebugFlagSetWhenAppendBlitC
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
gmm->isCompressionEnabled = true;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast<void *>(0x1234),
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast<void *>(0x1234),
0x1000, 0, sizeof(uint32_t), MemoryPool::LocalMemory);
mockAllocation.setGmm(gmm.get(), 0);
@@ -112,7 +112,7 @@ HWTEST2_F(BlitTests, givenA0StepWhenAppendBlitCommandsForFillBufferWithLocalAcce
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessAllowed));
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
@@ -129,7 +129,7 @@ HWTEST2_F(BlitTests, givenA0StepWhenAppendBlitCommandsForFillBufferWithLocalAcce
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessDisallowed));
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
@@ -146,7 +146,7 @@ HWTEST2_F(BlitTests, givenBStepWhenAppendBlitCommandsForFillBufferWithLocalAcces
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessAllowed));
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
@@ -163,7 +163,7 @@ HWTEST2_F(BlitTests, givenBStepWhenAppendBlitCommandsForFillBufferWithLocalAcces
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessDisallowed));
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
@@ -180,7 +180,7 @@ HWTEST2_F(BlitTests, givenAllocationInSystemMemWhenAppendBlitCommandsForFillBuff
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
@@ -197,7 +197,7 @@ HWTEST2_F(BlitTests, givenAllocationInSystemMemWhenAppendBlitCommandsForFillBuff
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
@@ -215,7 +215,7 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForFillBuffer
DebugManager.flags.OverrideBlitterMocs.set(mockValue);
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -228,7 +228,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToZeroWhenAppendBlitCommandsForFi
DebugManager.flags.OverrideBlitterTargetMemory.set(0);
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -242,7 +242,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToOneWhenAppendBlitCommandsForFil
DebugManager.flags.OverrideBlitterTargetMemory.set(1);
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -256,7 +256,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToTwoWhenAppendBlitCommandsForFil
DebugManager.flags.OverrideBlitterTargetMemory.set(2);
auto blitCmd = FamilyType::cmdInitXyColorBlt;
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
@@ -420,10 +420,10 @@ HWTEST2_F(BlitTests, givenTiled4SrcAndDestinationAppendImageCommandsThenCorrectT
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
auto flags = gmm->gmmResourceInfo->getResourceFlags();
flags->Info.Tile4 = true;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
@@ -446,10 +446,10 @@ HWTEST2_F(BlitTests, givenNotTiled64SrcAndDestinationAppendImageCommandsThenCorr
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
auto flags = gmm->gmmResourceInfo->getResourceFlags();
flags->Info.Tile64 = true;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
@@ -472,10 +472,10 @@ HWTEST2_F(BlitTests, givenNotTiledSrcAndDestinationAppendImageCommandsThenCorrec
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
auto flags = gmm->gmmResourceInfo->getResourceFlags();
flags->Info.Tile64 = false;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
@@ -507,10 +507,10 @@ HWTEST2_F(BlitTests, givenGmmParamsWhenAppendSurfaceTypeThenCorrectSurfaceTypeIs
auto resourceInfo = static_cast<MockGmmResourceInfo *>(gmm->gmmResourceInfo.get());
resourceInfo->mockResourceCreateParams.Type = resourceType;
resourceInfo->mockResourceCreateParams.ArraySize = arraySize;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
mockAllocationSrc.setGmm(gmm.get(), 0);
@@ -532,10 +532,10 @@ HWTEST2_F(BlitTests, givenInvalidResourceWhenAppendSurfaceTypeThenSurfaceTypeDoe
auto resourceInfo = static_cast<MockGmmResourceInfo *>(gmm->gmmResourceInfo.get());
resourceInfo->mockResourceCreateParams.Type = GMM_RESOURCE_TYPE::RESOURCE_INVALID;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
mockAllocationSrc.setGmm(gmm.get(), 0);
@@ -556,10 +556,10 @@ HWTEST2_F(BlitTests, givenInvalidResourceWhenAppendSurfaceTypeThenSurfaceTypeDoe
HWTEST2_F(BlitTests, givenResourcesWithoutGmmsWhenAppendSurfaceTypeThenSurfaceTypeDoesNotChange, IsXeHpCore) {
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
@@ -589,7 +589,7 @@ HWTEST2_F(BlitTests, givenGmmParamsWhenGetBlitAllocationPropertiesIsCalledThenCo
auto &resInfo = resourceInfo->getResourceFlags()->Info;
resInfo.MediaCompressed = mediaCompressed;
resInfo.RenderCompressed = renderCompressed;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
mockAllocationSrc.setGmm(gmm.get(), 0);
@@ -655,10 +655,10 @@ struct MyMockResourecInfo : public GmmResourceInfo {
};
HWTEST2_F(BlitTests, givenResourceWithoutGmmWhenAppendImageCommandsThenPitchEqualPropertiesValue, IsXeHpCore) {
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
@@ -679,10 +679,10 @@ HWTEST2_F(BlitTests, givenResourceWithoutGmmWhenAppendImageCommandsThenPitchEqua
}
HWTEST2_F(BlitTests, givenInputAndDefaultSlicePitchWhenAppendBlitCommandsForImagesIsCalledThenSlicePitchIsCorrect, IsXeHpCore) {
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor;
@@ -720,10 +720,10 @@ HWTEST2_F(BlitTests, givenResourceInfoWithZeroPitchWhenAppendImageCommandsThenPi
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
GMM_RESCREATE_PARAMS gmmParams = {};
gmm->gmmResourceInfo.reset(new MyMockResourecInfo(pDevice->getRootDeviceEnvironment().getGmmClientContext(), &gmmParams));
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
@@ -753,10 +753,10 @@ HWTEST2_F(BlitTests, givenTiledAllocationWhenAppendBlitCommandsForImagesThenBlit
gmm->gmmResourceInfo.reset(myResourecInfo.release());
auto flags = gmm->gmmResourceInfo->getResourceFlags();
flags->Info.Tile64 = true;
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
@@ -782,10 +782,10 @@ HWTEST2_F(BlitTests, givenTiledAllocationWhenAppendBlitCommandsForImagesThenBlit
HWTEST2_F(BlitTests, givenAlocationsWhenAppendBlitCommandsForImagesThenSurfaceSizesAreProgrammedCorrectly, IsXeHpCore) {
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor;
@@ -820,10 +820,10 @@ HWTEST2_F(BlitTests, givenLinearResourceInfoWithNotZeroPitchWhenAppendImageComma
myResourecInfo->pitch = 0x100;
myResourecInfo->flags.Info.Linear = 1;
gmm->gmmResourceInfo.reset(myResourecInfo.release());
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
@@ -850,10 +850,10 @@ HWTEST2_F(BlitTests, givenLinearResorcesWhenAppendSliceOffsetsThenAdressAreOffse
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
BlitProperties properties = {};
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
@@ -880,10 +880,10 @@ HWTEST2_F(BlitTests, givenTiledResorcesWhenAppendSliceOffsetsThenIndexsAreSet, I
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
BlitProperties properties = {};
MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
bltCmd.setSourceTiling(XY_COPY_BLT::TILING::TILING_TILE64);
@@ -902,7 +902,7 @@ HWTEST2_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBl
uint32_t pattern[4] = {1, 0, 0, 0};
uint32_t streamBuffer[100] = {};
LinearStream stream(streamBuffer, sizeof(streamBuffer));
MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY,
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)),
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);

View File

@@ -253,7 +253,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
createPerDssBackedBufferCalled++;
bool result = BaseClass::createPerDssBackedBuffer(device);
if (!perDssBackedBuffer) {
AllocationProperties properties{device.getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, device.getDeviceBitfield()};
AllocationProperties properties{device.getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, device.getDeviceBitfield()};
perDssBackedBuffer = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties(properties);
}
return result;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -70,7 +70,7 @@ void TestedDrmMemoryManager::forceLimitedRangeAllocator(uint64_t range) {
}
void TestedDrmMemoryManager::overrideGfxPartition(GfxPartition *newGfxPartition) { gfxPartitions[0].reset(newGfxPartition); }
DrmAllocation *TestedDrmMemoryManager::allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType) {
DrmAllocation *TestedDrmMemoryManager::allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType) {
bool allocateMemory = ptr == nullptr;
AllocationData allocationData;
MockAllocationProperties properties(rootDeviceIndex, allocateMemory, size, allocationType);

View File

@@ -112,7 +112,7 @@ class TestedDrmMemoryManager : public MemoryManagerCreate<DrmMemoryManager> {
void forceLimitedRangeAllocator(uint64_t range);
void overrideGfxPartition(GfxPartition *newGfxPartition);
DrmAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType);
DrmAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType);
~TestedDrmMemoryManager() override;
size_t peekSharedBosSize() {
size_t size = 0;

View File

@@ -11,12 +11,12 @@
namespace NEO {
struct MockAllocationProperties : public AllocationProperties {
MockAllocationProperties(uint32_t rootDeviceIndex, size_t size) : AllocationProperties(rootDeviceIndex, true, size, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, false, mockDeviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, size_t size, GraphicsAllocation::AllocationType type) : AllocationProperties(rootDeviceIndex, true, size, type, false, mockDeviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, true, size, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, false, deviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size) : AllocationProperties(rootDeviceIndex, allocateMemory, size, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, false, mockDeviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, allocateMemory, size, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, false, deviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, GraphicsAllocation::AllocationType allocationType) : AllocationProperties(rootDeviceIndex, allocateMemory, size, allocationType, false, mockDeviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, GraphicsAllocation::AllocationType allocationType, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, allocateMemory, size, allocationType, false, deviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, size_t size) : AllocationProperties(rootDeviceIndex, true, size, AllocationType::INTERNAL_HOST_MEMORY, false, mockDeviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, size_t size, AllocationType type) : AllocationProperties(rootDeviceIndex, true, size, type, false, mockDeviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, true, size, AllocationType::INTERNAL_HOST_MEMORY, false, deviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size) : AllocationProperties(rootDeviceIndex, allocateMemory, size, AllocationType::INTERNAL_HOST_MEMORY, false, mockDeviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, allocateMemory, size, AllocationType::INTERNAL_HOST_MEMORY, false, deviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, AllocationType allocationType) : AllocationProperties(rootDeviceIndex, allocateMemory, size, allocationType, false, mockDeviceBitfield) {}
MockAllocationProperties(uint32_t rootDeviceIndex, bool allocateMemory, size_t size, AllocationType allocationType, DeviceBitfield deviceBitfield) : AllocationProperties(rootDeviceIndex, allocateMemory, size, allocationType, false, deviceBitfield) {}
};
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -47,7 +47,7 @@ class MockGmm : public Gmm {
imgDesc.imageWidth = 5;
imgDesc.imageHeight = 5;
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
return memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, true, imgInfo, GraphicsAllocation::AllocationType::IMAGE, mockDeviceBitfield});
return memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, true, imgInfo, AllocationType::IMAGE, mockDeviceBitfield});
}
};
} // namespace NEO

View File

@@ -128,7 +128,7 @@ GraphicsAllocation *MockMemoryManager::allocateGraphicsMemoryWithAlignment(const
return OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment(allocationData);
}
GraphicsAllocation *MockMemoryManager::allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType) {
GraphicsAllocation *MockMemoryManager::allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType) {
bool allocateMemory = ptr == nullptr;
AllocationData allocationData{};
MockAllocationProperties properties(rootDeviceIndex, allocateMemory, size, allocationType);

View File

@@ -133,7 +133,7 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
bool isCpuCopyRequired(const void *ptr) override { return cpuCopyRequired; }
GraphicsAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType);
GraphicsAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType);
GraphicsAllocation *allocate32BitGraphicsMemoryImpl(const AllocationData &allocationData, bool useLocalMemory) override;
bool isLimitedGPU(uint32_t rootDeviceIndex) override {
@@ -290,7 +290,7 @@ class FailMemoryManager : public MockMemoryManager {
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override {
return nullptr;
}
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override {
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override {
return nullptr;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -41,7 +41,7 @@ const std::vector<char> &MockSipKernel::getStateSaveAreaHeader() const {
void MockSipKernel::createMockSipAllocation() {
this->mockSipMemoryAllocation =
std::make_unique<MemoryAllocation>(0u,
GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL,
AllocationType::KERNEL_ISA_INTERNAL,
nullptr,
MemoryConstants::pageSize * 10u,
0u,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -59,7 +59,7 @@ class MockWddmMemoryManager : public MemoryManagerCreate<WddmMemoryManager> {
bool validateAllocationMock(WddmAllocation *graphicsAllocation) {
return this->validateAllocation(graphicsAllocation);
}
GraphicsAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, GraphicsAllocation::AllocationType allocationType) {
GraphicsAllocation *allocate32BitGraphicsMemory(uint32_t rootDeviceIndex, size_t size, const void *ptr, AllocationType allocationType) {
bool allocateMemory = ptr == nullptr;
AllocationData allocationData;
MockAllocationProperties properties(rootDeviceIndex, allocateMemory, size, allocationType);

View File

@@ -52,7 +52,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenOffsetWhenProgrammingStatePre
constexpr uint64_t gpuVa = 0x100000;
constexpr uint32_t gpuVaOffset = 0x10000;
const GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, nullptr, gpuVa, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
const GraphicsAllocation allocation(0, AllocationType::BUFFER, nullptr, gpuVa, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
memset(buffer, 0, sizeof(buffer));
LinearStream linearStream(buffer, sizeof(buffer));
@@ -82,7 +82,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugVariableSetwhenProgramin
constexpr uint32_t mocsIndexForL3 = (2 << 1);
constexpr size_t numCachelines = 3;
const GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER, nullptr, gpuVa, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
const GraphicsAllocation allocation(0, AllocationType::BUFFER, nullptr, gpuVa, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
constexpr std::array<uint32_t, 7> expectedSizes = {{
MemoryConstants::cacheLineSize - 1,
@@ -137,7 +137,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenIsaAllocationWhenProgrammingP
EXPECT_EQ(sizeof(STATE_PREFETCH), EncodeMemoryPrefetch<FamilyType>::getSizeForMemoryPrefetch(1));
GraphicsAllocation::AllocationType isaTypes[] = {GraphicsAllocation::AllocationType::KERNEL_ISA, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL};
AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL};
for (uint32_t i = 0; i < 2; i++) {
memset(buffer, 0, sizeof(STATE_PREFETCH));
@@ -162,7 +162,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugFlagSetWhenProgramPrefet
uint8_t buffer[sizeof(STATE_PREFETCH)] = {};
GraphicsAllocation::AllocationType isaTypes[] = {GraphicsAllocation::AllocationType::KERNEL_ISA, GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL};
AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL};
for (uint32_t i = 0; i < 2; i++) {
memset(buffer, 0, sizeof(STATE_PREFETCH));
@@ -190,7 +190,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenSteppingWhenProgrammingPrefet
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.platform.usRevId = 0b0100'0111; // [3:5] - BaseDie == A0;
const GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::KERNEL_ISA,
const GraphicsAllocation allocation(0, AllocationType::KERNEL_ISA,
nullptr, 1234, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
uint8_t buffer[sizeof(STATE_PREFETCH)] = {};
@@ -213,7 +213,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugFlagSetWhenProgrammingPr
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.platform.usRevId = 0b0010'1000; // [3:5] - BaseDie != A0
const GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::BUFFER,
const GraphicsAllocation allocation(0, AllocationType::BUFFER,
nullptr, 1234, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
uint8_t buffer[sizeof(STATE_PREFETCH)] = {};
@@ -405,7 +405,7 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenCleanHeapsAndSlmNotChangedAndU
XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenStreamWhenEncodingSystemMemoryFenceThenCorrectFenceAddressIsSet) {
using STATE_SYSTEM_MEM_FENCE_ADDRESS = typename FamilyType::STATE_SYSTEM_MEM_FENCE_ADDRESS;
const GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN,
const GraphicsAllocation allocation(0, AllocationType::UNKNOWN,
nullptr, 1234, 0, 4096, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
auto before = cmdContainer->getCommandStream()->getUsed();

View File

@@ -91,12 +91,12 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorre
cmdContainer.initialize(pDevice, nullptr);
ASSERT_NE(0u, cmdContainer.getCmdBufferAllocations().size());
EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[0]->getAllocationType());
EXPECT_EQ(AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[0]->getAllocationType());
cmdContainer.allocateNextCommandBuffer();
ASSERT_LE(2u, cmdContainer.getCmdBufferAllocations().size());
EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[1]->getAllocationType());
EXPECT_EQ(AllocationType::COMMAND_BUFFER, cmdContainer.getCmdBufferAllocations()[1]->getAllocationType());
}
TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectAllocationTypes) {
@@ -108,10 +108,10 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectA
auto heap = cmdContainer.getIndirectHeap(heapType);
if (HeapType::INDIRECT_OBJECT == heapType) {
EXPECT_EQ(GraphicsAllocation::AllocationType::INTERNAL_HEAP, heap->getGraphicsAllocation()->getAllocationType());
EXPECT_EQ(AllocationType::INTERNAL_HEAP, heap->getGraphicsAllocation()->getAllocationType());
EXPECT_NE(0u, heap->getHeapGpuStartOffset());
} else {
EXPECT_EQ(GraphicsAllocation::AllocationType::LINEAR_STREAM, heap->getGraphicsAllocation()->getAllocationType());
EXPECT_EQ(AllocationType::LINEAR_STREAM, heap->getGraphicsAllocation()->getAllocationType());
EXPECT_EQ(0u, heap->getHeapGpuStartOffset());
}
}
@@ -144,7 +144,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs
TEST_F(CommandContainerTest, givenEnabledLocalMemoryAndIsaInSystemMemoryWhenCmdContainerIsInitializedThenInstructionBaseAddressIsSetToInternalHeap) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast<uint32_t>(GraphicsAllocation::AllocationType::KERNEL_ISA) - 1));
DebugManager.flags.ForceSystemMemoryPlacement.set(1 << (static_cast<uint32_t>(AllocationType::KERNEL_ISA) - 1));
auto executionEnvironment = new NEO::ExecutionEnvironment();
const size_t numDevices = 1;

View File

@@ -51,7 +51,7 @@ HWTEST_F(CommandEncoderTests, whenEncodeMemoryPrefetchCalledThenDoNothing) {
uint8_t buffer[MemoryConstants::pageSize] = {};
LinearStream linearStream(buffer, sizeof(buffer));
GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 123, 456, 789, MemoryPool::LocalMemory);
GraphicsAllocation allocation(0, AllocationType::UNKNOWN, nullptr, 123, 456, 789, MemoryPool::LocalMemory);
EncodeMemoryPrefetch<FamilyType>::programMemoryPrefetch(linearStream, allocation, 2, 0, *defaultHwInfo);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -18,7 +18,7 @@ HWTEST2_F(CommandEncoderXeHpgCorePlusTests, givenSpecifiedL1CacheControlWhenAppe
DebugManagerStateRestore restorer;
auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get();
size_t allocationSize = MemoryConstants::pageSize;
AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield());
AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield());
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
auto rssCmd = FamilyType::cmdInitRenderSurfaceState;

View File

@@ -718,22 +718,22 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMe
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize});
const GraphicsAllocation::AllocationType onlyOneTimeAubWritableTypes[] = {
GraphicsAllocation::AllocationType::PIPE,
GraphicsAllocation::AllocationType::CONSTANT_SURFACE,
GraphicsAllocation::AllocationType::GLOBAL_SURFACE,
GraphicsAllocation::AllocationType::KERNEL_ISA,
GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL,
GraphicsAllocation::AllocationType::PRIVATE_SURFACE,
GraphicsAllocation::AllocationType::SCRATCH_SURFACE,
GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE,
GraphicsAllocation::AllocationType::BUFFER,
GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY,
GraphicsAllocation::AllocationType::IMAGE,
GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER,
GraphicsAllocation::AllocationType::MAP_ALLOCATION,
GraphicsAllocation::AllocationType::SVM_GPU,
GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR};
const AllocationType onlyOneTimeAubWritableTypes[] = {
AllocationType::PIPE,
AllocationType::CONSTANT_SURFACE,
AllocationType::GLOBAL_SURFACE,
AllocationType::KERNEL_ISA,
AllocationType::KERNEL_ISA_INTERNAL,
AllocationType::PRIVATE_SURFACE,
AllocationType::SCRATCH_SURFACE,
AllocationType::WORK_PARTITION_SURFACE,
AllocationType::BUFFER,
AllocationType::BUFFER_HOST_MEMORY,
AllocationType::IMAGE,
AllocationType::TIMESTAMP_PACKET_TAG_BUFFER,
AllocationType::MAP_ALLOCATION,
AllocationType::SVM_GPU,
AllocationType::EXTERNAL_HOST_PTR};
for (auto allocationType : onlyOneTimeAubWritableTypes) {
gfxAllocation->setAubWritable(true, GraphicsAllocation::defaultBank);
@@ -752,7 +752,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess
aubCsr->setupContext(*pDevice->getDefaultEngine().osContext);
aubCsr->initializeEngine();
auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxImageAllocation = MockGmm::allocateImage2d(*memoryManager);
@@ -773,7 +773,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur
memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment));
aubCsr->setupContext(*pDevice->getDefaultEngine().osContext);
auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
aubCsr->setAubWritable(false, *gfxBufferAllocation);
auto gfxImageAllocation = MockGmm::allocateImage2d(*memoryManager);
@@ -798,7 +798,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess
memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment));
aubCsr->setupContext(*pDevice->getDefaultEngine().osContext);
auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxBufferAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
aubCsr->setAubWritable(false, *gfxBufferAllocation);
auto gfxImageAllocation = MockGmm::allocateImage2d(*memoryManager);

View File

@@ -274,7 +274,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenNoCpuPtrAndNotLockableAllocationWhe
constexpr uint64_t initGpuAddress = 1234;
constexpr size_t initSize = 10;
MockGraphicsAllocation allocation(nullptr, initGpuAddress, initSize);
allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER);
allocation.setAllocationType(AllocationType::BUFFER);
allocation.overrideMemoryPool(MemoryPool::LocalMemory);
aubExecutionEnvironment->executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -309,7 +309,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenNoCpuPtrAndLockableAllocationWhenGe
constexpr uint64_t initGpuAddress = 1234;
constexpr size_t initSize = 10;
MockGraphicsAllocation allocation(nullptr, initGpuAddress, initSize);
allocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
allocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY);
allocation.overrideMemoryPool(MemoryPool::LocalMemory);
aubExecutionEnvironment->executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -595,7 +595,7 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
AllocationProperties allocProperties{0u /* rootDeviceIndex */, true /* allocateMemory */,
imgInfo, GraphicsAllocation::AllocationType::IMAGE, deviceBitfield};
imgInfo, AllocationType::IMAGE, deviceBitfield};
auto imageAllocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr);
ASSERT_NE(nullptr, imageAllocation);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -100,7 +100,7 @@ HWTEST_F(AubCsrTest, WhenWriteWithAubManagerIsCalledThenAubManagerIsInvokedWithC
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->aubCenter.reset(new AubCenter());
executionEnvironment->initializeMemoryManager();
auto allocation = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::COMMAND_BUFFER});
auto allocation = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, AllocationType::COMMAND_BUFFER});
MockAubManager aubManager;
std::unique_ptr<MockAubCsr<FamilyType>> aubCsr(new MockAubCsr<FamilyType>("", false, *executionEnvironment, rootDeviceIndex, deviceBitfield));
@@ -116,7 +116,7 @@ HWTEST_F(AubCsrTest, WhenWriteWithAubManagerIsCalledThenAubManagerIsInvokedWithC
aubManager.writeMemory2Called = false;
auto allocation2 = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM});
auto allocation2 = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, AllocationType::LINEAR_STREAM});
aubCsr->writeMemoryWithAubManager(*allocation2);
EXPECT_TRUE(aubManager.writeMemory2Called);
@@ -272,7 +272,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
@@ -294,7 +294,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenBcsEngineWhenDumpAllocationCalledTh
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
@@ -322,7 +322,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritabl
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield());
AllocationProperties properties(pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield());
properties.flags.preferCompressed = true;
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
@@ -346,7 +346,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
@@ -369,7 +369,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNonWritableWhenDu
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(false);
EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation));
@@ -393,7 +393,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNotDumpableWhenDu
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
gfxAllocation->setAllocDumpable(false, false);
@@ -418,7 +418,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationDumpableWhenDumpA
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
@@ -486,7 +486,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWhenDumpAllocatio
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
gfxAllocation->setAllocDumpable(false, false);
@@ -515,7 +515,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));

View File

@@ -265,7 +265,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenDumpAllocationIsCa
auto mockAubFileStream = std::make_unique<MockAubFileStream>();
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true, true, true);
auto aubCsr = aubExecutionEnvironment->template getCsr<MockAubCsr<FamilyType>>();
GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull};
GraphicsAllocation allocation{0, AllocationType::UNKNOWN, nullptr, 0, 0, 0, MemoryPool::MemoryNull};
aubCsr->stream = static_cast<MockAubFileStream *>(mockAubFileStream.get());

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -35,7 +35,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
executionEnvironment.initializeMemoryManager();
MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount);
allocation.storageInfo.memoryBanks = 0x2u;
@@ -54,7 +54,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndNonLocalMemoryAllocatio
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
executionEnvironment.initializeMemoryManager();
MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryConstants::pageSize, 0, MemoryPool::System4KBPages, false, false, MemoryManager::maxOsContextCount);
allocation.storageInfo.memoryBanks = 0x2u;
@@ -70,7 +70,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
executionEnvironment.initializeMemoryManager();
MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount);
allocation.storageInfo.memoryBanks = 0x0u;
@@ -89,7 +89,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndNonLocalMemoryAllocatio
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
executionEnvironment.initializeMemoryManager();
MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryConstants::pageSize, 0, MemoryPool::System64KBPages, false, false, MemoryManager::maxOsContextCount);
allocation.storageInfo.memoryBanks = 0x3u;
@@ -108,7 +108,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryNoncloneableAllocationWith
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
executionEnvironment.initializeMemoryManager();
MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount);
allocation.storageInfo.memoryBanks = 0x3u;
allocation.storageInfo.cloningOfPageTables = false;
@@ -132,7 +132,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryCloneableAllocationWithMan
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
executionEnvironment.initializeMemoryManager();
MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount);
allocation.storageInfo.memoryBanks = 0x3u;
allocation.storageInfo.cloningOfPageTables = true;
@@ -156,7 +156,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryNoncloneableAllocationWith
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
executionEnvironment.initializeMemoryManager();
MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount);
allocation.storageInfo.memoryBanks = 0x3u;
allocation.storageInfo.cloningOfPageTables = false;
@@ -181,7 +181,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
executionEnvironment.initializeMemoryManager();
MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryAllocation allocation(0, AllocationType::UNKNOWN, nullptr, reinterpret_cast<void *>(0x1000), 0x1000u,
MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount);
allocation.storageInfo.memoryBanks = 0x0u;
@@ -308,7 +308,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSimulatedCommandStreamReceiverWhenClo
auto mockHardwareContext = static_cast<MockHardwareContext *>(csr->hardwareContextController->hardwareContexts[0].get());
int dummy = 1;
GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN,
GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN,
&dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount};
graphicsAllocation.storageInfo.cloningOfPageTables = true;
csr->writeMemoryWithAubManager(graphicsAllocation);
@@ -331,7 +331,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCompressedAllocationWhenCloningPageTa
gmm.isCompressionEnabled = true;
int dummy = 1;
GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN,
GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN,
&dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount};
graphicsAllocation.storageInfo.cloningOfPageTables = true;
@@ -358,7 +358,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenTileInstancedAllocationWhenWriteMemor
csr->multiOsContextCapable = true;
int dummy = 1;
GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN,
GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN,
&dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount};
graphicsAllocation.storageInfo.cloningOfPageTables = false;
graphicsAllocation.storageInfo.tileInstanced = true;
@@ -390,7 +390,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCompressedTileInstancedAllocationWhen
gmm.isCompressionEnabled = true;
int dummy = 1;
GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN,
GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN,
&dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount};
graphicsAllocation.storageInfo.cloningOfPageTables = false;
graphicsAllocation.storageInfo.tileInstanced = true;
@@ -421,7 +421,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenTileInstancedAllocationWithMissingMem
csr->multiOsContextCapable = true;
int dummy = 1;
GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN,
GraphicsAllocation graphicsAllocation{0, AllocationType::UNKNOWN,
&dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount};
graphicsAllocation.storageInfo.cloningOfPageTables = false;
graphicsAllocation.storageInfo.tileInstanced = true;
@@ -437,7 +437,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCommandBufferAllocationWhenWriteMemor
csr->aubManager = mockManager.get();
int dummy = 1;
GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER,
GraphicsAllocation graphicsAllocation{0, AllocationType::COMMAND_BUFFER,
&dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount};
graphicsAllocation.storageInfo.cloningOfPageTables = true;
csr->writeMemoryWithAubManager(graphicsAllocation);
@@ -471,7 +471,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSpecificMemoryPoolAllocationWhenWrite
mockHardwareContext->writeMemoryPageSizePassed = 0;
mockHardwareContext->writeMemory2Called = false;
GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER,
GraphicsAllocation graphicsAllocation{0, AllocationType::COMMAND_BUFFER,
&dummy, 0, 0, sizeof(dummy), poolsWith4kPages[i], MemoryManager::maxOsContextCount};
graphicsAllocation.storageInfo.cloningOfPageTables = true;
csr->writeMemoryWithAubManager(graphicsAllocation);
@@ -504,7 +504,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSpecificMemoryPoolAllocationWhenWrite
mockHardwareContext->writeMemoryPageSizePassed = 0;
mockHardwareContext->writeMemory2Called = false;
GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER,
GraphicsAllocation graphicsAllocation{0, AllocationType::COMMAND_BUFFER,
&dummy, 0, 0, sizeof(dummy), poolsWith64kPages[i], MemoryManager::maxOsContextCount};
graphicsAllocation.storageInfo.cloningOfPageTables = true;
csr->writeMemoryWithAubManager(graphicsAllocation);

View File

@@ -155,7 +155,7 @@ TEST_F(CommandStreamReceiverTest, givenCommandStreamReceiverWhenGetCSIsCalledThe
auto commandStreamAllocation = commandStream.getGraphicsAllocation();
ASSERT_NE(nullptr, commandStreamAllocation);
EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, commandStreamAllocation->getAllocationType());
EXPECT_EQ(AllocationType::COMMAND_BUFFER, commandStreamAllocation->getAllocationType());
}
HWTEST_F(CommandStreamReceiverTest, whenStoreAllocationThenStoredAllocationHasTaskCountFromCsr) {
@@ -909,7 +909,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa
uint32_t numRootDevices = 10u;
UltDeviceFactory deviceFactory{numRootDevices, 0};
EXPECT_NE(nullptr, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation());
EXPECT_EQ(GraphicsAllocation::AllocationType::TAG_BUFFER, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType());
EXPECT_EQ(AllocationType::TAG_BUFFER, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType());
EXPECT_TRUE(deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAddress() != nullptr);
EXPECT_EQ(*deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAddress(), initialHardwareTag);
auto tagsMultiAllocation = deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagsMultiAllocation();
@@ -928,7 +928,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa
uint32_t numRootDevices = 10u;
UltDeviceFactory deviceFactory{numRootDevices, 0};
EXPECT_NE(nullptr, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation());
EXPECT_EQ(GraphicsAllocation::AllocationType::TAG_BUFFER, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType());
EXPECT_EQ(AllocationType::TAG_BUFFER, deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAllocation()->getAllocationType());
EXPECT_TRUE(deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAddress() != nullptr);
EXPECT_EQ(*deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagAddress(), initialHardwareTag);
auto tagsMultiAllocation = deviceFactory.rootDevices[0]->commandStreamReceivers[0]->getTagsMultiAllocation();
@@ -945,7 +945,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenItIsDestroye
bool destructorCalled = false;
int gpuTag = 0;
auto mockGraphicsAllocation = new MockGraphicsAllocationWithDestructorTracing(0, GraphicsAllocation::AllocationType::UNKNOWN, &gpuTag, 0llu, 0llu, 1u, MemoryPool::MemoryNull);
auto mockGraphicsAllocation = new MockGraphicsAllocationWithDestructorTracing(0, AllocationType::UNKNOWN, &gpuTag, 0llu, 0llu, 1u, MemoryPool::MemoryNull);
mockGraphicsAllocation->destructorCalled = &destructorCalled;
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
auto csr = std::make_unique<MockCommandStreamReceiver>(executionEnvironment, 0, 1);
@@ -971,7 +971,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa
EXPECT_EQ(nullptr, csr->getTagAllocation());
csr->initializeTagAllocation();
EXPECT_NE(nullptr, csr->getTagAllocation());
EXPECT_EQ(GraphicsAllocation::AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType());
EXPECT_EQ(AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType());
EXPECT_EQ(csr->getTagAllocation()->getUnderlyingBuffer(), csr->getTagAddress());
auto tagAddress = csr->getTagAddress();
for (uint32_t i = 0; i < 2; i++) {
@@ -991,7 +991,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa
csr->initializeTagAllocation();
EXPECT_NE(nullptr, csr->getTagAllocation());
EXPECT_EQ(GraphicsAllocation::AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType());
EXPECT_EQ(AllocationType::TAG_BUFFER, csr->getTagAllocation()->getAllocationType());
EXPECT_EQ(csr->getTagAllocation()->getUnderlyingBuffer(), csr->getTagAddress());
auto tagAddress = csr->getTagAddress();
@@ -1085,7 +1085,7 @@ TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingN
DeviceBitfield deviceBitfield(1);
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
MockGraphicsAllocation mockAllocation;
mockAllocation.setAllocationType(GraphicsAllocation::AllocationType::KERNEL_ISA);
mockAllocation.setAllocationType(AllocationType::KERNEL_ISA);
csr.useNewResourceImplicitFlush = true;
csr.newResources = false;
@@ -1216,7 +1216,7 @@ TEST(CommandStreamReceiverSimpleTest, givenMultipleActivePartitionsWhenWaitingFo
auto hostPtr = reinterpret_cast<void *>(0x1234);
size_t size = 100;
auto temporaryAllocation = std::make_unique<MemoryAllocation>(0, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
auto temporaryAllocation = std::make_unique<MemoryAllocation>(0, AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
temporaryAllocation->updateTaskCount(0u, 0u);
csr.getInternalAllocationStorage()->storeAllocationWithTaskCount(std::move(temporaryAllocation), TEMPORARY_ALLOCATION, 2u);
@@ -1320,7 +1320,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenTemporaryAllocationWhenCreateAll
auto hostPtr = reinterpret_cast<void *>(0x1234);
size_t size = 100;
auto temporaryAllocation = std::make_unique<MemoryAllocation>(0,
GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
auto allocationPtr = temporaryAllocation.get();
temporaryAllocation->updateTaskCount(0u, 0u);
commandStreamReceiver->getInternalAllocationStorage()->storeAllocation(std::move(temporaryAllocation), TEMPORARY_ALLOCATION);
@@ -1358,7 +1358,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio
bool runPopulateOsHandlesExpects = false;
bool runAllocateGraphicsMemoryForNonSvmHostPtrExpects = false;
if (!mockMemoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) {
if (!mockMemoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) {
runPopulateOsHandlesExpects = true;
mockMemoryManager->populateOsHandlesResult = MemoryManager::AllocationStatus::InvalidHostPointer;
} else {
@@ -1394,7 +1394,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio
bool runPopulateOsHandlesExpects = false;
bool runAllocateGraphicsMemoryForNonSvmHostPtrExpects = false;
if (!mockMemoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) {
if (!mockMemoryManager->useNonSvmHostPtrAlloc(AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) {
runPopulateOsHandlesExpects = true;
mockMemoryManager->populateOsHandlesResult = MemoryManager::AllocationStatus::InvalidHostPointer;
} else {
@@ -1439,7 +1439,7 @@ TEST_F(ReducedAddrSpaceCommandStreamReceiverTest,
}
TEST_F(CommandStreamReceiverTest, givenMinimumSizeDoesNotExceedCurrentWhenCallingEnsureCommandBufferAllocationThenDoNotReallocate) {
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
LinearStream commandStream{allocation};
commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 100u, 0u);
@@ -1454,7 +1454,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeDoesNotExceedCurrentWhenCallin
}
TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsureCommandBufferAllocationThenReallocate) {
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
LinearStream commandStream{allocation};
commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 0u);
@@ -1463,7 +1463,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsur
}
TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsureCommandBufferAllocationThenReallocateAndAlignSizeTo64kb) {
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
LinearStream commandStream{allocation};
commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 0u);
@@ -1478,7 +1478,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentWhenCallingEnsur
}
TEST_F(CommandStreamReceiverTest, givenAdditionalAllocationSizeWhenCallingEnsureCommandBufferAllocationThenSizesOfAllocationAndCommandBufferAreCorrect) {
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), 128u, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
LinearStream commandStream{allocation};
commandStreamReceiver->ensureCommandBufferAllocation(commandStream, 129u, 350u);
@@ -1500,7 +1500,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndNoAllocations
}
TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndAllocationsForReuseWhenCallingEnsureCommandBufferAllocationThenObtainAllocationFromInternalAllocationStorage) {
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
internalAllocationStorage->storeAllocation(std::unique_ptr<GraphicsAllocation>{allocation}, REUSABLE_ALLOCATION);
LinearStream commandStream;
@@ -1513,7 +1513,7 @@ TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndAllocationsFo
}
TEST_F(CommandStreamReceiverTest, givenMinimumSizeExceedsCurrentAndNoSuitableReusableAllocationWhenCallingEnsureCommandBufferAllocationThenObtainAllocationMemoryManager) {
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({commandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER, pDevice->getDeviceBitfield()});
internalAllocationStorage->storeAllocation(std::unique_ptr<GraphicsAllocation>{allocation}, REUSABLE_ALLOCATION);
LinearStream commandStream;

View File

@@ -78,7 +78,7 @@ struct ComputeModeRequirements : public ::testing::Test {
csr = new myCsr<FamilyType>(*device->executionEnvironment, device->getDeviceBitfield());
device->resetCommandStreamReceiver(csr);
AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {});
AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {});
alloc = device->getMemoryManager()->createGraphicsAllocationFromSharedHandle(static_cast<osHandle>(123), properties, false, false);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -170,7 +170,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenWriteMemoryIsCa
MemoryManager *memoryManager = tbxCsr->getMemoryManager();
ASSERT_NE(nullptr, memoryManager);
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
ASSERT_NE(nullptr, graphicsAllocation);
EXPECT_TRUE(tbxCsr->isTbxWritable(*graphicsAllocation));
@@ -186,7 +186,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenWriteMemoryIsCa
MemoryManager *memoryManager = tbxCsr->getMemoryManager();
ASSERT_NE(nullptr, memoryManager);
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pCommandStreamReceiver->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
ASSERT_NE(nullptr, graphicsAllocation);
tbxCsr->setTbxWritable(false, *graphicsAllocation);
@@ -777,7 +777,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithDumpT
memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment));
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
tbxCsr->setTbxWritable(false, *gfxAllocation);
tbxCsr->dumpTbxNonWritable = true;
@@ -797,7 +797,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithoutDu
memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment));
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
tbxCsr->setTbxWritable(false, *gfxAllocation);
EXPECT_FALSE(tbxCsr->dumpTbxNonWritable);
@@ -890,7 +890,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
tbxCsr.dumpAllocation(*gfxAllocation);
EXPECT_FALSE(mockHardwareContext->dumpSurfaceCalled);
@@ -906,7 +906,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWritableWhenDumpAllocatio
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
@@ -928,7 +928,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWritableWhenDumpAllocatio
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
@@ -950,7 +950,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
gfxAllocation->setAllocDumpable(false, false);
@@ -1022,7 +1022,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
gfxAllocation->setAllocDumpable(false, false);
@@ -1052,7 +1052,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle
EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[0]->aubCenter->getAubManager());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, pDevice->getDeviceBitfield()});
tbxCsr.dumpAllocation(*gfxAllocation);
EXPECT_TRUE(tbxCsr.dumpAllocationCalled);

View File

@@ -247,7 +247,7 @@ TEST_F(DeviceGetCapsTest, givenFlagEnabled64kbPagesWhenCallConstructorMemoryMana
void addAllocationToHostPtrManager(GraphicsAllocation *memory) override{};
void removeAllocationFromHostPtrManager(GraphicsAllocation *memory) override{};
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override { return nullptr; };
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, GraphicsAllocation::AllocationType allocType) override { return nullptr; };
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { return nullptr; };
AllocationStatus populateOsHandles(OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override { return AllocationStatus::Success; };
void cleanOsHandles(OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override{};
void freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation) override{};

View File

@@ -143,7 +143,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenAllocateOsResourcesFenceCreation
MemoryManager *memoryManager = device->getExecutionEnvironment()->memoryManager.get();
const auto allocationSize = MemoryConstants::pageSize;
const AllocationProperties commandStreamAllocationProperties{device->getRootDeviceIndex(), allocationSize,
GraphicsAllocation::AllocationType::RING_BUFFER, device->getDeviceBitfield()};
AllocationType::RING_BUFFER, device->getDeviceBitfield()};
GraphicsAllocation *ringBuffer = memoryManager->allocateGraphicsMemoryWithProperties(commandStreamAllocationProperties);
ASSERT_NE(nullptr, ringBuffer);

View File

@@ -102,7 +102,7 @@ HWTEST2_F(XeHPAndLaterCommandEncoderTest,
auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get();
size_t allocationSize = MemoryConstants::pageSize;
AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield());
AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield());
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
auto outSurfaceState = FamilyType::cmdInitRenderSurfaceState;

View File

@@ -193,7 +193,7 @@ HWTEST_F(CommandEncodeStatesTest, givenCreatedSurfaceStateBufferWhenAllocationPr
uint64_t gpuAddr = 0x4000u;
size_t allocSize = size;
length.Length = static_cast<uint32_t>(allocSize - 1);
GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1);
GraphicsAllocation allocation(0, AllocationType::UNKNOWN, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1);
NEO::EncodeSurfaceStateArgs args;
args.outMemory = stateBuffer;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -18,34 +18,34 @@ class AlocationHelperTests : public Test<DeviceFixture> {
HWTEST_F(AlocationHelperTests, givenKernelIsaTypeWhenUse32BitHeapCalledThenTrueReturned) {
EXPECT_TRUE(heapAssigner.use32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA));
EXPECT_TRUE(heapAssigner.use32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL));
EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::KERNEL_ISA));
EXPECT_TRUE(heapAssigner.use32BitHeap(AllocationType::KERNEL_ISA_INTERNAL));
}
HWTEST_F(AlocationHelperTests, givenKernelIsaTypeWhenUseIternalAllocatorThenUseHeapInternal) {
auto heapIndex = heapAssigner.get32BitHeapIndex(GraphicsAllocation::AllocationType::KERNEL_ISA, true, *defaultHwInfo, false);
auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::KERNEL_ISA, true, *defaultHwInfo, false);
EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY);
heapIndex = heapAssigner.get32BitHeapIndex(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, true, *defaultHwInfo, false);
heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::KERNEL_ISA_INTERNAL, true, *defaultHwInfo, false);
EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY);
}
HWTEST_F(AlocationHelperTests, givenNotInternalTypeWhenUseIternalAllocatorThenUseHeapExternal) {
auto heapIndex = heapAssigner.get32BitHeapIndex(GraphicsAllocation::AllocationType::LINEAR_STREAM, true, *defaultHwInfo, false);
auto heapIndex = heapAssigner.get32BitHeapIndex(AllocationType::LINEAR_STREAM, true, *defaultHwInfo, false);
EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_EXTERNAL_DEVICE_MEMORY);
}
HWTEST_F(AlocationHelperTests, givenKernelIsaTypesWhenUseInternalAllocatorCalledThenTrueReturned) {
EXPECT_TRUE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA));
EXPECT_TRUE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL));
EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::KERNEL_ISA));
EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::KERNEL_ISA_INTERNAL));
}
HWTEST_F(AlocationHelperTests, givenInternalHeapTypeWhenUseInternalAllocatorCalledThenTrueReturned) {
EXPECT_TRUE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::INTERNAL_HEAP));
EXPECT_TRUE(heapAssigner.useInternal32BitHeap(AllocationType::INTERNAL_HEAP));
}
HWTEST_F(AlocationHelperTests, givenNotInternalHeapTypeWhenUseInternalAllocatorCalledThenFalseReturned) {
EXPECT_FALSE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::BUFFER));
EXPECT_FALSE(heapAssigner.useInternal32BitHeap(AllocationType::BUFFER));
}
} // namespace NEO

View File

@@ -36,16 +36,16 @@ struct AppResourceTests : public MockExecutionEnvironmentTagTest {
};
TEST_F(AppResourceTests, givenIncorrectGraphicsAllocationTypeWhenGettingResourceTagThenNOTFOUNDIsReturned) {
auto tag = AppResourceHelper::getResourceTagStr(static_cast<GraphicsAllocation::AllocationType>(999));
auto tag = AppResourceHelper::getResourceTagStr(static_cast<AllocationType>(999));
EXPECT_STREQ(tag, "NOTFOUND");
}
TEST_F(AppResourceTests, givenGraphicsAllocationTypeWhenGettingResourceTagThenForEveryDefinedTypeProperTagExist) {
auto firstTypeIdx = static_cast<int>(GraphicsAllocation::AllocationType::UNKNOWN);
auto lastTypeIdx = static_cast<int>(GraphicsAllocation::AllocationType::COUNT);
auto firstTypeIdx = static_cast<int>(AllocationType::UNKNOWN);
auto lastTypeIdx = static_cast<int>(AllocationType::COUNT);
for (int typeIdx = firstTypeIdx; typeIdx < lastTypeIdx; typeIdx++) {
auto allocationType = static_cast<GraphicsAllocation::AllocationType>(typeIdx);
auto allocationType = static_cast<AllocationType>(typeIdx);
auto tag = AppResourceHelper::getResourceTagStr(allocationType);
EXPECT_LE(strlen(tag), AppResourceDefines::maxStrLen);
@@ -54,56 +54,56 @@ TEST_F(AppResourceTests, givenGraphicsAllocationTypeWhenGettingResourceTagThenFo
}
struct AllocationTypeTagTestCase {
GraphicsAllocation::AllocationType type;
AllocationType type;
const char *str;
};
AllocationTypeTagTestCase allocationTypeTagValues[static_cast<int>(GraphicsAllocation::AllocationType::COUNT)] = {
{GraphicsAllocation::AllocationType::BUFFER, "BUFFER"},
{GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, "BFHSTMEM"},
{GraphicsAllocation::AllocationType::COMMAND_BUFFER, "CMNDBUFF"},
{GraphicsAllocation::AllocationType::CONSTANT_SURFACE, "CSNTSRFC"},
{GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, "EXHSTPTR"},
{GraphicsAllocation::AllocationType::FILL_PATTERN, "FILPATRN"},
{GraphicsAllocation::AllocationType::GLOBAL_SURFACE, "GLBLSRFC"},
{GraphicsAllocation::AllocationType::IMAGE, "IMAGE"},
{GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP, "INOBHEAP"},
{GraphicsAllocation::AllocationType::INSTRUCTION_HEAP, "INSTHEAP"},
{GraphicsAllocation::AllocationType::INTERNAL_HEAP, "INTLHEAP"},
{GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, "INHSTMEM"},
{GraphicsAllocation::AllocationType::KERNEL_ISA, "KERNLISA"},
{GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL, "KRLISAIN"},
{GraphicsAllocation::AllocationType::LINEAR_STREAM, "LINRSTRM"},
{GraphicsAllocation::AllocationType::MAP_ALLOCATION, "MAPALLOC"},
{GraphicsAllocation::AllocationType::MCS, "MCS"},
{GraphicsAllocation::AllocationType::PIPE, "PIPE"},
{GraphicsAllocation::AllocationType::PREEMPTION, "PRMPTION"},
{GraphicsAllocation::AllocationType::PRINTF_SURFACE, "PRNTSRFC"},
{GraphicsAllocation::AllocationType::PRIVATE_SURFACE, "PRVTSRFC"},
{GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER, "PROFTGBF"},
{GraphicsAllocation::AllocationType::SCRATCH_SURFACE, "SCRHSRFC"},
{GraphicsAllocation::AllocationType::WORK_PARTITION_SURFACE, "WRPRTSRF"},
{GraphicsAllocation::AllocationType::SHARED_BUFFER, "SHRDBUFF"},
{GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE, "SRDCXIMG"},
{GraphicsAllocation::AllocationType::SHARED_IMAGE, "SHERDIMG"},
{GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY, "SRDRSCCP"},
{GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP, "SRFCSTHP"},
{GraphicsAllocation::AllocationType::SVM_CPU, "SVM_CPU"},
{GraphicsAllocation::AllocationType::SVM_GPU, "SVM_GPU"},
{GraphicsAllocation::AllocationType::SVM_ZERO_COPY, "SVM0COPY"},
{GraphicsAllocation::AllocationType::TAG_BUFFER, "TAGBUFER"},
{GraphicsAllocation::AllocationType::GLOBAL_FENCE, "GLBLFENC"},
{GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, "TSPKTGBF"},
{GraphicsAllocation::AllocationType::UNKNOWN, "UNKNOWN"},
{GraphicsAllocation::AllocationType::WRITE_COMBINED, "WRTCMBND"},
{GraphicsAllocation::AllocationType::RING_BUFFER, "RINGBUFF"},
{GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, "SMPHRBUF"},
{GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA, "DBCXSVAR"},
{GraphicsAllocation::AllocationType::DEBUG_SBA_TRACKING_BUFFER, "DBSBATRB"},
{GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA, "DBMDLARE"},
{GraphicsAllocation::AllocationType::UNIFIED_SHARED_MEMORY, "USHRDMEM"},
{GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, "GPUTSDBF"},
{GraphicsAllocation::AllocationType::SW_TAG_BUFFER, "SWTAGBF"}};
AllocationTypeTagTestCase allocationTypeTagValues[static_cast<int>(AllocationType::COUNT)] = {
{AllocationType::BUFFER, "BUFFER"},
{AllocationType::BUFFER_HOST_MEMORY, "BFHSTMEM"},
{AllocationType::COMMAND_BUFFER, "CMNDBUFF"},
{AllocationType::CONSTANT_SURFACE, "CSNTSRFC"},
{AllocationType::EXTERNAL_HOST_PTR, "EXHSTPTR"},
{AllocationType::FILL_PATTERN, "FILPATRN"},
{AllocationType::GLOBAL_SURFACE, "GLBLSRFC"},
{AllocationType::IMAGE, "IMAGE"},
{AllocationType::INDIRECT_OBJECT_HEAP, "INOBHEAP"},
{AllocationType::INSTRUCTION_HEAP, "INSTHEAP"},
{AllocationType::INTERNAL_HEAP, "INTLHEAP"},
{AllocationType::INTERNAL_HOST_MEMORY, "INHSTMEM"},
{AllocationType::KERNEL_ISA, "KERNLISA"},
{AllocationType::KERNEL_ISA_INTERNAL, "KRLISAIN"},
{AllocationType::LINEAR_STREAM, "LINRSTRM"},
{AllocationType::MAP_ALLOCATION, "MAPALLOC"},
{AllocationType::MCS, "MCS"},
{AllocationType::PIPE, "PIPE"},
{AllocationType::PREEMPTION, "PRMPTION"},
{AllocationType::PRINTF_SURFACE, "PRNTSRFC"},
{AllocationType::PRIVATE_SURFACE, "PRVTSRFC"},
{AllocationType::PROFILING_TAG_BUFFER, "PROFTGBF"},
{AllocationType::SCRATCH_SURFACE, "SCRHSRFC"},
{AllocationType::WORK_PARTITION_SURFACE, "WRPRTSRF"},
{AllocationType::SHARED_BUFFER, "SHRDBUFF"},
{AllocationType::SHARED_CONTEXT_IMAGE, "SRDCXIMG"},
{AllocationType::SHARED_IMAGE, "SHERDIMG"},
{AllocationType::SHARED_RESOURCE_COPY, "SRDRSCCP"},
{AllocationType::SURFACE_STATE_HEAP, "SRFCSTHP"},
{AllocationType::SVM_CPU, "SVM_CPU"},
{AllocationType::SVM_GPU, "SVM_GPU"},
{AllocationType::SVM_ZERO_COPY, "SVM0COPY"},
{AllocationType::TAG_BUFFER, "TAGBUFER"},
{AllocationType::GLOBAL_FENCE, "GLBLFENC"},
{AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, "TSPKTGBF"},
{AllocationType::UNKNOWN, "UNKNOWN"},
{AllocationType::WRITE_COMBINED, "WRTCMBND"},
{AllocationType::RING_BUFFER, "RINGBUFF"},
{AllocationType::SEMAPHORE_BUFFER, "SMPHRBUF"},
{AllocationType::DEBUG_CONTEXT_SAVE_AREA, "DBCXSVAR"},
{AllocationType::DEBUG_SBA_TRACKING_BUFFER, "DBSBATRB"},
{AllocationType::DEBUG_MODULE_AREA, "DBMDLARE"},
{AllocationType::UNIFIED_SHARED_MEMORY, "USHRDMEM"},
{AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, "GPUTSDBF"},
{AllocationType::SW_TAG_BUFFER, "SWTAGBF"}};
class AllocationTypeTagString : public ::testing::TestWithParam<AllocationTypeTagTestCase> {};
TEST_P(AllocationTypeTagString, givenGraphicsAllocationTypeWhenCopyTagToStorageInfoThenCorrectTagIsReturned) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -13,15 +13,15 @@
using namespace NEO;
TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenIsCreatedThenAllInspectionIdsAreSetToZero) {
MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount);
MockGraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount);
for (auto i = 0u; i < MemoryManager::maxOsContextCount; i++) {
EXPECT_EQ(0u, graphicsAllocation.getInspectionId(i));
}
}
TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenIsCreatedThenTaskCountsAreInitializedProperly) {
GraphicsAllocation graphicsAllocation1(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount);
GraphicsAllocation graphicsAllocation2(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount);
GraphicsAllocation graphicsAllocation1(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount);
GraphicsAllocation graphicsAllocation2(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount);
for (auto i = 0u; i < MemoryManager::maxOsContextCount; i++) {
EXPECT_EQ(MockGraphicsAllocation::objectNotUsed, graphicsAllocation1.getTaskCount(i));
EXPECT_EQ(MockGraphicsAllocation::objectNotUsed, graphicsAllocation2.getTaskCount(i));
@@ -116,51 +116,51 @@ TEST(GraphicsAllocationTest, givenResidentGraphicsAllocationWhenCheckIfResidency
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsCommandBufferThenCpuAccessIsRequired) {
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::COMMAND_BUFFER));
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::COMMAND_BUFFER));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsConstantSurfaceThenCpuAccessIsRequired) {
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::CONSTANT_SURFACE));
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::CONSTANT_SURFACE));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsGlobalSurfaceThenCpuAccessIsRequired) {
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::GLOBAL_SURFACE));
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::GLOBAL_SURFACE));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsInternalHeapThenCpuAccessIsRequired) {
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::INTERNAL_HEAP));
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::INTERNAL_HEAP));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsKernelIsaThenCpuAccessIsNotRequired) {
EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::KERNEL_ISA));
EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(AllocationType::KERNEL_ISA));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsKernelIsaInternalThenCpuAccessIsNotRequired) {
EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL));
EXPECT_FALSE(GraphicsAllocation::isCpuAccessRequired(AllocationType::KERNEL_ISA_INTERNAL));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsLinearStreamThenCpuAccessIsRequired) {
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::LINEAR_STREAM));
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::LINEAR_STREAM));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsPipeThenCpuAccessIsRequired) {
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::PIPE));
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::PIPE));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsTimestampPacketThenCpuAccessIsRequired) {
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER));
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::TIMESTAMP_PACKET_TAG_BUFFER));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsGpuTimestampDeviceBufferThenCpuAccessIsRequired) {
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER));
EXPECT_TRUE(GraphicsAllocation::isCpuAccessRequired(AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER));
}
TEST(GraphicsAllocationTest, whenAllocationRequiresCpuAccessThenAllocationIsLockable) {
auto firstAllocationIdx = static_cast<int>(GraphicsAllocation::AllocationType::UNKNOWN);
auto lastAllocationIdx = static_cast<int>(GraphicsAllocation::AllocationType::COUNT);
auto firstAllocationIdx = static_cast<int>(AllocationType::UNKNOWN);
auto lastAllocationIdx = static_cast<int>(AllocationType::COUNT);
for (int allocationIdx = firstAllocationIdx; allocationIdx != lastAllocationIdx; allocationIdx++) {
auto allocationType = static_cast<GraphicsAllocation::AllocationType>(allocationIdx);
auto allocationType = static_cast<AllocationType>(allocationIdx);
if (GraphicsAllocation::isCpuAccessRequired(allocationType)) {
EXPECT_TRUE(GraphicsAllocation::isLockable(allocationType));
}
@@ -168,32 +168,32 @@ TEST(GraphicsAllocationTest, whenAllocationRequiresCpuAccessThenAllocationIsLock
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsISAThenAllocationIsLockable) {
EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::KERNEL_ISA));
EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL));
EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::KERNEL_ISA));
EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::KERNEL_ISA_INTERNAL));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferThenAllocationIsNotLockable) {
EXPECT_FALSE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::BUFFER));
EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::BUFFER));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferHostMemoryThenAllocationIsLockable) {
EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY));
EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::BUFFER_HOST_MEMORY));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsGpuTimestampDeviceBufferThenAllocationIsLockable) {
EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER));
EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsSvmGpuThenAllocationIsNotLockable) {
EXPECT_FALSE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::SVM_GPU));
EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::SVM_GPU));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsSharedResourceCopyThenAllocationIsLockable) {
EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY));
EXPECT_TRUE(GraphicsAllocation::isLockable(AllocationType::SHARED_RESOURCE_COPY));
}
TEST(GraphicsAllocationTest, whenAllocationTypeIsImageThenAllocationIsNotLockable) {
EXPECT_FALSE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::IMAGE));
EXPECT_FALSE(GraphicsAllocation::isLockable(AllocationType::IMAGE));
}
TEST(GraphicsAllocationTest, givenDefaultAllocationWhenGettingNumHandlesThenOneIsReturned) {
@@ -223,7 +223,7 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenQueryingUsedPageSizeThen
MemoryPool::SystemCpuInaccessible};
for (auto pool : page4kPools) {
MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, static_cast<osHandle>(1), pool, MemoryManager::maxOsContextCount);
MockGraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, static_cast<osHandle>(1), pool, MemoryManager::maxOsContextCount);
EXPECT_EQ(MemoryConstants::pageSize, graphicsAllocation.getUsedPageSize());
}
@@ -233,7 +233,7 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenQueryingUsedPageSizeThen
MemoryPool::LocalMemory};
for (auto pool : page64kPools) {
MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, pool, MemoryManager::maxOsContextCount);
MockGraphicsAllocation graphicsAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, pool, MemoryManager::maxOsContextCount);
EXPECT_EQ(MemoryConstants::pageSize64k, graphicsAllocation.getUsedPageSize());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -20,7 +20,7 @@ using namespace NEO;
TEST(MultiGraphicsAllocationTest, whenCreatingMultiGraphicsAllocationThenTheAllocationIsObtainableAsADefault) {
GraphicsAllocation graphicsAllocation(1, // rootDeviceIndex
GraphicsAllocation::AllocationType::BUFFER,
AllocationType::BUFFER,
nullptr, 0, 0, MemoryPool::System4KBPages, 0);
MockMultiGraphicsAllocation multiGraphicsAllocation(1);
@@ -36,10 +36,10 @@ TEST(MultiGraphicsAllocationTest, whenCreatingMultiGraphicsAllocationThenTheAllo
TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenAddingMultipleGraphicsAllocationsThenTheyAreObtainableByRootDeviceIndex) {
GraphicsAllocation graphicsAllocation0(0, // rootDeviceIndex
GraphicsAllocation::AllocationType::BUFFER,
AllocationType::BUFFER,
nullptr, 0, 0, MemoryPool::System4KBPages, 0);
GraphicsAllocation graphicsAllocation1(1, // rootDeviceIndex
GraphicsAllocation::AllocationType::BUFFER,
AllocationType::BUFFER,
nullptr, 0, 0, MemoryPool::System4KBPages, 0);
MockMultiGraphicsAllocation multiGraphicsAllocation(1);
@@ -53,7 +53,7 @@ TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenAddingMultiple
}
TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenGettingAllocationTypeThenReturnAllocationTypeFromDefaultAllocation) {
auto expectedAllocationType = GraphicsAllocation::AllocationType::BUFFER;
auto expectedAllocationType = AllocationType::BUFFER;
GraphicsAllocation graphicsAllocation(1, // rootDeviceIndex
expectedAllocationType,
nullptr, 0, 0, MemoryPool::System4KBPages, 0);
@@ -66,7 +66,7 @@ TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenGettingAllocat
}
TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenGettingCoherencyStatusThenReturnCoherencyStatusFromDefaultAllocation) {
auto expectedAllocationType = GraphicsAllocation::AllocationType::BUFFER;
auto expectedAllocationType = AllocationType::BUFFER;
GraphicsAllocation graphicsAllocation(1, // rootDeviceIndex
expectedAllocationType,
nullptr, 0, 0, MemoryPool::System4KBPages, 0);
@@ -89,7 +89,7 @@ TEST(MultiGraphicsAllocationTest, WhenCreatingMultiGraphicsAllocationWithoutGrap
TEST(MultiGraphicsAllocationTest, givenMultiGraphicsAllocationWhenRemovingGraphicsAllocationThenTheAllocationIsNoLongerAvailable) {
uint32_t rootDeviceIndex = 1u;
GraphicsAllocation graphicsAllocation(rootDeviceIndex,
GraphicsAllocation::AllocationType::BUFFER,
AllocationType::BUFFER,
nullptr, 0, 0, MemoryPool::System4KBPages, 0);
MockMultiGraphicsAllocation multiGraphicsAllocation(rootDeviceIndex);
@@ -126,7 +126,7 @@ TEST_F(MultiGraphicsAllocationTests, whenCreatingMultiGraphicsAllocationWithShar
AllocationProperties allocationProperties{0u,
true, //allocateMemory
MemoryConstants::pageSize,
GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY,
AllocationType::BUFFER_HOST_MEMORY,
false, //multiOsContextCapable
false, //isMultiStorageAllocationParam
systemMemoryBitfield};
@@ -149,7 +149,7 @@ TEST_F(MultiGraphicsAllocationTests, whenCreatingMultiGraphicsAllocationWithExis
AllocationProperties allocationProperties{0u,
false, //allocateMemory
MemoryConstants::pageSize,
GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY,
AllocationType::BUFFER_HOST_MEMORY,
false, //multiOsContextCapable
false, //isMultiStorageAllocationParam
systemMemoryBitfield};
@@ -170,7 +170,7 @@ TEST_F(MultiGraphicsAllocationTests, whenCreatingMultiGraphicsAllocationWithSepa
AllocationProperties allocationProperties{0u,
true, //allocateMemory
MemoryConstants::pageSize,
GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY,
AllocationType::BUFFER_HOST_MEMORY,
false, //multiOsContextCapable
false, //isMultiStorageAllocationParam
systemMemoryBitfield};
@@ -190,7 +190,7 @@ TEST_F(MultiGraphicsAllocationTests, givenMultiGraphicsAllocationThatRequiresMig
AllocationProperties allocationProperties{0u,
true, //allocateMemory
MemoryConstants::pageSize,
GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY,
AllocationType::BUFFER_HOST_MEMORY,
false, //multiOsContextCapable
false, //isMultiStorageAllocationParam
systemMemoryBitfield};
@@ -222,7 +222,7 @@ struct MigrationSyncDataTests : public MultiGraphicsAllocationTests {
AllocationProperties allocationProperties{0u,
true, //allocateMemory
MemoryConstants::pageSize,
GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY,
AllocationType::BUFFER_HOST_MEMORY,
false, //multiOsContextCapable
false, //isMultiStorageAllocationParam
systemMemoryBitfield};

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -71,7 +71,7 @@ TEST_F(FrontWindowAllocatorTests, givenInitializedHeapsWhenUseExternalAllocatorF
}
TEST_F(FrontWindowAllocatorTests, givenLinearStreamAllocWhenSelectingHeapWithFrontWindowThenCorrectIndexReturned) {
GraphicsAllocation allocation{0, GraphicsAllocation::AllocationType::LINEAR_STREAM, nullptr, 0, 0, 0, MemoryPool::MemoryNull};
GraphicsAllocation allocation{0, AllocationType::LINEAR_STREAM, nullptr, 0, 0, 0, MemoryPool::MemoryNull};
EXPECT_EQ(HeapIndex::HEAP_EXTERNAL_FRONT_WINDOW, memManager->selectHeap(&allocation, true, true, true));
}

View File

@@ -87,6 +87,6 @@ TEST(DrmQueryTest, givenDrmAllocationWhenShouldAllocationFaultIsCalledThenReturn
executionEnvironment->prepareRootDeviceEnvironments(1);
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::MemoryNull);
MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::MemoryNull);
EXPECT_FALSE(allocation.shouldAllocationPageFault(&drm));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -35,7 +35,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh
ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize());
EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size()));
EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast<void *>(static_cast<uintptr_t>(alloc->getGpuAddress()))));
EXPECT_EQ(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, alloc->getAllocationType());
EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType());
device.getMemoryManager()->freeGraphicsMemory(alloc);
alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), false /* constant */, nullptr /* linker input */, initData.data());
@@ -43,7 +43,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh
ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize());
EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size()));
EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast<void *>(static_cast<uintptr_t>(alloc->getGpuAddress()))));
EXPECT_EQ(GraphicsAllocation::AllocationType::GLOBAL_SURFACE, alloc->getAllocationType());
EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType());
device.getMemoryManager()->freeGraphicsMemory(alloc);
alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), true /* constant */, &emptyLinkerInput, initData.data());
@@ -51,7 +51,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh
ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize());
EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size()));
EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast<void *>(static_cast<uintptr_t>(alloc->getGpuAddress()))));
EXPECT_EQ(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, alloc->getAllocationType());
EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType());
device.getMemoryManager()->freeGraphicsMemory(alloc);
alloc = allocateGlobalsSurface(&svmAllocsManager, device, initData.size(), false /* constant */, &emptyLinkerInput, initData.data());
@@ -59,7 +59,7 @@ TEST(AllocateGlobalSurfaceTest, GivenSvmAllocsManagerWhenGlobalsAreNotExportedTh
ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize());
EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size()));
EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast<void *>(static_cast<uintptr_t>(alloc->getGpuAddress()))));
EXPECT_EQ(GraphicsAllocation::AllocationType::GLOBAL_SURFACE, alloc->getAllocationType());
EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType());
device.getMemoryManager()->freeGraphicsMemory(alloc);
}
@@ -121,28 +121,28 @@ TEST(AllocateGlobalSurfaceTest, GivenNullSvmAllocsManagerWhenGlobalsAreExportedT
ASSERT_NE(nullptr, alloc);
ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize());
EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size()));
EXPECT_EQ(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, alloc->getAllocationType());
EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType());
device.getMemoryManager()->freeGraphicsMemory(alloc);
alloc = allocateGlobalsSurface(nullptr, device, initData.size(), true /* constant */, &linkerInputExportGlobalVariables, initData.data());
ASSERT_NE(nullptr, alloc);
ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize());
EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size()));
EXPECT_EQ(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, alloc->getAllocationType());
EXPECT_EQ(AllocationType::CONSTANT_SURFACE, alloc->getAllocationType());
device.getMemoryManager()->freeGraphicsMemory(alloc);
alloc = allocateGlobalsSurface(nullptr, device, initData.size(), false /* constant */, &linkerInputExportGlobalConstants, initData.data());
ASSERT_NE(nullptr, alloc);
ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize());
EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size()));
EXPECT_EQ(GraphicsAllocation::AllocationType::GLOBAL_SURFACE, alloc->getAllocationType());
EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType());
device.getMemoryManager()->freeGraphicsMemory(alloc);
alloc = allocateGlobalsSurface(nullptr, device, initData.size(), false /* constant */, &linkerInputExportGlobalVariables, initData.data());
ASSERT_NE(nullptr, alloc);
ASSERT_EQ(initData.size(), alloc->getUnderlyingBufferSize());
EXPECT_EQ(0, memcmp(alloc->getUnderlyingBuffer(), initData.data(), initData.size()));
EXPECT_EQ(GraphicsAllocation::AllocationType::GLOBAL_SURFACE, alloc->getAllocationType());
EXPECT_EQ(AllocationType::GLOBAL_SURFACE, alloc->getAllocationType());
device.getMemoryManager()->freeGraphicsMemory(alloc);
}
@@ -236,7 +236,7 @@ TEST(AllocateGlobalSurfaceTest, GivenAllocationInLocalMemoryWhichRequiresBlitter
nullptr /* linker input */, initData.data());
ASSERT_NE(nullptr, pAllocation);
EXPECT_EQ(nullptr, svmAllocsManager.getSVMAlloc(reinterpret_cast<void *>(static_cast<uintptr_t>(pAllocation->getGpuAddress()))));
EXPECT_EQ(GraphicsAllocation::AllocationType::CONSTANT_SURFACE, pAllocation->getAllocationType());
EXPECT_EQ(AllocationType::CONSTANT_SURFACE, pAllocation->getAllocationType());
if (pAllocation->isAllocatedInLocalMemoryPool() && (localMemoryAccessMode == LocalMemoryAccessMode::CpuAccessDisallowed)) {
expectedBlitsCount++;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -52,7 +52,7 @@ struct SoftwareTagsManagerTests : public DeviceFixture, public ::testing::Test {
const AllocationProperties properties{
pDevice->getRootDeviceIndex(),
SWTagsManager::estimateSpaceForSWTags<GfxFamily>(),
GraphicsAllocation::AllocationType::LINEAR_STREAM,
AllocationType::LINEAR_STREAM,
pDevice->getDeviceBitfield()};
GraphicsAllocation *allocation = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -24,7 +24,7 @@ XE_HPC_CORETEST_F(AubCommandStreamReceiverXeHpcCoreTests, givenLinkBcsEngineWhen
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
auto memoryManager = device->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, device->getDeviceBitfield()});
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::BUFFER, device->getDeviceBitfield()});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));