mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
fix: state cache invalidation WA for xe3
Related-To: NEO-16281, NEO-16405 Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
efc7bcba4b
commit
ebdf993a25
@@ -573,7 +573,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
kernelWithAssertAppended = true;
|
||||
}
|
||||
|
||||
if (kernelImp->usesRayTracing()) {
|
||||
if (neoDevice->getReleaseHelper()->isStateCacheInvalidationWaRequired() || kernelImp->usesRayTracing()) {
|
||||
NEO::PipeControlArgs args{};
|
||||
args.stateCacheInvalidationEnable = true;
|
||||
NEO::MemorySynchronizationCommands<GfxFamily>::addSingleBarrier(*commandContainer.getCommandStream(), args);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "shared/source/helpers/definitions/command_encoder_args.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/indirect_heap/indirect_heap.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/mocks/mock_command_encoder.h"
|
||||
@@ -889,6 +890,9 @@ HWTEST_F(HostPointerManagerCommandListTest, givenCommandListWhenMemoryFillWithSi
|
||||
if (!l3FlushAfterPostSupported && NEO::MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment())) {
|
||||
EXPECT_NE(nullptr, pc);
|
||||
EXPECT_TRUE(pc->getDcFlushEnable());
|
||||
} else if (device->getNEODevice()->getReleaseHelper()->isStateCacheInvalidationWaRequired()) {
|
||||
EXPECT_NE(nullptr, pc);
|
||||
EXPECT_TRUE(pc->getStateCacheInvalidationEnable());
|
||||
} else {
|
||||
EXPECT_EQ(nullptr, pc);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/helpers/state_base_address_helper.h"
|
||||
#include "shared/source/indirect_heap/indirect_heap.h"
|
||||
#include "shared/source/kernel/implicit_args_helper.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/libult/ult_command_stream_receiver.h"
|
||||
@@ -3428,7 +3429,12 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
|
||||
NEO::EncodeMemoryPrefetch<FamilyType>::getSizeForMemoryPrefetch(kernel->getImmutableData()->getIsaSize(), device->getNEODevice()->getRootDeviceEnvironment());
|
||||
}
|
||||
|
||||
EXPECT_EQ(usedBefore + prefetchSize, cmdListStream.getUsed());
|
||||
size_t barrierSize = 0;
|
||||
if (neoDevice->getReleaseHelper()->isStateCacheInvalidationWaRequired()) {
|
||||
barrierSize += MemorySynchronizationCommands<FamilyType>::getSizeForSingleBarrier();
|
||||
}
|
||||
|
||||
EXPECT_EQ(usedBefore + prefetchSize + barrierSize, cmdListStream.getUsed());
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
|
||||
@@ -1780,5 +1780,52 @@ HWTEST2_F(CommandListAppendLaunchKernelMockModule,
|
||||
EXPECT_NE(eventAllocationIt, cmdlistResidency.end());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelMockModule,
|
||||
givenStateCacheInvalidationWaIsRequiredWhenTwoKernelsAreAppendedThenPipeControlWithStateCacheInvalidationIsInsertedBetweenWalkers, IsAtLeastXeCore) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using COMPUTE_WALKER = typename FamilyType::DefaultWalkerType;
|
||||
|
||||
ze_group_count_t groupCount{1, 1, 1};
|
||||
ze_result_t returnValue;
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
|
||||
auto usedSpaceBefore = commandList->getCmdContainer().getCommandStream()->getUsed();
|
||||
|
||||
returnValue = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
|
||||
|
||||
returnValue = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
|
||||
|
||||
auto usedSpaceAfter = commandList->getCmdContainer().getCommandStream()->getUsed();
|
||||
EXPECT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
|
||||
cmdList,
|
||||
ptrOffset(commandList->getCmdContainer().getCommandStream()->getCpuBase(), usedSpaceBefore),
|
||||
usedSpaceAfter - usedSpaceBefore));
|
||||
|
||||
auto walkers = findAll<COMPUTE_WALKER *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_EQ(2u, walkers.size());
|
||||
|
||||
auto itorPC = findAll<PIPE_CONTROL *>(walkers[0], walkers[1]);
|
||||
|
||||
bool foundStateCacheInvalidation = false;
|
||||
for (auto it : itorPC) {
|
||||
auto pcCmd = genCmdCast<PIPE_CONTROL *>(*it);
|
||||
if (pcCmd->getStateCacheInvalidationEnable()) {
|
||||
foundStateCacheInvalidation = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (device->getNEODevice()->getReleaseHelper()->isStateCacheInvalidationWaRequired()) {
|
||||
EXPECT_TRUE(foundStateCacheInvalidation);
|
||||
} else {
|
||||
EXPECT_FALSE(foundStateCacheInvalidation);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
||||
|
||||
@@ -4264,16 +4264,25 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, InOrderCmdListTests, givenInOrderModeWhenProgrammin
|
||||
|
||||
ASSERT_NE(cmdList.end(), walkerItor);
|
||||
|
||||
auto pcItor = find<PIPE_CONTROL *>(walkerItor, cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), pcItor);
|
||||
auto pcItors = findAll<PIPE_CONTROL *>(walkerItor, cmdList.end());
|
||||
EXPECT_FALSE(pcItors.empty());
|
||||
|
||||
auto pcCmd = genCmdCast<PIPE_CONTROL *>(*pcItor);
|
||||
ASSERT_NE(nullptr, pcCmd);
|
||||
EXPECT_EQ(immCmdList->getDcFlushRequired(true), pcCmd->getDcFlushEnable());
|
||||
EXPECT_TRUE(UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pcCmd));
|
||||
EXPECT_TRUE(pcCmd->getUnTypedDataPortCacheFlush());
|
||||
bool foundMatchingPipeControl = false;
|
||||
for (auto pcItor : pcItors) {
|
||||
auto pcCmd = genCmdCast<PIPE_CONTROL *>(*pcItor);
|
||||
ASSERT_NE(nullptr, pcCmd);
|
||||
|
||||
auto sdiItor = find<MI_STORE_DATA_IMM *>(pcItor, cmdList.end());
|
||||
if (pcCmd->getDcFlushEnable() == immCmdList->getDcFlushRequired(true) &&
|
||||
UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pcCmd) &&
|
||||
pcCmd->getUnTypedDataPortCacheFlush()) {
|
||||
foundMatchingPipeControl = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_TRUE(foundMatchingPipeControl);
|
||||
|
||||
auto sdiItor = find<MI_STORE_DATA_IMM *>(walkerItor, cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), sdiItor);
|
||||
|
||||
auto sdiCmd = genCmdCast<MI_STORE_DATA_IMM *>(*sdiItor);
|
||||
@@ -6609,15 +6618,25 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, InOrderCmdListTests, givenInOrderModeWhenProgrammin
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(cmdList, cmdStream->getCpuBase(), cmdStream->getUsed()));
|
||||
|
||||
auto cmdItor = find<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), cmdItor);
|
||||
auto pcItors = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_FALSE(pcItors.empty());
|
||||
auto cmdItor = pcItors[0];
|
||||
|
||||
auto pcCmd = genCmdCast<PIPE_CONTROL *>(*cmdItor);
|
||||
ASSERT_NE(nullptr, pcCmd);
|
||||
bool foundMatchingPipeControl = false;
|
||||
for (auto pcItor : pcItors) {
|
||||
auto pcCmd = genCmdCast<PIPE_CONTROL *>(*pcItor);
|
||||
ASSERT_NE(nullptr, pcCmd);
|
||||
|
||||
EXPECT_EQ(immCmdList->getDcFlushRequired(true), pcCmd->getDcFlushEnable());
|
||||
EXPECT_TRUE(UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pcCmd));
|
||||
EXPECT_TRUE(pcCmd->getUnTypedDataPortCacheFlush());
|
||||
if (pcCmd->getDcFlushEnable() == immCmdList->getDcFlushRequired(true) &&
|
||||
UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pcCmd) &&
|
||||
pcCmd->getUnTypedDataPortCacheFlush()) {
|
||||
foundMatchingPipeControl = true;
|
||||
cmdItor = pcItor;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_TRUE(foundMatchingPipeControl);
|
||||
|
||||
auto sdiCmd = genCmdCast<MI_STORE_DATA_IMM *>(*(++cmdItor));
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/memory_manager/internal_allocation_storage.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/test/common/helpers/relaxed_ordering_commands_helper.h"
|
||||
#include "shared/test/common/libult/ult_command_stream_receiver.h"
|
||||
#include "shared/test/common/mocks/mock_direct_submission_hw.h"
|
||||
@@ -4049,6 +4050,9 @@ HWTEST2_F(MultiTileInOrderCmdListTests, givenMultiTileInOrderModeWhenProgramming
|
||||
auto pcItors = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(pcItors.size(), 0u);
|
||||
auto pcCmd = genCmdCast<PIPE_CONTROL *>(*pcItors.back());
|
||||
if (device->getNEODevice()->getReleaseHelper()->isStateCacheInvalidationWaRequired()) {
|
||||
pcCmd = genCmdCast<PIPE_CONTROL *>(*pcItors.front());
|
||||
}
|
||||
|
||||
uint64_t address = pcCmd->getAddressHigh();
|
||||
address <<= 32;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "shared/source/helpers/engine_node_helper.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/source/utilities/tag_allocator.h"
|
||||
|
||||
#include "opencl/source/command_queue/hardware_interface_base.inl"
|
||||
@@ -39,6 +40,11 @@ inline void HardwareInterface<GfxFamily>::dispatchWorkarounds(
|
||||
CommandQueue &commandQueue,
|
||||
Kernel &kernel,
|
||||
const bool &enable) {
|
||||
if (!enable && commandQueue.getDevice().getReleaseHelper()->isStateCacheInvalidationWaRequired()) {
|
||||
PipeControlArgs args{};
|
||||
args.stateCacheInvalidationEnable = true;
|
||||
MemorySynchronizationCommands<GfxFamily>::addSingleBarrier(*commandStream, args);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "shared/source/helpers/local_work_size.h"
|
||||
#include "shared/source/kernel/implicit_args_helper.h"
|
||||
#include "shared/source/memory_manager/internal_allocation_storage.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/source/utilities/hw_timestamps.h"
|
||||
#include "shared/source/utilities/tag_allocator.h"
|
||||
#include "shared/test/common/cmd_parse/hw_parse.h"
|
||||
@@ -147,6 +148,11 @@ HWTEST_F(DispatchWalkerTest, WhenDispatchingWalkerThenCommandStreamMemoryIsntCha
|
||||
auto sizeDispatchWalkerNeeds = sizeof(typename FamilyType::DefaultWalkerType) +
|
||||
HardwareCommandsHelper<FamilyType>::getSizeRequiredCS();
|
||||
|
||||
auto releaseHelper = pClDevice->getDevice().getReleaseHelper();
|
||||
if (releaseHelper && releaseHelper->isStateCacheInvalidationWaRequired()) {
|
||||
sizeDispatchWalkerNeeds += MemorySynchronizationCommands<FamilyType>::getSizeForSingleBarrier();
|
||||
}
|
||||
|
||||
// cs has a minimum required size
|
||||
auto sizeThatNeedsToBeSubstracted = sizeDispatchWalkerNeeds + CSRequirements::minCommandQueueCommandStreamSize;
|
||||
|
||||
@@ -191,6 +197,11 @@ HWTEST_F(DispatchWalkerTest, GivenNoLocalIdsWhenDispatchingWalkerThenWalkerIsDis
|
||||
auto sizeDispatchWalkerNeeds = sizeof(typename FamilyType::DefaultWalkerType) +
|
||||
HardwareCommandsHelper<FamilyType>::getSizeRequiredCS();
|
||||
|
||||
auto releaseHelper = pClDevice->getDevice().getReleaseHelper();
|
||||
if (releaseHelper && releaseHelper->isStateCacheInvalidationWaRequired()) {
|
||||
sizeDispatchWalkerNeeds += MemorySynchronizationCommands<FamilyType>::getSizeForSingleBarrier();
|
||||
}
|
||||
|
||||
// cs has a minimum required size
|
||||
auto sizeThatNeedsToBeSubstracted = sizeDispatchWalkerNeeds + CSRequirements::minCommandQueueCommandStreamSize;
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue.h"
|
||||
#include "opencl/source/event/event.h"
|
||||
#include "opencl/test/unit_test/fixtures/hello_world_fixture.h"
|
||||
@@ -112,15 +114,17 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, TwoIOQsTwoDependentWalkers, GivenTwoCommandQueues
|
||||
EXPECT_EQ(1u, numCommands);
|
||||
}
|
||||
|
||||
HWTEST_F(TwoIOQsTwoDependentWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenOnePipeControlIsInsertedBetweenWalkers) {
|
||||
HWTEST_F(TwoIOQsTwoDependentWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenAtLeastOnePipeControlIsInsertedBetweenWalkers) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
||||
parseWalkers<FamilyType>();
|
||||
auto itorCmd = find<PIPE_CONTROL *>(itorWalker1, itorWalker2);
|
||||
|
||||
// Should find a PC.
|
||||
auto releaseHelper = pClDevice->getDevice().getReleaseHelper();
|
||||
const bool isStateCacheInvalidationWaRequired = releaseHelper && releaseHelper->isStateCacheInvalidationWaRequired();
|
||||
const bool isUpdateTagFromWaitEnabled = pCmdQ2->getGpgpuCommandStreamReceiver().isUpdateTagFromWaitEnabled();
|
||||
|
||||
if (pCmdQ2->getGpgpuCommandStreamReceiver().isUpdateTagFromWaitEnabled()) {
|
||||
if (isUpdateTagFromWaitEnabled && !isStateCacheInvalidationWaRequired) {
|
||||
EXPECT_EQ(itorWalker2, itorCmd);
|
||||
} else {
|
||||
EXPECT_NE(itorWalker2, itorCmd);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/libult/ult_command_stream_receiver.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
@@ -35,7 +36,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, IOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnque
|
||||
EXPECT_EQ(1u, numCommands);
|
||||
}
|
||||
|
||||
HWTEST_F(IOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenOnePipeControlIsInsertedBetweenWalkers) {
|
||||
HWTEST_F(IOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenAtLeastOnePipeControlIsInsertedBetweenWalkers) {
|
||||
|
||||
DebugManagerStateRestore restorer{};
|
||||
debugManager.flags.EnableL3FlushAfterPostSync.set(0);
|
||||
@@ -47,7 +48,8 @@ HWTEST_F(IOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenOnePipeC
|
||||
|
||||
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
|
||||
|
||||
auto waNeeded = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(pDevice->getRootDeviceEnvironment());
|
||||
auto releaseHelper = pClDevice->getDevice().getReleaseHelper();
|
||||
auto waNeeded = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(pDevice->getRootDeviceEnvironment()) || (releaseHelper && releaseHelper->isStateCacheInvalidationWaRequired());
|
||||
|
||||
auto itorCmd = find<PIPE_CONTROL *>(itorWalker1, itorWalker2);
|
||||
ASSERT_NE(itorWalker2, itorCmd);
|
||||
@@ -69,3 +71,31 @@ HWTEST_F(IOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenOnePipeC
|
||||
EXPECT_EQ(commandStreamReceiver.getTagAllocation()->getGpuAddress(), NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
|
||||
EXPECT_EQ(commandStreamReceiver.heaplessStateInitialized ? 2u : 1u, pipeControl->getImmediateData());
|
||||
}
|
||||
|
||||
HWTEST_F(IOQWithTwoWalkers, GivenStateCacheInvalidationWaIsRequiredWhenTwoKernelsAreEnqueuedThenPipeControlWithStateCacheInvalidationIsInsertedBetweenWalkers) {
|
||||
enqueueTwoKernels<FamilyType>();
|
||||
|
||||
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
|
||||
using COMPUTE_WALKER = typename FamilyType::DefaultWalkerType;
|
||||
|
||||
auto walkers = findAll<COMPUTE_WALKER *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_EQ(2u, walkers.size());
|
||||
|
||||
auto itorPC = findAll<PIPE_CONTROL *>(walkers[0], walkers[1]);
|
||||
|
||||
bool foundStateCacheInvalidation = false;
|
||||
for (auto it : itorPC) {
|
||||
auto pcCmd = genCmdCast<PIPE_CONTROL *>(*it);
|
||||
if (pcCmd->getStateCacheInvalidationEnable()) {
|
||||
foundStateCacheInvalidation = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
auto releaseHelper = pClDevice->getDevice().getReleaseHelper();
|
||||
if (releaseHelper && releaseHelper->isStateCacheInvalidationWaRequired()) {
|
||||
EXPECT_TRUE(foundStateCacheInvalidation);
|
||||
} else {
|
||||
EXPECT_FALSE(foundStateCacheInvalidation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/hello_world_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/two_walker_fixture.h"
|
||||
|
||||
@@ -35,14 +37,16 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, OOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnque
|
||||
EXPECT_EQ(1u, numCommands);
|
||||
}
|
||||
|
||||
HWTEST_F(OOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenOnePipeControlIsInsertedBetweenWalkers) {
|
||||
HWTEST_F(OOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenAtLeastOnePipeControlIsInsertedBetweenWalkers) {
|
||||
enqueueTwoKernels<FamilyType>();
|
||||
|
||||
auto itorCmd = find<typename FamilyType::PIPE_CONTROL *>(itorWalker1, itorWalker2);
|
||||
// Workaround for DRM i915 coherency patch
|
||||
// EXPECT_EQ(itorWalker2, itorCmd);
|
||||
|
||||
if (pCmdQ->getGpgpuCommandStreamReceiver().isUpdateTagFromWaitEnabled()) {
|
||||
auto releaseHelper = pClDevice->getDevice().getReleaseHelper();
|
||||
const bool isStateCacheInvalidationWaRequired = releaseHelper && releaseHelper->isStateCacheInvalidationWaRequired();
|
||||
const bool isUpdateTagFromWaitEnabled = pCmdQ->getGpgpuCommandStreamReceiver().isUpdateTagFromWaitEnabled();
|
||||
|
||||
if (isUpdateTagFromWaitEnabled && !isStateCacheInvalidationWaRequired) {
|
||||
EXPECT_EQ(itorWalker2, itorCmd);
|
||||
} else {
|
||||
EXPECT_NE(itorWalker2, itorCmd);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/helpers/preamble.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/dispatch_flags_helper.h"
|
||||
#include "shared/test/common/helpers/ult_gfx_core_helper.h"
|
||||
@@ -1250,17 +1251,22 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelRequiringDCFlush
|
||||
// Parse command list
|
||||
parseCommands<FamilyType>(commandStreamTask, 0);
|
||||
|
||||
auto itorPC = find<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itorPC);
|
||||
if (UnitTestHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
itorPC++;
|
||||
itorPC = find<PIPE_CONTROL *>(itorPC, cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itorPC);
|
||||
auto pcItors = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_FALSE(pcItors.empty());
|
||||
|
||||
bool foundMatchingPipeControl = false;
|
||||
for (auto pcItor : pcItors) {
|
||||
auto pcCmd = genCmdCast<PIPE_CONTROL *>(*pcItor);
|
||||
ASSERT_NE(nullptr, pcCmd);
|
||||
|
||||
// Verify that the dcFlushEnabled bit is set in PC
|
||||
if (MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, pDevice->getRootDeviceEnvironment()) == pcCmd->getDcFlushEnable()) {
|
||||
foundMatchingPipeControl = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Verify that the dcFlushEnabled bit is set in PC
|
||||
auto pCmdWA = reinterpret_cast<PIPE_CONTROL *>(*itorPC);
|
||||
EXPECT_EQ(MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, pDevice->getRootDeviceEnvironment()), pCmdWA->getDcFlushEnable());
|
||||
EXPECT_TRUE(foundMatchingPipeControl);
|
||||
|
||||
buffer->release();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "shared/source/helpers/state_base_address.h"
|
||||
#include "shared/source/memory_manager/internal_allocation_storage.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/dispatch_flags_helper.h"
|
||||
#include "shared/test/common/helpers/raii_gfx_core_helper.h"
|
||||
@@ -76,7 +77,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelNotRequiringDCFl
|
||||
|
||||
auto itorPC = find<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itorPC);
|
||||
if (UnitTestHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
|
||||
auto releaseHelper = pClDevice->getDevice().getReleaseHelper();
|
||||
if (UnitTestHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo()) || (releaseHelper && releaseHelper->isStateCacheInvalidationWaRequired())) {
|
||||
itorPC++;
|
||||
itorPC = find<PIPE_CONTROL *>(itorPC, cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itorPC);
|
||||
@@ -89,7 +92,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelNotRequiringDCFl
|
||||
buffer->release();
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnableUpdateTaskFromWaitWhenNonBlockingCallIsMadeThenNoPipeControlInsertedOnDevicesWithoutDCFlushRequirements) {
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnableUpdateTaskFromWaitWhenNonBlockingCallIsMadeThenNoPipeControlInsertedOnDevicesWithoutDCFlushAndStateCacheInvalidationWaRequirements) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.UpdateTaskCountFromWait.set(3u);
|
||||
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
|
||||
@@ -112,6 +115,13 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnableUpdateTaskFromWaitWhenN
|
||||
parseCommands<FamilyType>(commandStreamTask, 0);
|
||||
|
||||
auto itorPC = find<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
|
||||
auto releaseHelper = pClDevice->getDevice().getReleaseHelper();
|
||||
if (releaseHelper && releaseHelper->isStateCacheInvalidationWaRequired()) {
|
||||
EXPECT_NE(cmdList.end(), itorPC);
|
||||
itorPC++;
|
||||
itorPC = find<PIPE_CONTROL *>(itorPC, cmdList.end());
|
||||
}
|
||||
EXPECT_EQ(cmdList.end(), itorPC);
|
||||
|
||||
buffer->release();
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/helpers/timestamp_packet.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/source/utilities/tag_allocator.h"
|
||||
#include "shared/source/utilities/wait_util.h"
|
||||
#include "shared/test/common/cmd_parse/hw_parse.h"
|
||||
@@ -434,7 +435,8 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEnqueueingThe
|
||||
auto walker = genCmdCast<WalkerType *>(*it);
|
||||
|
||||
ASSERT_NE(nullptr, walker);
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getRootDeviceEnvironment())) {
|
||||
auto releaseHelper = device->getDevice().getReleaseHelper();
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getRootDeviceEnvironment()) || (releaseHelper && releaseHelper->isStateCacheInvalidationWaRequired())) {
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(*++it);
|
||||
EXPECT_NE(nullptr, pipeControl);
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ class ReleaseHelper {
|
||||
virtual bool shouldQueryPeerAccess() const = 0;
|
||||
virtual bool isSpirSupported() const = 0;
|
||||
virtual bool isSingleDispatchRequiredForMultiCCS() const = 0;
|
||||
virtual bool isStateCacheInvalidationWaRequired() const = 0;
|
||||
|
||||
protected:
|
||||
ReleaseHelper(HardwareIpVersion hardwareIpVersion) : hardwareIpVersion(hardwareIpVersion) {}
|
||||
@@ -119,6 +120,7 @@ class ReleaseHelperHw : public ReleaseHelper {
|
||||
bool shouldQueryPeerAccess() const override;
|
||||
bool isSpirSupported() const override;
|
||||
bool isSingleDispatchRequiredForMultiCCS() const override;
|
||||
bool isStateCacheInvalidationWaRequired() const override;
|
||||
|
||||
protected:
|
||||
ReleaseHelperHw(HardwareIpVersion hardwareIpVersion) : ReleaseHelper(hardwareIpVersion) {}
|
||||
|
||||
@@ -196,4 +196,9 @@ bool ReleaseHelperHw<releaseType>::isSingleDispatchRequiredForMultiCCS() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <ReleaseType releaseType>
|
||||
bool ReleaseHelperHw<releaseType>::isStateCacheInvalidationWaRequired() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
* Copyright (C) 2024-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -33,4 +33,9 @@ const SizeToPreferredSlmValueArray &ReleaseHelperHw<release>::getSizeToPreferred
|
||||
return sizeToPreferredSlmValue;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ReleaseHelperHw<release>::isStateCacheInvalidationWaRequired() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -48,6 +48,7 @@ class MockReleaseHelper : public ReleaseHelper {
|
||||
ADDMETHOD_CONST_NOBASE(shouldQueryPeerAccess, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(isSpirSupported, bool, true, ());
|
||||
ADDMETHOD_CONST_NOBASE(isSingleDispatchRequiredForMultiCCS, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(isStateCacheInvalidationWaRequired, bool, false, ());
|
||||
|
||||
const SizeToPreferredSlmValueArray &getSizeToPreferredSlmValue(bool isHeapless) const override {
|
||||
static SizeToPreferredSlmValueArray sizeToPreferredSlmValue = {};
|
||||
|
||||
@@ -128,4 +128,8 @@ TEST_F(ReleaseHelper1255Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper1255Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1255Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -128,4 +128,8 @@ TEST_F(ReleaseHelper1256Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper1256Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1256Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -128,4 +128,8 @@ TEST_F(ReleaseHelper1257Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper1257Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1257Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -113,4 +113,8 @@ TEST_F(ReleaseHelper1260Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper1260Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1260Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -112,4 +112,8 @@ TEST_F(ReleaseHelper1261Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper1261Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1261Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -122,4 +122,8 @@ TEST_F(ReleaseHelper1270Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper1270Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1270Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -122,4 +122,8 @@ TEST_F(ReleaseHelper1271Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper1271Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1271Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -128,4 +128,8 @@ TEST_F(ReleaseHelper1274Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper1274Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1274Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -121,4 +121,8 @@ TEST_F(ReleaseHelper2001Tests, whenShouldQueryPeerAccessCalledThenTrueReturned)
|
||||
|
||||
TEST_F(ReleaseHelper2001Tests, whenIsSingleDispatchRequiredForMultiCCSThenTrueReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenTrueReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2001Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -121,4 +121,8 @@ TEST_F(ReleaseHelper2002Tests, whenShouldQueryPeerAccessCalledThenTrueReturned)
|
||||
|
||||
TEST_F(ReleaseHelper2002Tests, whenIsSingleDispatchRequiredForMultiCCSThenTrueReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenTrueReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2002Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -124,4 +124,8 @@ TEST_F(ReleaseHelper2004Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper2004Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2004Tests, whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
@@ -122,4 +122,8 @@ TEST_F(ReleaseHelper3000Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper3000Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper3000Tests, whenIsStateCacheInvalidationWaRequiredCalledThenTrueReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
@@ -122,4 +122,8 @@ TEST_F(ReleaseHelper3001Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper3001Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper3001Tests, whenIsStateCacheInvalidationWaRequiredCalledThenTrueReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
@@ -122,4 +122,8 @@ TEST_F(ReleaseHelper3003Tests, whenShouldQueryPeerAccessCalledThenFalseReturned)
|
||||
|
||||
TEST_F(ReleaseHelper3003Tests, whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned) {
|
||||
whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper3003Tests, whenIsStateCacheInvalidationWaRequiredCalledThenTrueReturned) {
|
||||
whenIsStateCacheInvalidationWaRequiredCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
@@ -231,4 +231,22 @@ void ReleaseHelperTestsBase::whenIsSingleDispatchRequiredForMultiCCSCalledThenTr
|
||||
ASSERT_NE(nullptr, releaseHelper);
|
||||
EXPECT_TRUE(releaseHelper->isSingleDispatchRequiredForMultiCCS());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReleaseHelperTestsBase::whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned() {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
releaseHelper = ReleaseHelper::create(ipVersion);
|
||||
ASSERT_NE(nullptr, releaseHelper);
|
||||
EXPECT_FALSE(releaseHelper->isStateCacheInvalidationWaRequired());
|
||||
}
|
||||
}
|
||||
|
||||
void ReleaseHelperTestsBase::whenIsStateCacheInvalidationWaRequiredCalledThenTrueReturned() {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
releaseHelper = ReleaseHelper::create(ipVersion);
|
||||
ASSERT_NE(nullptr, releaseHelper);
|
||||
EXPECT_TRUE(releaseHelper->isStateCacheInvalidationWaRequired());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ struct ReleaseHelperTestsBase : public ::testing::Test {
|
||||
void whenShouldQueryPeerAccessCalledThenTrueReturned();
|
||||
void whenIsSingleDispatchRequiredForMultiCCSCalledThenFalseReturned();
|
||||
void whenIsSingleDispatchRequiredForMultiCCSCalledThenTrueReturned();
|
||||
void whenIsStateCacheInvalidationWaRequiredCalledThenFalseReturned();
|
||||
void whenIsStateCacheInvalidationWaRequiredCalledThenTrueReturned();
|
||||
virtual std::vector<uint32_t> getRevisions() = 0;
|
||||
|
||||
std::unique_ptr<ReleaseHelper> releaseHelper;
|
||||
|
||||
Reference in New Issue
Block a user