Set indirect flags upon command list reset

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz 2021-07-01 12:21:28 +00:00 committed by Compute-Runtime-Automation
parent ebf6c241b4
commit 6c6a9b27f5
3 changed files with 30 additions and 0 deletions

View File

@ -80,6 +80,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::reset() {
indirectAllocationsAllowed = false;
unifiedMemoryControls.indirectHostAllocationsAllowed = false;
unifiedMemoryControls.indirectSharedAllocationsAllowed = false;
unifiedMemoryControls.indirectDeviceAllocationsAllowed = false;
commandListPreemptionMode = device->getDevicePreemptionMode();
commandListPerThreadScratchSize = 0u;
requiredStreamState = {};

View File

@ -47,8 +47,10 @@ struct WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>
using BaseClass::getAllocationFromHostPtrMap;
using BaseClass::getHostPtrAlloc;
using BaseClass::hostPtrMap;
using BaseClass::indirectAllocationsAllowed;
using BaseClass::initialize;
using BaseClass::requiredStreamState;
using BaseClass::unifiedMemoryControls;
using BaseClass::updateStreamProperties;
WhiteBox() : ::L0::CommandListCoreFamily<gfxCoreFamily>(BaseClass::defaultNumIddsPerBlock) {}

View File

@ -804,5 +804,32 @@ HWTEST_F(CommandListCreate, givenAsyncCmdQueueAndCopyOnlyImmediateCommandListWhe
EXPECT_EQ(used, commandContainer.getCommandStream()->getUsed());
}
HWTEST2_F(CommandListCreate, givenIndirectAccessFlagsAreChangedWhenResetingCommandListThenExpectAllFlagsSetToDefault, TestPlatforms) {
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
auto commandList = std::make_unique<::L0::ult::CommandListCoreFamily<gfxCoreFamily>>();
ASSERT_NE(nullptr, commandList);
ze_result_t returnValue = commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
EXPECT_FALSE(commandList->indirectAllocationsAllowed);
EXPECT_FALSE(commandList->unifiedMemoryControls.indirectHostAllocationsAllowed);
EXPECT_FALSE(commandList->unifiedMemoryControls.indirectSharedAllocationsAllowed);
EXPECT_FALSE(commandList->unifiedMemoryControls.indirectDeviceAllocationsAllowed);
commandList->indirectAllocationsAllowed = true;
commandList->unifiedMemoryControls.indirectHostAllocationsAllowed = true;
commandList->unifiedMemoryControls.indirectSharedAllocationsAllowed = true;
commandList->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
returnValue = commandList->reset();
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
EXPECT_FALSE(commandList->indirectAllocationsAllowed);
EXPECT_FALSE(commandList->unifiedMemoryControls.indirectHostAllocationsAllowed);
EXPECT_FALSE(commandList->unifiedMemoryControls.indirectSharedAllocationsAllowed);
EXPECT_FALSE(commandList->unifiedMemoryControls.indirectDeviceAllocationsAllowed);
}
} // namespace ult
} // namespace L0