@@ -41,6 +41,15 @@ using namespace NEO;
4141
4242using AubCommandStreamReceiverTests = Test<AubCommandStreamReceiverFixture>;
4343
44+ struct FlatBatchBufferHelperAubTests : AubCommandStreamReceiverTests {
45+ void SetUp () override {
46+ DebugManager.flags .FlattenBatchBufferForAUBDump .set (true );
47+ AubCommandStreamReceiverTests::SetUp ();
48+ }
49+
50+ DebugManagerStateRestore restore;
51+ };
52+
4453HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedBatchBufferFlatteningInImmediateDispatchModeThenNewCombinedBatchBufferIsCreated) {
4554 std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr (new AUBCommandStreamReceiverHw<FamilyType>(" " , true , *pDevice->executionEnvironment , pDevice->getRootDeviceIndex (), pDevice->getDeviceBitfield ()));
4655 std::unique_ptr<MemoryManager> memoryManager (new OsAgnosticMemoryManager (*pDevice->executionEnvironment ));
@@ -122,7 +131,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedB
122131 memoryManager->freeGraphicsMemory (otherAllocation);
123132}
124133
125- HWTEST_F (AubCommandStreamReceiverTests , givenAubCommandStreamReceiverWhenRegisterCommandChunkIsCalledThenNewChunkIsAddedToTheList) {
134+ HWTEST_F (FlatBatchBufferHelperAubTests , givenAubCommandStreamReceiverWhenRegisterCommandChunkIsCalledThenNewChunkIsAddedToTheList) {
126135 typedef typename FamilyType::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
127136
128137 auto aubExecutionEnvironment = getEnvironment<AUBCommandStreamReceiverHw<FamilyType>>(false , true , true );
@@ -143,7 +152,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenRegiste
143152 EXPECT_EQ (0x123u , aubCsr->getFlatBatchBufferHelper ().getCommandChunkList ()[1 ].endOffset );
144153}
145154
146- HWTEST_F (AubCommandStreamReceiverTests , givenAubCommandStreamReceiverWhenRemovePatchInfoDataIsCalledThenElementIsRemovedFromPatchInfoList) {
155+ HWTEST_F (FlatBatchBufferHelperAubTests , givenAubCommandStreamReceiverWhenRemovePatchInfoDataIsCalledThenElementIsRemovedFromPatchInfoList) {
147156 auto aubExecutionEnvironment = getEnvironment<AUBCommandStreamReceiverHw<FamilyType>>(false , true , true );
148157 auto aubCsr = aubExecutionEnvironment->template getCsr <AUBCommandStreamReceiverHw<FamilyType>>();
149158
@@ -158,8 +167,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenRemoveP
158167 EXPECT_EQ (0u , aubCsr->getFlatBatchBufferHelper ().getPatchInfoCollection ().size ());
159168}
160169
161- HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAddGucStartMessageIsCalledThenBatchBufferAddressIsStoredInPatchInfoCollection) {
162- DebugManagerStateRestore dbgRestore;
170+ HWTEST_F (FlatBatchBufferHelperAubTests, givenAubCommandStreamReceiverWhenAddGucStartMessageIsCalledThenBatchBufferAddressIsStoredInPatchInfoCollection) {
163171 DebugManager.flags .AddPatchInfoCommentsForAUBDump .set (true );
164172
165173 auto aubExecutionEnvironment = getEnvironment<AUBCommandStreamReceiverHw<FamilyType>>(false , false , true );
@@ -175,9 +183,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAddGucS
175183 EXPECT_EQ (patchInfoCollection[0 ].targetType , PatchInfoAllocationType::GUCStartMessage);
176184}
177185
178- HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedBatchBufferFlatteningInBatchedDispatchModeThenNewCombinedBatchBufferIsCreated) {
179- DebugManagerStateRestore dbgRestore;
180- DebugManager.flags .FlattenBatchBufferForAUBDump .set (true );
186+ HWTEST_F (FlatBatchBufferHelperAubTests, givenAubCommandStreamReceiverWhenForcedBatchBufferFlatteningInBatchedDispatchModeThenNewCombinedBatchBufferIsCreated) {
181187 DebugManager.flags .AddPatchInfoCommentsForAUBDump .set (true );
182188 DebugManager.flags .CsrDispatchMode .set (static_cast <uint32_t >(DispatchMode::BatchedDispatch));
183189
@@ -433,7 +439,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAddPatc
433439 aubCsr->flush (batchBuffer, allocationsForResidency);
434440}
435441
436- HWTEST_F (AubCommandStreamReceiverTests , givenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledForEmptyPatchInfoListThenIndirectPatchCommandBufferIsNotCreated) {
442+ HWTEST_F (FlatBatchBufferHelperAubTests , givenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledForEmptyPatchInfoListThenIndirectPatchCommandBufferIsNotCreated) {
437443 auto aubExecutionEnvironment = getEnvironment<AUBCommandStreamReceiverHw<FamilyType>>(false , false , true );
438444 auto aubCsr = aubExecutionEnvironment->template getCsr <AUBCommandStreamReceiverHw<FamilyType>>();
439445
@@ -445,7 +451,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetIndi
445451 EXPECT_EQ (0u , indirectPatchInfo.size ());
446452}
447453
448- HWTEST_F (AubCommandStreamReceiverTests , givenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledForNonEmptyPatchInfoListThenIndirectPatchCommandBufferIsCreated) {
454+ HWTEST_F (FlatBatchBufferHelperAubTests , givenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledForNonEmptyPatchInfoListThenIndirectPatchCommandBufferIsCreated) {
449455 typedef typename FamilyType::MI_STORE_DATA_IMM MI_STORE_DATA_IMM;
450456 std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr (new AUBCommandStreamReceiverHw<FamilyType>(" " , true , *pDevice->executionEnvironment , pDevice->getRootDeviceIndex (), pDevice->getDeviceBitfield ()));
451457
@@ -467,7 +473,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGetIndi
467473 EXPECT_EQ (2u * sizeof (MI_STORE_DATA_IMM), indirectPatchCommandsSize);
468474}
469475
470- HWTEST_F (AubCommandStreamReceiverTests , GivenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledFor64BitAddressingModeThenDwordLengthAndStoreQwordAreSetCorrectly) {
476+ HWTEST_F (FlatBatchBufferHelperAubTests , GivenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledFor64BitAddressingModeThenDwordLengthAndStoreQwordAreSetCorrectly) {
471477 using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM;
472478 std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr (new AUBCommandStreamReceiverHw<FamilyType>(" " , true , *pDevice->executionEnvironment , pDevice->getRootDeviceIndex (), pDevice->getDeviceBitfield ()));
473479
@@ -486,7 +492,7 @@ HWTEST_F(AubCommandStreamReceiverTests, GivenAubCommandStreamReceiverWhenGetIndi
486492 EXPECT_EQ (MI_STORE_DATA_IMM::DWORD_LENGTH::DWORD_LENGTH_STORE_QWORD, cmd->getDwordLength ());
487493}
488494
489- HWTEST_F (AubCommandStreamReceiverTests , GivenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledFor32BitAddressingModeThenDwordLengthAndSetStoreDwordAreSetCorrectly) {
495+ HWTEST_F (FlatBatchBufferHelperAubTests , GivenAubCommandStreamReceiverWhenGetIndirectPatchCommandsIsCalledFor32BitAddressingModeThenDwordLengthAndSetStoreDwordAreSetCorrectly) {
490496 using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM;
491497 std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr (new AUBCommandStreamReceiverHw<FamilyType>(" " , true , *pDevice->executionEnvironment , pDevice->getRootDeviceIndex (), pDevice->getDeviceBitfield ()));
492498
@@ -505,10 +511,8 @@ HWTEST_F(AubCommandStreamReceiverTests, GivenAubCommandStreamReceiverWhenGetIndi
505511 EXPECT_EQ (MI_STORE_DATA_IMM::DWORD_LENGTH::DWORD_LENGTH_STORE_DWORD, cmd->getDwordLength ());
506512}
507513
508- HWTEST_F (AubCommandStreamReceiverTests , givenAubCommandStreamReceiverWhenAddBatchBufferStartCalledAndBatchBUfferFlatteningEnabledThenBatchBufferStartAddressIsRegistered) {
514+ HWTEST_F (FlatBatchBufferHelperAubTests , givenAubCommandStreamReceiverWhenAddBatchBufferStartCalledAndBatchBUfferFlatteningEnabledThenBatchBufferStartAddressIsRegistered) {
509515 typedef typename FamilyType::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
510- DebugManagerStateRestore dbgRestore;
511- DebugManager.flags .FlattenBatchBufferForAUBDump .set (true );
512516
513517 std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr (new AUBCommandStreamReceiverHw<FamilyType>(" " , true , *pDevice->executionEnvironment , pDevice->getRootDeviceIndex (), pDevice->getDeviceBitfield ()));
514518
0 commit comments