feature: Append recorded commandlist into immediate (8/N)

Add primary dispatch capability for immediate command list

Related-To: NEO-10356

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
This commit is contained in:
Aravind Gopalakrishnan
2024-12-18 19:24:29 +00:00
committed by Compute-Runtime-Automation
parent 124e755b9d
commit d8d7419aee
14 changed files with 283 additions and 94 deletions

View File

@@ -98,6 +98,25 @@ TEST_F(CommandContainerHeapStateTests, givenDirtyHeapsWhenSettingStateForSingleH
}
}
using CommandContainerSwapStreamTest = Test<CommandContainerFixture>;
TEST_F(CommandContainerSwapStreamTest, givenCommandContainerInitializedWithSecondaryCmdBufferAndForceSwapStreamsReturnsFalseThenCallIsUnsuccessful) {
class MyMockCommandContainer : public CommandContainer {
public:
bool swapStreams() override {
swapStreamsCalled++;
return forceSwapAction;
}
uint32_t swapStreamsCalled = 0u;
bool forceSwapAction = false;
};
MyMockCommandContainer cmdContainer;
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true);
EXPECT_FALSE(cmdContainer.swapStreams());
}
TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorrectAllocationTypeIsSet) {
CommandContainer cmdContainer;
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
@@ -126,6 +145,22 @@ TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializ
EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), cmdStream);
}
TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializeThenCreateAdditionalLinearStreamAndReturnAccordingly) {
MyMockCommandContainer cmdContainer;
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true);
EXPECT_NE(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), nullptr);
auto secondaryCmdStream = cmdContainer.secondaryCommandStreamForImmediateCmdList.get();
auto cmdStream = cmdContainer.getCommandStream();
EXPECT_TRUE(cmdContainer.swapStreams());
EXPECT_TRUE(cmdContainer.usingSecondaryCmdbufInHostMem());
EXPECT_EQ(cmdContainer.getCommandStream(), secondaryCmdStream);
EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), cmdStream);
}
TEST_F(CommandContainerTest, whenInitializeThenNotCreateAdditionalLinearStream) {
MyMockCommandContainer cmdContainer;
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);