mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 12:42:54 +08:00
refactor: correct naming of enum class constants 4/n
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
01dd503e47
commit
432142c574
@@ -499,7 +499,7 @@ TEST(DebugBindlessSip, givenOfflineDebuggingModeWhenGettingSipForContextThenCorr
|
||||
auto builtIns = new NEO::MockBuiltins();
|
||||
builtIns->callBaseGetSipKernel = true;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(builtIns);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::Offline);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::offline);
|
||||
|
||||
const uint32_t contextId = 0u;
|
||||
std::unique_ptr<OsContext> osContext(OsContext::create(executionEnvironment->rootDeviceEnvironments[0]->osInterface.get(),
|
||||
@@ -629,7 +629,7 @@ TEST(DebugBindlessSip, givenOfflineDebuggingModeWhenSipIsInitializedThenBinaryIs
|
||||
auto builtIns = new NEO::MockBuiltins();
|
||||
builtIns->callBaseGetSipKernel = true;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(builtIns);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::Offline);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::offline);
|
||||
|
||||
auto osContext = std::make_unique<OsContextMock>(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::regular}));
|
||||
osContext->debuggableContext = true;
|
||||
@@ -666,7 +666,7 @@ TEST(DebugBindlessSip, givenOfflineDebuggingModeAndInvalidSipWhenSipIsInitialize
|
||||
auto builtIns = new NEO::MockBuiltins();
|
||||
builtIns->callBaseGetSipKernel = true;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(builtIns);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::Offline);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::offline);
|
||||
|
||||
auto osContext = std::make_unique<OsContextMock>(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::regular}));
|
||||
osContext->debuggableContext = true;
|
||||
@@ -703,7 +703,7 @@ TEST(DebugBindlessSip, givenOfflineDebuggingModeWhenDebugSipForContextIsCreatedT
|
||||
auto builtIns = new NEO::MockBuiltins();
|
||||
builtIns->callBaseGetSipKernel = true;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(builtIns);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::Offline);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::offline);
|
||||
|
||||
auto osContext = std::make_unique<OsContextMock>(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::regular}));
|
||||
osContext->debuggableContext = true;
|
||||
|
||||
@@ -161,7 +161,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectA
|
||||
TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIsInitialized) {
|
||||
CommandContainer cmdContainer;
|
||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, status);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||
|
||||
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
||||
EXPECT_NE(cmdContainer.getHeapHelper(), nullptr);
|
||||
@@ -192,7 +192,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs
|
||||
TEST_F(CommandContainerTest, givenCommandContainerWhenHeapNotRequiredThenHeapIsNotInitialized) {
|
||||
CommandContainer cmdContainer;
|
||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, status);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||
|
||||
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
||||
EXPECT_EQ(cmdContainer.getHeapHelper(), nullptr);
|
||||
@@ -229,7 +229,7 @@ TEST_F(CommandContainerTest, givenEnabledLocalMemoryAndIsaInSystemMemoryWhenCmdC
|
||||
|
||||
CommandContainer cmdContainer;
|
||||
auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, status);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||
|
||||
EXPECT_EQ(instructionHeapBaseAddress, cmdContainer.getInstructionHeapBaseAddress());
|
||||
}
|
||||
@@ -248,7 +248,7 @@ TEST_F(CommandContainerTest, givenForceDefaultHeapSizeWhenCmdContainerIsInitiali
|
||||
|
||||
CommandContainer cmdContainer;
|
||||
auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, status);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||
|
||||
auto indirectHeap = cmdContainer.getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT);
|
||||
EXPECT_EQ(indirectHeap->getAvailableSpace(), 32 * MemoryConstants::kiloByte);
|
||||
@@ -258,14 +258,14 @@ TEST_F(CommandContainerTest, givenCommandContainerDuringInitWhenAllocateGfxMemor
|
||||
CommandContainer cmdContainer;
|
||||
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(0, *pDevice->executionEnvironment));
|
||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::OUT_OF_DEVICE_MEMORY, status);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status);
|
||||
}
|
||||
|
||||
TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenAllocateSecondaryCmdStreamFailsDuringInitializeThenErrorIsReturned) {
|
||||
CommandContainer cmdContainer;
|
||||
static_cast<MockMemoryManager *>(pDevice->getMemoryManager())->maxSuccessAllocatedGraphicsMemoryIndex = 7;
|
||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::OUT_OF_DEVICE_MEMORY, status);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status);
|
||||
}
|
||||
|
||||
TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndResetThenCmdBufferAllocIsReused) {
|
||||
@@ -331,7 +331,7 @@ TEST_F(CommandContainerTest, givenCommandContainerDuringInitWhenAllocateHeapMemo
|
||||
auto tempMemoryManager = pDevice->executionEnvironment->memoryManager.release();
|
||||
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(1, *pDevice->executionEnvironment));
|
||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::OUT_OF_DEVICE_MEMORY, status);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status);
|
||||
delete tempMemoryManager;
|
||||
}
|
||||
|
||||
@@ -1022,7 +1022,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerHasImmediateCsrWhenGettingHeapWi
|
||||
|
||||
cmdContainer.setNumIddPerBlock(1);
|
||||
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, code);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
||||
|
||||
EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(HeapType::DYNAMIC_STATE));
|
||||
EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(HeapType::SURFACE_STATE));
|
||||
@@ -1198,7 +1198,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerUsedInRegularCmdListWhenGettingH
|
||||
HeapReserveArguments dshReserveArgs = {dshHeapPtr, 0, dshAlign};
|
||||
|
||||
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, code);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
||||
|
||||
cmdContainer.reserveSpaceForDispatch(sshReserveArgs, dshReserveArgs, true);
|
||||
|
||||
@@ -1246,7 +1246,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerUsingPrivateHeapsWhenGettingRese
|
||||
HeapReserveArguments dshReserveArgs = {dshHeapPtr, 0, dshAlign};
|
||||
|
||||
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, code);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
||||
|
||||
constexpr size_t nonZeroSshSize = 4 * MemoryConstants::kiloByte;
|
||||
constexpr size_t nonZeroDshSize = 4 * MemoryConstants::kiloByte + 64;
|
||||
@@ -1289,7 +1289,7 @@ HWTEST_F(CommandContainerTest,
|
||||
cmdContainer.setNumIddPerBlock(1);
|
||||
|
||||
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, code);
|
||||
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
||||
|
||||
constexpr size_t misalignedSize = 11;
|
||||
sshReserveArgs.size = misalignedSize;
|
||||
@@ -1638,19 +1638,19 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsAnd
|
||||
}
|
||||
|
||||
TEST_F(CommandContainerHeapStateTests, givenCmdContainerWhenSettingHeapAddressModelThenGeterReturnsTheSameValue) {
|
||||
myCommandContainer.setHeapAddressModel(HeapAddressModel::GlobalStateless);
|
||||
EXPECT_EQ(HeapAddressModel::GlobalStateless, myCommandContainer.getHeapAddressModel());
|
||||
myCommandContainer.setHeapAddressModel(HeapAddressModel::globalStateless);
|
||||
EXPECT_EQ(HeapAddressModel::globalStateless, myCommandContainer.getHeapAddressModel());
|
||||
|
||||
myCommandContainer.setHeapAddressModel(HeapAddressModel::GlobalBindless);
|
||||
EXPECT_EQ(HeapAddressModel::GlobalBindless, myCommandContainer.getHeapAddressModel());
|
||||
myCommandContainer.setHeapAddressModel(HeapAddressModel::globalBindless);
|
||||
EXPECT_EQ(HeapAddressModel::globalBindless, myCommandContainer.getHeapAddressModel());
|
||||
|
||||
myCommandContainer.setHeapAddressModel(HeapAddressModel::GlobalBindful);
|
||||
EXPECT_EQ(HeapAddressModel::GlobalBindful, myCommandContainer.getHeapAddressModel());
|
||||
myCommandContainer.setHeapAddressModel(HeapAddressModel::globalBindful);
|
||||
EXPECT_EQ(HeapAddressModel::globalBindful, myCommandContainer.getHeapAddressModel());
|
||||
}
|
||||
|
||||
TEST_F(CommandContainerTest, givenGlobalHeapModelSelectedWhenCmdContainerIsInitializedThenNoSurfaceAndDynamicHeapCreated) {
|
||||
MyMockCommandContainer cmdContainer;
|
||||
cmdContainer.setHeapAddressModel(HeapAddressModel::GlobalStateless);
|
||||
cmdContainer.setHeapAddressModel(HeapAddressModel::globalStateless);
|
||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
|
||||
EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE));
|
||||
|
||||
@@ -4428,7 +4428,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
using STATE_SIP = typename FamilyType::STATE_SIP;
|
||||
|
||||
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->initDebuggerL0(pDevice);
|
||||
pDevice->getExecutionEnvironment()->setDebuggingMode(DebuggingMode::Offline);
|
||||
pDevice->getExecutionEnvironment()->setDebuggingMode(DebuggingMode::offline);
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
commandStreamReceiver.storeMakeResidentAllocations = true;
|
||||
|
||||
@@ -31,7 +31,7 @@ struct L0DebuggerSharedLinuxFixture {
|
||||
void setUp(HardwareInfo *hwInfo) {
|
||||
auto executionEnvironment = new NEO::ExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(hwInfo ? hwInfo : defaultHwInfo.get());
|
||||
executionEnvironment->initializeMemoryManager();
|
||||
auto osInterface = new OSInterface();
|
||||
@@ -100,7 +100,7 @@ HWTEST_F(SingleAddressSpaceLinuxFixture, givenDebuggingModeOfflineWhenDebuggerIs
|
||||
auto debugger = std::make_unique<MockDebuggerL0Hw<FamilyType>>(pDevice);
|
||||
EXPECT_FALSE(debugger->singleAddressSpaceSbaTracking);
|
||||
|
||||
pDevice->getExecutionEnvironment()->setDebuggingMode(DebuggingMode::Offline);
|
||||
pDevice->getExecutionEnvironment()->setDebuggingMode(DebuggingMode::offline);
|
||||
|
||||
debugger = std::make_unique<MockDebuggerL0Hw<FamilyType>>(pDevice);
|
||||
EXPECT_TRUE(debugger->singleAddressSpaceSbaTracking);
|
||||
|
||||
@@ -29,7 +29,7 @@ using namespace NEO;
|
||||
TEST(Debugger, givenL0DebuggerWhenGettingL0DebuggerThenCorrectObjectIsReturned) {
|
||||
auto executionEnvironment = new NEO::ExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
|
||||
@@ -84,7 +84,7 @@ TEST(Debugger, givenL0DebuggerOFFWhenGettingStateSaveAreaHeaderThenValidSipTypeI
|
||||
TEST(Debugger, givenDebuggingEnabledInExecEnvWhenAllocatingIsaThenSingleBankIsUsed) {
|
||||
auto executionEnvironment = new NEO::ExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||
hwInfo.featureTable.flags.ftrLocalMemory = true;
|
||||
@@ -112,7 +112,7 @@ TEST(Debugger, givenTileAttachAndDebuggingEnabledInExecEnvWhenAllocatingIsaThenM
|
||||
|
||||
auto executionEnvironment = new NEO::ExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||
hwInfo.featureTable.flags.ftrLocalMemory = true;
|
||||
@@ -144,7 +144,7 @@ TEST(Debugger, WhenInitializingDebuggerL0ThenCapabilitiesAreAdjustedAndDebuggerI
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
executionEnvironment->initializeMemoryManager();
|
||||
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
auto neoDevice = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(executionEnvironment, 0u));
|
||||
|
||||
@@ -266,16 +266,16 @@ HWTEST_F(L0DebuggerTest, givenUseBindlessDebugSipZeroWhenModuleHeapDebugAreaIsCr
|
||||
|
||||
HWTEST_F(L0DebuggerTest, givenProgramDebuggingWhenGettingDebuggingModeThenCorrectModeIsReturned) {
|
||||
DebuggingMode mode = NEO::getDebuggingMode(0);
|
||||
EXPECT_TRUE(DebuggingMode::Disabled == mode);
|
||||
EXPECT_TRUE(DebuggingMode::disabled == mode);
|
||||
|
||||
mode = NEO::getDebuggingMode(1);
|
||||
EXPECT_TRUE(DebuggingMode::Online == mode);
|
||||
EXPECT_TRUE(DebuggingMode::online == mode);
|
||||
|
||||
mode = NEO::getDebuggingMode(2);
|
||||
EXPECT_TRUE(DebuggingMode::Offline == mode);
|
||||
EXPECT_TRUE(DebuggingMode::offline == mode);
|
||||
|
||||
mode = NEO::getDebuggingMode(3);
|
||||
EXPECT_TRUE(DebuggingMode::Disabled == mode);
|
||||
EXPECT_TRUE(DebuggingMode::disabled == mode);
|
||||
}
|
||||
|
||||
using PerContextAddressSpaceL0DebuggerTest = L0DebuggerTest;
|
||||
|
||||
@@ -35,7 +35,7 @@ GEN12LPTEST_F(CommandEncoderTest, WhenAdjustComputeModeIsCalledThenStateComputeM
|
||||
CommandContainer cmdContainer;
|
||||
|
||||
auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
ASSERT_EQ(CommandContainer::ErrorCode::SUCCESS, ret);
|
||||
ASSERT_EQ(CommandContainer::ErrorCode::success, ret);
|
||||
|
||||
auto usedSpaceBefore = cmdContainer.getCommandStream()->getUsed();
|
||||
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
|
||||
@@ -87,7 +87,7 @@ GEN12LPTEST_F(CommandEncodeStatesTest, givenVariousEngineTypesWhenEncodeSbaThenA
|
||||
CommandContainer cmdContainer;
|
||||
|
||||
auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
||||
ASSERT_EQ(CommandContainer::ErrorCode::SUCCESS, ret);
|
||||
ASSERT_EQ(CommandContainer::ErrorCode::success, ret);
|
||||
|
||||
auto gmmHelper = cmdContainer.getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
||||
uint32_t statelessMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
|
||||
|
||||
@@ -89,7 +89,7 @@ TEST_F(KernelHelperTest, GivenStatelessPrivateSizeGreaterThanGlobalSizeWhenCheck
|
||||
auto globalSize = pDevice->getDeviceInfo().globalMemSize;
|
||||
KernelDescriptor::KernelAttributes attributes = {};
|
||||
attributes.perHwThreadPrivateMemorySize = (static_cast<uint32_t>((globalSize + pDevice->getDeviceInfo().computeUnitsUsedForScratch) / pDevice->getDeviceInfo().computeUnitsUsedForScratch)) + 100;
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::OUT_OF_DEVICE_MEMORY);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::outOfDeviceMemory);
|
||||
}
|
||||
|
||||
TEST_F(KernelHelperTest, GivenScratchSizeGreaterThanGlobalSizeWhenCheckingIfThereIsEnaughSpaceThenOutOfMemReturned) {
|
||||
@@ -98,9 +98,9 @@ TEST_F(KernelHelperTest, GivenScratchSizeGreaterThanGlobalSizeWhenCheckingIfTher
|
||||
attributes.perThreadScratchSize[0] = (static_cast<uint32_t>((globalSize + pDevice->getDeviceInfo().computeUnitsUsedForScratch) / pDevice->getDeviceInfo().computeUnitsUsedForScratch)) + 100;
|
||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
||||
if (attributes.perThreadScratchSize[0] > gfxCoreHelper.getMaxScratchSize()) {
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::INVALID_KERNEL);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::invalidKernel);
|
||||
} else {
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::OUT_OF_DEVICE_MEMORY);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::outOfDeviceMemory);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,9 +110,9 @@ TEST_F(KernelHelperTest, GivenScratchPrivateSizeGreaterThanGlobalSizeWhenCheckin
|
||||
attributes.perThreadScratchSize[1] = (static_cast<uint32_t>((globalSize + pDevice->getDeviceInfo().computeUnitsUsedForScratch) / pDevice->getDeviceInfo().computeUnitsUsedForScratch)) + 100;
|
||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
||||
if (attributes.perThreadScratchSize[1] > gfxCoreHelper.getMaxScratchSize()) {
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::INVALID_KERNEL);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::invalidKernel);
|
||||
} else {
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::OUT_OF_DEVICE_MEMORY);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::outOfDeviceMemory);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ TEST_F(KernelHelperTest, GivenScratchAndPrivateSizeLessThanGlobalSizeWhenCheckin
|
||||
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize();
|
||||
attributes.perThreadScratchSize[0] = (size > maxScratchSize) ? maxScratchSize : size;
|
||||
attributes.perThreadScratchSize[1] = (size > maxScratchSize) ? maxScratchSize : size;
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::SUCCESS);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::success);
|
||||
}
|
||||
|
||||
TEST_F(KernelHelperTest, GivenScratchSizeGreaterThanMaxScratchSizeWhenCheckingIfThereIsEnaughSpaceThenInvalidKernelIsReturned) {
|
||||
@@ -135,7 +135,7 @@ TEST_F(KernelHelperTest, GivenScratchSizeGreaterThanMaxScratchSizeWhenCheckingIf
|
||||
attributes.perHwThreadPrivateMemorySize = 0x10;
|
||||
attributes.perThreadScratchSize[0] = maxScratchSize + 1;
|
||||
attributes.perThreadScratchSize[1] = 0x10;
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::INVALID_KERNEL);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::invalidKernel);
|
||||
}
|
||||
|
||||
TEST_F(KernelHelperTest, GivenScratchPrivateSizeGreaterThanMaxScratchSizeWhenCheckingIfThereIsEnaughSpaceThenInvalidKernelIsReturned) {
|
||||
@@ -145,7 +145,7 @@ TEST_F(KernelHelperTest, GivenScratchPrivateSizeGreaterThanMaxScratchSizeWhenChe
|
||||
attributes.perHwThreadPrivateMemorySize = 0x10;
|
||||
attributes.perThreadScratchSize[0] = 0x10;
|
||||
attributes.perThreadScratchSize[1] = maxScratchSize + 1;
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::INVALID_KERNEL);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::invalidKernel);
|
||||
}
|
||||
|
||||
TEST_F(KernelHelperTest, GivenScratchAndEqualsZeroWhenCheckingIfThereIsEnaughSpaceThenSuccessIsReturned) {
|
||||
@@ -153,7 +153,7 @@ TEST_F(KernelHelperTest, GivenScratchAndEqualsZeroWhenCheckingIfThereIsEnaughSpa
|
||||
attributes.perHwThreadPrivateMemorySize = 0;
|
||||
attributes.perThreadScratchSize[0] = 0;
|
||||
attributes.perThreadScratchSize[1] = 0;
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::SUCCESS);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::success);
|
||||
}
|
||||
|
||||
TEST_F(KernelHelperTest, GivenScratchEqualsZeroAndPrivetGreaterThanZeroWhenCheckingIfThereIsEnaughSpaceThenSuccessIsReturned) {
|
||||
@@ -161,7 +161,7 @@ TEST_F(KernelHelperTest, GivenScratchEqualsZeroAndPrivetGreaterThanZeroWhenCheck
|
||||
attributes.perHwThreadPrivateMemorySize = 0x10;
|
||||
attributes.perThreadScratchSize[0] = 0;
|
||||
attributes.perThreadScratchSize[1] = 0;
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::SUCCESS);
|
||||
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::success);
|
||||
}
|
||||
|
||||
TEST_F(KernelHelperTest, GivenNoPtrByValueWhenCheckingIsAnyArgumentPtrByValueThenFalseIsReturned) {
|
||||
|
||||
@@ -32,9 +32,9 @@ TEST_F(HostPtrManagerTest, GivenAlignedPointerAndAlignedSizeWhenGettingAllocatio
|
||||
AllocationRequirements reqs = MockHostPtrManager::getAllocationRequirements(rootDeviceIndex, ptr, size);
|
||||
|
||||
EXPECT_EQ(1u, reqs.requiredFragmentsCount);
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::MIDDLE);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::middle);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::none);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::none);
|
||||
|
||||
EXPECT_EQ(reqs.totalRequiredSize, size);
|
||||
|
||||
@@ -54,9 +54,9 @@ TEST_F(HostPtrManagerTest, GivenAlignedPointerAndNotAlignedSizeWhenGettingAlloca
|
||||
AllocationRequirements reqs = MockHostPtrManager::getAllocationRequirements(rootDeviceIndex, ptr, size);
|
||||
EXPECT_EQ(2u, reqs.requiredFragmentsCount);
|
||||
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::MIDDLE);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::TRAILING);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::middle);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::trailing);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::none);
|
||||
EXPECT_EQ(reqs.totalRequiredSize, alignUp(size, MemoryConstants::pageSize));
|
||||
|
||||
EXPECT_EQ(ptr, reqs.allocationFragments[0].allocationPtr);
|
||||
@@ -77,9 +77,9 @@ TEST_F(HostPtrManagerTest, GivenNotAlignedPointerAndNotAlignedSizeWhenGettingAll
|
||||
AllocationRequirements reqs = MockHostPtrManager::getAllocationRequirements(rootDeviceIndex, ptr, size);
|
||||
EXPECT_EQ(3u, reqs.requiredFragmentsCount);
|
||||
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::LEADING);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::MIDDLE);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::TRAILING);
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::leading);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::middle);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::trailing);
|
||||
|
||||
auto leadingPtr = (void *)0x1000;
|
||||
auto middlePtr = (void *)0x2000;
|
||||
@@ -104,9 +104,9 @@ TEST_F(HostPtrManagerTest, GivenNotAlignedPointerAndNotAlignedSizeWithinOnePageW
|
||||
AllocationRequirements reqs = MockHostPtrManager::getAllocationRequirements(rootDeviceIndex, ptr, size);
|
||||
EXPECT_EQ(1u, reqs.requiredFragmentsCount);
|
||||
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::LEADING);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::leading);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::none);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::none);
|
||||
|
||||
auto leadingPtr = (void *)0x1000;
|
||||
|
||||
@@ -129,9 +129,9 @@ TEST_F(HostPtrManagerTest, GivenNotAlignedPointerAndNotAlignedSizeWithinTwoPages
|
||||
AllocationRequirements reqs = MockHostPtrManager::getAllocationRequirements(rootDeviceIndex, ptr, size);
|
||||
EXPECT_EQ(2u, reqs.requiredFragmentsCount);
|
||||
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::LEADING);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::TRAILING);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::leading);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::trailing);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::none);
|
||||
|
||||
auto leadingPtr = (void *)0x1000;
|
||||
auto trailingPtr = (void *)0x2000;
|
||||
@@ -155,9 +155,9 @@ TEST_F(HostPtrManagerTest, GivenAlignedPointerAndAlignedSizeOfOnePageWhenGetting
|
||||
AllocationRequirements reqs = MockHostPtrManager::getAllocationRequirements(rootDeviceIndex, ptr, size);
|
||||
EXPECT_EQ(1u, reqs.requiredFragmentsCount);
|
||||
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::MIDDLE);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::middle);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::none);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::none);
|
||||
|
||||
auto middlePtr = (void *)0x1000;
|
||||
|
||||
@@ -180,9 +180,9 @@ TEST_F(HostPtrManagerTest, GivenNotAlignedPointerAndSizeThatFitsToPageWhenGettin
|
||||
AllocationRequirements reqs = MockHostPtrManager::getAllocationRequirements(rootDeviceIndex, ptr, size);
|
||||
EXPECT_EQ(2u, reqs.requiredFragmentsCount);
|
||||
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::LEADING);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::MIDDLE);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::leading);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::middle);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::none);
|
||||
|
||||
auto leadingPtr = (void *)0x1000;
|
||||
auto middlePtr = (void *)0x2000;
|
||||
@@ -206,9 +206,9 @@ TEST_F(HostPtrManagerTest, GivenAlignedPointerAndPageSizeWhenGettingAllocationRe
|
||||
AllocationRequirements reqs = MockHostPtrManager::getAllocationRequirements(rootDeviceIndex, ptr, size);
|
||||
EXPECT_EQ(1u, reqs.requiredFragmentsCount);
|
||||
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::MIDDLE);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::NONE);
|
||||
EXPECT_EQ(reqs.allocationFragments[0].fragmentPosition, FragmentPosition::middle);
|
||||
EXPECT_EQ(reqs.allocationFragments[1].fragmentPosition, FragmentPosition::none);
|
||||
EXPECT_EQ(reqs.allocationFragments[2].fragmentPosition, FragmentPosition::none);
|
||||
|
||||
auto middlePtr = (void *)0x1000;
|
||||
|
||||
@@ -893,11 +893,11 @@ TEST_F(HostPtrAllocationTest, whenOverlappedFragmentIsBiggerThenStoredAndStoredF
|
||||
|
||||
requirements.allocationFragments[0].allocationPtr = alignDown(cpuPtr1, MemoryConstants::pageSize);
|
||||
requirements.allocationFragments[0].allocationSize = MemoryConstants::pageSize * 10;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::NONE;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::none;
|
||||
|
||||
RequirementsStatus status = hostPtrManager->checkAllocationsForOverlapping(*memoryManager, &requirements);
|
||||
|
||||
EXPECT_EQ(RequirementsStatus::SUCCESS, status);
|
||||
EXPECT_EQ(RequirementsStatus::success, status);
|
||||
}
|
||||
|
||||
HWTEST_F(HostPtrAllocationTest, givenOverlappingFragmentsWhenCheckIsCalledThenWaitAndCleanOnAllEngines) {
|
||||
@@ -941,7 +941,7 @@ HWTEST_F(HostPtrAllocationTest, givenOverlappingFragmentsWhenCheckIsCalledThenWa
|
||||
|
||||
requirements.allocationFragments[0].allocationPtr = alignDown(cpuPtr, MemoryConstants::pageSize);
|
||||
requirements.allocationFragments[0].allocationSize = MemoryConstants::pageSize * 10;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::NONE;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::none;
|
||||
requirements.rootDeviceIndex = csr0->getRootDeviceIndex();
|
||||
|
||||
hostPtrManager->checkAllocationsForOverlapping(*memoryManager, &requirements);
|
||||
@@ -984,12 +984,12 @@ TEST_F(HostPtrAllocationTest, whenOverlappedFragmentIsBiggerThenStoredAndStoredF
|
||||
|
||||
requirements.allocationFragments[0].allocationPtr = alignDown(cpuPtr1, MemoryConstants::pageSize);
|
||||
requirements.allocationFragments[0].allocationSize = MemoryConstants::pageSize * 10;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::NONE;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::none;
|
||||
requirements.rootDeviceIndex = csr->getRootDeviceIndex();
|
||||
|
||||
RequirementsStatus status = hostPtrManager->checkAllocationsForOverlapping(*memoryManager, &requirements);
|
||||
|
||||
EXPECT_EQ(RequirementsStatus::FATAL, status);
|
||||
EXPECT_EQ(RequirementsStatus::fatal, status);
|
||||
}
|
||||
|
||||
TEST_F(HostPtrAllocationTest, GivenAllocationsWithoutBiggerOverlapWhenChckingForOverlappingThenSuccessIsReturned) {
|
||||
@@ -1023,15 +1023,15 @@ TEST_F(HostPtrAllocationTest, GivenAllocationsWithoutBiggerOverlapWhenChckingFor
|
||||
|
||||
requirements.allocationFragments[0].allocationPtr = alignDown(cpuPtr1, MemoryConstants::pageSize);
|
||||
requirements.allocationFragments[0].allocationSize = MemoryConstants::pageSize;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::LEADING;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::leading;
|
||||
|
||||
requirements.allocationFragments[1].allocationPtr = alignUp(cpuPtr1, MemoryConstants::pageSize);
|
||||
requirements.allocationFragments[1].allocationSize = MemoryConstants::pageSize;
|
||||
requirements.allocationFragments[1].fragmentPosition = FragmentPosition::TRAILING;
|
||||
requirements.allocationFragments[1].fragmentPosition = FragmentPosition::trailing;
|
||||
|
||||
RequirementsStatus status = hostPtrManager->checkAllocationsForOverlapping(*memoryManager, &requirements);
|
||||
|
||||
EXPECT_EQ(RequirementsStatus::SUCCESS, status);
|
||||
EXPECT_EQ(RequirementsStatus::success, status);
|
||||
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation1);
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation2);
|
||||
@@ -1067,11 +1067,11 @@ TEST_F(HostPtrAllocationTest, GivenAllocationsWithBiggerOverlapWhenChckingForOve
|
||||
|
||||
requirements.allocationFragments[0].allocationPtr = alignDown(cpuPtr1, MemoryConstants::pageSize);
|
||||
requirements.allocationFragments[0].allocationSize = MemoryConstants::pageSize * 10;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::NONE;
|
||||
requirements.allocationFragments[0].fragmentPosition = FragmentPosition::none;
|
||||
|
||||
RequirementsStatus status = hostPtrManager->checkAllocationsForOverlapping(*memoryManager, &requirements);
|
||||
|
||||
EXPECT_EQ(RequirementsStatus::SUCCESS, status);
|
||||
EXPECT_EQ(RequirementsStatus::success, status);
|
||||
}
|
||||
|
||||
TEST(HostPtrEntryKeyTest, givenTwoHostPtrEntryKeysWhenComparingThemThenKeyWithLowerRootDeviceIndexIsLower) {
|
||||
|
||||
@@ -71,7 +71,7 @@ TEST(MemoryManagerTest, whenGettingPreferredAllocationMethodThenNotDefinedIsRetu
|
||||
MockMemoryManager memoryManager;
|
||||
for (auto i = 0; i < static_cast<int>(AllocationType::count); i++) {
|
||||
AllocationProperties allocationProperties{0u, 0u, static_cast<AllocationType>(i), {}};
|
||||
EXPECT_EQ(GfxMemoryAllocationMethod::NotDefined, memoryManager.getPreferredAllocationMethod(allocationProperties));
|
||||
EXPECT_EQ(GfxMemoryAllocationMethod::notDefined, memoryManager.getPreferredAllocationMethod(allocationProperties));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -370,14 +370,14 @@ TEST_F(DrmBufferObjectTest, givenDeleterWhenBufferObjectIsCreatedAndDeletedThenC
|
||||
|
||||
TEST(DrmBufferObject, givenOfflineDebuggingModeWhenQueryingIsPerContextVMRequiredThenPerContextVMIsDisabled) {
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
device->getRootDeviceEnvironment().executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Offline);
|
||||
device->getRootDeviceEnvironment().executionEnvironment.setDebuggingMode(NEO::DebuggingMode::offline);
|
||||
DrmMock drm(*(device->getExecutionEnvironment()->rootDeviceEnvironments[0].get()));
|
||||
EXPECT_FALSE(drm.isPerContextVMRequired());
|
||||
}
|
||||
|
||||
TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoCreatedThenBindInfoIsInitializedToOsContextCount) {
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
device->getRootDeviceEnvironment().executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
device->getRootDeviceEnvironment().executionEnvironment.setDebuggingMode(NEO::DebuggingMode::online);
|
||||
device->getExecutionEnvironment()->calculateMaxOsContextCount();
|
||||
DrmMock drm(*(device->getExecutionEnvironment()->rootDeviceEnvironments[0].get()));
|
||||
EXPECT_TRUE(drm.isPerContextVMRequired());
|
||||
@@ -395,7 +395,7 @@ TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoCreatedThenBindInfoIsInitia
|
||||
|
||||
TEST(DrmBufferObject, givenDrmIoctlReturnsErrorNotSupportedThenBufferObjectReturnsError) {
|
||||
auto executionEnvironment = new ExecutionEnvironment;
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -425,7 +425,7 @@ TEST(DrmBufferObject, givenDrmIoctlReturnsErrorNotSupportedThenBufferObjectRetur
|
||||
|
||||
TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoBoundAndUnboundThenCorrectBindInfoIsUpdated) {
|
||||
auto executionEnvironment = new ExecutionEnvironment;
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -469,7 +469,7 @@ TEST(DrmBufferObject, givenPrintBOBindingResultWhenBOBindAndUnbindSucceedsThenPr
|
||||
debugManager.flags.PrintBOBindingResult.set(true);
|
||||
|
||||
auto executionEnvironment = new ExecutionEnvironment;
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -527,7 +527,7 @@ TEST(DrmBufferObject, givenPrintBOBindingResultWhenBOBindAndUnbindFailsThenPrint
|
||||
debugManager.flags.PrintBOBindingResult.set(true);
|
||||
|
||||
auto executionEnvironment = new ExecutionEnvironment;
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -575,7 +575,7 @@ TEST(DrmBufferObject, givenPrintBOBindingResultWhenBOBindAndUnbindFailsThenPrint
|
||||
|
||||
TEST(DrmBufferObject, givenDrmWhenBindOperationFailsThenFenceValueNotGrow) {
|
||||
auto executionEnvironment = new ExecutionEnvironment;
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -607,7 +607,7 @@ TEST(DrmBufferObject, givenDrmWhenBindOperationFailsThenFenceValueNotGrow) {
|
||||
|
||||
TEST(DrmBufferObject, givenDrmWhenBindOperationSucceedsThenFenceValueGrow) {
|
||||
auto executionEnvironment = new ExecutionEnvironment;
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -639,7 +639,7 @@ TEST(DrmBufferObject, givenDrmWhenBindOperationSucceedsThenFenceValueGrow) {
|
||||
|
||||
TEST(DrmBufferObject, givenDrmWhenUnBindOperationFailsThenFenceValueNotGrow) {
|
||||
auto executionEnvironment = new ExecutionEnvironment;
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -671,7 +671,7 @@ TEST(DrmBufferObject, givenDrmWhenUnBindOperationFailsThenFenceValueNotGrow) {
|
||||
|
||||
TEST(DrmBufferObject, givenDrmWhenUnBindOperationSucceedsThenFenceValueGrow) {
|
||||
auto executionEnvironment = new ExecutionEnvironment;
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
|
||||
@@ -195,7 +195,7 @@ TEST_F(DrmDebugPrelimTest, GivenDrmWhenRegisteringElfResourceWithoutDataThenRegi
|
||||
|
||||
TEST(DrmPrelimTest, givenContextDebugAvailableWhenCheckedForSupportThenTrueIsReturned) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -219,7 +219,7 @@ TEST(DrmPrelimTest, givenContextDebugAvailableWhenCheckedForSupportThenTrueIsRet
|
||||
|
||||
TEST(DrmPrelimTest, givenContextDebugNotAvailableWhenCheckedForSupportThenTrueIsReturned) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -315,7 +315,7 @@ HWTEST_F(DrmDebugPrelimTest, givenAddedBindExtHandlesInBoWhenUnbindingThenExtens
|
||||
|
||||
TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWhenCreatingContextThenDebugFlagSipParamIsSet) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -337,7 +337,7 @@ TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWh
|
||||
|
||||
TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWhenCreatingContextThenContextRunaloneIsSetOnlyIfCCSEnginesArePresent) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
|
||||
@@ -507,7 +507,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest,
|
||||
|
||||
mock->chunkingMode = 0x01;
|
||||
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::online);
|
||||
|
||||
AllocationProperties gpuProperties{0u,
|
||||
mock->minimalChunkingSize * 2,
|
||||
|
||||
@@ -5781,7 +5781,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::Offline);
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::offline);
|
||||
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
|
||||
@@ -312,7 +312,7 @@ TEST(DrmBufferObjectTestPrelim, givenDebuggingEnabledWithoutDisableScratchPagesF
|
||||
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
uint32_t vmId = 0;
|
||||
drm.createDrmVirtualMemory(vmId);
|
||||
@@ -327,7 +327,7 @@ TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesAndDebuggingEnabledWhenC
|
||||
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
uint32_t vmId = 0;
|
||||
drm.createDrmVirtualMemory(vmId);
|
||||
|
||||
@@ -673,7 +673,7 @@ TEST(DrmTest, givenDrmWhenCreatingOsContextThenCreateDrmContextWithVmId) {
|
||||
TEST(DrmTest, givenDrmWithPerContextVMRequiredWhenCreatingOsContextsThenImplicitVmIdPerContextIsUsed) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
DrmMock drmMock(rootEnv);
|
||||
EXPECT_TRUE(drmMock.requirePerContextVM);
|
||||
@@ -688,7 +688,7 @@ TEST(DrmTest, givenDrmWithPerContextVMRequiredWhenCreatingOsContextsThenImplicit
|
||||
TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsThenExplicitVmIsCreated) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
DrmMock drmMock(rootEnv);
|
||||
EXPECT_TRUE(drmMock.requirePerContextVM);
|
||||
@@ -730,7 +730,7 @@ TEST(DrmTest, givenPerContextVMRequiredWhenVmIdCreationFailsThenContextInitializ
|
||||
TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextForSubDeviceThenVmIdPerContextIsCreateddAndStoredAtSubDeviceIndex) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
DrmMock drmMock(rootEnv);
|
||||
EXPECT_TRUE(drmMock.requirePerContextVM);
|
||||
@@ -754,7 +754,7 @@ TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextForSubDeviceThenVmId
|
||||
TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsForRootDeviceThenVmIdsPerContextAreCreatedAndStoredAtSubDeviceIndices) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
DrmMock drmMock(rootEnv);
|
||||
EXPECT_TRUE(drmMock.requirePerContextVM);
|
||||
@@ -795,7 +795,7 @@ TEST(DrmTest, givenNoPerContextVmsDrmWhenCreatingOsContextsThenVmIdIsNotQueriedA
|
||||
|
||||
TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextThenSetContextDebugFlagIsCalled) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -815,7 +815,7 @@ TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextTh
|
||||
|
||||
TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextForInternalEngineThenSetContextDebugFlagIsNotCalled) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -851,7 +851,7 @@ TEST(DrmTest, givenNotEnabledDebuggingOrContextDebugUnsupportedWhenCreatingConte
|
||||
|
||||
EXPECT_FALSE(drmMock.capturedCooperativeContextRequest);
|
||||
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
drmMock.contextDebugSupported = false;
|
||||
drmMock.callBaseCreateDrmContext = false;
|
||||
drmMock.capturedCooperativeContextRequest = true;
|
||||
@@ -929,7 +929,7 @@ TEST(DrmTest, givenPrintIoctlDebugFlagSetWhenGettingOATimestampFrequencyThenCapt
|
||||
|
||||
TEST(DrmTest, givenProgramDebuggingWhenCreatingContextThenUnrecoverableContextIsSet) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
|
||||
@@ -779,7 +779,7 @@ TEST_F(IoctlHelperPrelimFixture, whenCreateDrmContextIsCalledThenIoctlIsCalledOn
|
||||
}
|
||||
|
||||
TEST_F(IoctlHelperPrelimFixture, givenProgramDebuggingAndContextDebugSupportedWhenCreatingContextThenCooperativeFlagIsPassedToCreateDrmContextOnlyIfCCSEnginesArePresent) {
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
drm->contextDebugSupported = true;
|
||||
drm->callBaseCreateDrmContext = false;
|
||||
|
||||
@@ -802,7 +802,7 @@ TEST_F(IoctlHelperPrelimFixture, givenProgramDebuggingAndContextDebugSupportedWh
|
||||
}
|
||||
|
||||
TEST_F(IoctlHelperPrelimFixture, givenProgramDebuggingModeAndContextDebugSupportedAndRegularEngineUsageWhenCreatingContextThenCooperativeFlagIsNotPassedInOfflineDebuggingMode) {
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
drm->contextDebugSupported = true;
|
||||
drm->callBaseCreateDrmContext = false;
|
||||
|
||||
@@ -817,7 +817,7 @@ TEST_F(IoctlHelperPrelimFixture, givenProgramDebuggingModeAndContextDebugSupport
|
||||
EXPECT_FALSE(drm->capturedCooperativeContextRequest);
|
||||
}
|
||||
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Offline);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::offline);
|
||||
|
||||
OsContextLinux osContext2(*drm, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::regular}));
|
||||
osContext2.ensureContextInitialized();
|
||||
@@ -834,7 +834,7 @@ TEST_F(IoctlHelperPrelimFixture, givenProgramDebuggingModeAndContextDebugSupport
|
||||
|
||||
TEST(IoctlHelperPrelimTest, givenProgramDebuggingAndContextDebugSupportedWhenInitializingContextThenVmIsCreatedWithAllNecessaryFlags) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
|
||||
auto drm = std::make_unique<DrmPrelimMock>(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
drm->ioctlHelper = std::make_unique<IoctlHelperPrelim20>(*drm);
|
||||
|
||||
@@ -117,7 +117,7 @@ TEST_F(WddmMemoryManagerTests, GivenAllocDataWithSVMCPUSetWhenAllocateGraphicsMe
|
||||
allocData.allocationMethod = memoryManager->getPreferredAllocationMethod(allocationProperties);
|
||||
memoryManager->allocateGraphicsMemoryWithAlignment(allocData);
|
||||
|
||||
if (allocData.allocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) {
|
||||
if (allocData.allocationMethod == GfxMemoryAllocationMethod::allocateByKmd) {
|
||||
EXPECT_TRUE(memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVACalled);
|
||||
} else {
|
||||
EXPECT_TRUE(memoryManager->allocateSystemMemoryAndCreateGraphicsAllocationFromItCalled);
|
||||
@@ -312,7 +312,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMa
|
||||
allocData.allocationMethod = memoryManager->getPreferredAllocationMethod(allocationProperties);
|
||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false);
|
||||
|
||||
if (allocData.allocationMethod == GfxMemoryAllocationMethod::AllocateByKmd && is64bit) {
|
||||
if (allocData.allocationMethod == GfxMemoryAllocationMethod::allocateByKmd && is64bit) {
|
||||
EXPECT_FALSE(memoryManager->mapGpuVirtualAddressWithCpuPtr);
|
||||
} else {
|
||||
EXPECT_TRUE(memoryManager->mapGpuVirtualAddressWithCpuPtr);
|
||||
@@ -592,7 +592,7 @@ TEST_F(WddmMemoryManagerTests, givenForcePreferredAllocationMethodFlagSetWhenGet
|
||||
}
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
for (const auto &allocationMethod : {GfxMemoryAllocationMethod::UseUmdSystemPtr, GfxMemoryAllocationMethod::AllocateByKmd}) {
|
||||
for (const auto &allocationMethod : {GfxMemoryAllocationMethod::useUmdSystemPtr, GfxMemoryAllocationMethod::allocateByKmd}) {
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(allocationMethod));
|
||||
EXPECT_EQ(allocationMethod, memoryManager->getPreferredAllocationMethod(allocationProperties));
|
||||
}
|
||||
@@ -715,7 +715,7 @@ class WddmMemoryManagerSimpleTest : public ::testing::Test {
|
||||
|
||||
TEST_F(WddmMemoryManagerSimpleTest, givenAllocateGraphicsMemoryWithPropertiesCalledWithDebugSurfaceTypeThenDebugSurfaceIsCreatedAndZerod) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, AllocationType::debugContextSaveArea, false, false, 0b1011};
|
||||
auto debugSurface = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties));
|
||||
EXPECT_NE(nullptr, debugSurface);
|
||||
@@ -729,7 +729,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenAllocateGraphicsMemoryWithPropertiesCal
|
||||
|
||||
TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhenAllocateGraphicsMemoryIsCalledThenMemoryPoolIsSystem4KBPages) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
memoryManager.reset(new MockWddmMemoryManager(false, false, executionEnvironment));
|
||||
if (memoryManager->isLimitedGPU(0)) {
|
||||
GTEST_SKIP();
|
||||
@@ -829,7 +829,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenAllocationDataWithStorageInfoWhenAlloca
|
||||
|
||||
TEST_F(WddmMemoryManagerSimpleTest, givenAllocationDataWithFlagsWhenAllocateGraphicsMemory64kbThenAllocationFlagFlushL3RequiredIsSetCorrectly) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
class MockGraphicsAllocation : public GraphicsAllocation {
|
||||
public:
|
||||
using GraphicsAllocation::allocationInfo;
|
||||
@@ -876,7 +876,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhenAllocate32BitGraphicsM
|
||||
|
||||
TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWith64KBPagesDisabledWhenAllocateGraphicsMemoryForSVMThen4KBGraphicsAllocationIsReturned) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
memoryManager.reset(new MockWddmMemoryManager(false, false, executionEnvironment));
|
||||
if (memoryManager->isLimitedGPU(0)) {
|
||||
GTEST_SKIP();
|
||||
@@ -1260,7 +1260,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenAllocationCreatedFromSharedHandleIsDestr
|
||||
}
|
||||
TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingLockedAllocationThatDoesntNeedMakeResidentBeforeLockThenDontEvictAllocationFromWddmTemporaryResources) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}));
|
||||
memoryManager->lockResource(allocation);
|
||||
EXPECT_FALSE(allocation->needsMakeResidentBeforeLock);
|
||||
@@ -1269,7 +1269,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingLockedAllocationThatDoesntNeed
|
||||
}
|
||||
TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingNotLockedAllocationThatDoesntNeedMakeResidentBeforeLockThenDontEvictAllocationFromWddmTemporaryResources) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}));
|
||||
EXPECT_FALSE(allocation->isLocked());
|
||||
EXPECT_FALSE(allocation->needsMakeResidentBeforeLock);
|
||||
@@ -1278,7 +1278,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingNotLockedAllocationThatDoesntN
|
||||
}
|
||||
TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingLockedAllocationThatNeedsMakeResidentBeforeLockThenRemoveTemporaryResource) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}));
|
||||
allocation->needsMakeResidentBeforeLock = true;
|
||||
memoryManager->lockResource(allocation);
|
||||
@@ -1287,7 +1287,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingLockedAllocationThatNeedsMakeR
|
||||
}
|
||||
TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingNotLockedAllocationThatNeedsMakeResidentBeforeLockThenDontEvictAllocationFromWddmTemporaryResources) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}));
|
||||
allocation->needsMakeResidentBeforeLock = true;
|
||||
EXPECT_FALSE(allocation->isLocked());
|
||||
@@ -1296,7 +1296,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingNotLockedAllocationThatNeedsMa
|
||||
}
|
||||
TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingAllocationWithReservedGpuVirtualAddressThenReleaseTheAddress) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}));
|
||||
uint64_t gpuAddress = 0x123;
|
||||
uint64_t sizeForFree = 0x1234;
|
||||
@@ -1719,7 +1719,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenAlignmentRequirementExceedsPageSizeThenA
|
||||
allocData.size = 1024;
|
||||
allocData.alignment = MemoryConstants::pageSize;
|
||||
memoryManager.allocateGraphicsMemoryWithAlignment(allocData);
|
||||
if (allocData.allocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) {
|
||||
if (allocData.allocationMethod == GfxMemoryAllocationMethod::allocateByKmd) {
|
||||
EXPECT_EQ(0, memoryManager.callCount.allocateSystemMemoryAndCreateGraphicsAllocationFromIt);
|
||||
EXPECT_EQ(1, memoryManager.callCount.allocateGraphicsMemoryUsingKmdAndMapItToCpuVA);
|
||||
} else {
|
||||
@@ -2304,7 +2304,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenLocalMemoryAllocationAndRequestedSizeIs
|
||||
|
||||
HWTEST_F(WddmMemoryManagerSimpleTest, givenWddmMemoryManagerWhenCopyDebugSurfaceToMultiTileAllocationThenCallCopyMemoryToAllocation) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
size_t sourceAllocationSize = MemoryConstants::pageSize;
|
||||
|
||||
std::vector<uint8_t> dataToCopy(sourceAllocationSize, 1u);
|
||||
@@ -3138,7 +3138,7 @@ TEST_F(WddmMemoryManagerTest, givenNullPtrAndSizePassedToCreateInternalAllocatio
|
||||
GTEST_SKIP();
|
||||
}
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
auto wddmAllocation = static_cast<WddmAllocation *>(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, nullptr, AllocationType::internalHeap));
|
||||
ASSERT_NE(nullptr, wddmAllocation);
|
||||
auto gmmHelper = memoryManager->getGmmHelper(wddmAllocation->getRootDeviceIndex());
|
||||
@@ -3162,7 +3162,7 @@ TEST_F(WddmMemoryManagerTest, givenPtrAndSizePassedToCreateInternalAllocationWhe
|
||||
GTEST_SKIP();
|
||||
}
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
auto ptr = reinterpret_cast<void *>(0x1000000);
|
||||
auto wddmAllocation = static_cast<WddmAllocation *>(memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, MemoryConstants::pageSize, ptr, AllocationType::internalHeap));
|
||||
ASSERT_NE(nullptr, wddmAllocation);
|
||||
@@ -3480,8 +3480,8 @@ TEST_F(MockWddmMemoryManagerTest, givenAllocateGraphicsMemoryForBufferAndRequest
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenDefaultMemoryManagerWhenItIsCreatedThenCorrectHugeGfxMemoryChunkIsSet) {
|
||||
MockWddmMemoryManager memoryManager(executionEnvironment);
|
||||
EXPECT_EQ(memoryManager.getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod::AllocateByKmd), 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k);
|
||||
EXPECT_EQ(memoryManager.getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod::UseUmdSystemPtr), 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k);
|
||||
EXPECT_EQ(memoryManager.getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod::allocateByKmd), 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k);
|
||||
EXPECT_EQ(memoryManager.getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod::useUmdSystemPtr), 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k);
|
||||
}
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenAllocateGraphicsMemoryForHostBufferAndRequestedSizeIsHugeThenResultAllocationIsSplitted) {
|
||||
@@ -3982,7 +3982,7 @@ TEST(WddmMemoryManagerTest3, givenDefaultWddmMemoryManagerWhenItIsQueriedForInte
|
||||
|
||||
TEST(WddmMemoryManagerTest3, givenUsedTagAllocationInWddmMemoryManagerWhenCleanupMemoryManagerThenDontAccessCsr) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto csr = std::unique_ptr<CommandStreamReceiver>(createCommandStream(executionEnvironment, 0, 1));
|
||||
auto wddm = new WddmMock(*executionEnvironment.rootDeviceEnvironments[0].get());
|
||||
|
||||
@@ -65,7 +65,7 @@ TEST_F(WddmGlobalBindlessAllocatorTests, givenAllocateInFrontWindowPoolFlagWhenW
|
||||
auto gmmHelper = memManager->getGmmHelper(allocData.rootDeviceIndex);
|
||||
EXPECT_EQ(allocation->getGpuBaseAddress(), gmmHelper->canonize(allocation->getGpuAddress()));
|
||||
|
||||
if (allocData.allocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) {
|
||||
if (allocData.allocationMethod == GfxMemoryAllocationMethod::allocateByKmd) {
|
||||
EXPECT_TRUE(allocation->isAllocationLockable());
|
||||
} else {
|
||||
EXPECT_FALSE(allocation->isAllocationLockable());
|
||||
|
||||
@@ -95,7 +95,7 @@ TEST_F(WddmTests, whenftrEuDebugIsFalseThenDebuggingEnabledReturnsFalse) {
|
||||
}
|
||||
|
||||
TEST_F(WddmTests, whenProgramDebugIsEnabledAndCreatingContextWithInternalEngineThenDebuggableContextReturnsFalse) {
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
|
||||
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
|
||||
wddm->init();
|
||||
OsContextWin osContext(*wddm, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::internal}));
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
@@ -137,7 +137,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterPreemptionTests, GivenOfflineModeDebugg
|
||||
builtIns->callBaseGetSipKernel = true;
|
||||
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(builtIns);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->debugger.reset(new MockDebugger);
|
||||
device->executionEnvironment->setDebuggingMode(DebuggingMode::Offline);
|
||||
device->executionEnvironment->setDebuggingMode(DebuggingMode::offline);
|
||||
device->setPreemptionMode(MidThread);
|
||||
|
||||
const uint32_t contextId = 0u;
|
||||
|
||||
@@ -81,7 +81,7 @@ void ReleaseHelperTestsBase::whenCheckPreferredAllocationMethodThenAllocateByKmd
|
||||
EXPECT_FALSE(preferredAllocationMethod.has_value());
|
||||
} else {
|
||||
EXPECT_TRUE(preferredAllocationMethod.has_value());
|
||||
EXPECT_EQ(GfxMemoryAllocationMethod::AllocateByKmd, preferredAllocationMethod.value());
|
||||
EXPECT_EQ(GfxMemoryAllocationMethod::allocateByKmd, preferredAllocationMethod.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ using Dg2WddmTest = ::testing::Test;
|
||||
|
||||
DG2TEST_F(Dg2WddmTest, givenG10A0WhenGettingLocalMemoryAccessModeThenCorrectValueIsReturned) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::UseUmdSystemPtr));
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
RootDeviceEnvironment *rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[0].get();
|
||||
rootDeviceEnvironment->initGmm();
|
||||
|
||||
Reference in New Issue
Block a user