mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
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:
committed by
Compute-Runtime-Automation
parent
124e755b9d
commit
d8d7419aee
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user