mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
feature: additional checkers to enable feature
Resolves: NEO-13973 Signed-off-by: Damian Tomczak <damian.tomczak@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
294ed83eff
commit
dbd7d00b27
@@ -10,6 +10,7 @@
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_container/encode_surface_state.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#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"
|
||||
@@ -1034,7 +1035,7 @@ HWTEST2_F(HostPointerManagerCommandListTest, givenCommandListWhenMemoryFillWithS
|
||||
|
||||
auto pc = genCmdCast<PIPE_CONTROL *>(*cmdList.rbegin());
|
||||
|
||||
if (NEO::MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment())) {
|
||||
if (!device->getProductHelper().isL3FlushAfterPostSyncRequired(device->getCompilerProductHelper().isHeaplessModeEnabled()) && NEO::MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment())) {
|
||||
EXPECT_NE(nullptr, pc);
|
||||
EXPECT_TRUE(pc->getDcFlushEnable());
|
||||
} else {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/compiler_product_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/mocks/mock_device.h"
|
||||
@@ -624,7 +625,7 @@ HWTEST2_F(CommandListCreate, givenCommandListAndHostPointersWhenMemoryCopyCalled
|
||||
|
||||
auto pc = genCmdCast<PIPE_CONTROL *>(*genCmdList.rbegin());
|
||||
|
||||
if (NEO::MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment())) {
|
||||
if (!device->getProductHelper().isL3FlushAfterPostSyncRequired(device->getCompilerProductHelper().isHeaplessModeEnabled()) && NEO::MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment())) {
|
||||
EXPECT_NE(nullptr, pc);
|
||||
EXPECT_TRUE(pc->getDcFlushEnable());
|
||||
} else {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
* Copyright (C) 2020-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/encode_surface_state.h"
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/helpers/register_offsets.h"
|
||||
#include "shared/source/memory_manager/internal_allocation_storage.h"
|
||||
@@ -321,7 +322,7 @@ HWTEST2_F(AppendMemoryCopyTests, givenCommandListAndHostPointersWhenMemoryCopyRe
|
||||
|
||||
auto pc = genCmdCast<PIPE_CONTROL *>(*genCmdList.rbegin());
|
||||
|
||||
if (NEO::MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment())) {
|
||||
if (!device->getProductHelper().isL3FlushAfterPostSyncRequired(device->getCompilerProductHelper().isHeaplessModeEnabled()) && NEO::MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment())) {
|
||||
EXPECT_NE(nullptr, pc);
|
||||
EXPECT_TRUE(pc->getDcFlushEnable());
|
||||
} else {
|
||||
@@ -674,8 +675,9 @@ HWTEST2_F(AppendMemoryCopyTests, givenCommandListAndHostPointersWhenMemoryCopyCa
|
||||
}
|
||||
itor++;
|
||||
}
|
||||
|
||||
uint32_t expectedDcFlushPipeControl =
|
||||
NEO::MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment()) ? 1 : 0;
|
||||
!device->getProductHelper().isL3FlushAfterPostSyncRequired(device->getCompilerProductHelper().isHeaplessModeEnabled()) && NEO::MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment()) ? 1 : 0;
|
||||
EXPECT_EQ(expectedDcFlushPipeControl, dcFlushPipeControl);
|
||||
}
|
||||
|
||||
|
||||
@@ -2043,7 +2043,7 @@ HWTEST2_F(InOrderCmdListTests, givenCmdsChainingFromAppendCopyAndFlushRequiredWh
|
||||
|
||||
offset = cmdStream->getUsed();
|
||||
immCmdList->appendMemoryCopyRegion(©Data, ®ion, 1, 1, ©Data, ®ion, 1, 1, nullptr, 0, nullptr, copyParams);
|
||||
findSemaphores((heaplessEnabled && !immCmdList->dcFlushSupport) ? 1 : 0); // no implicit dependency
|
||||
findSemaphores(heaplessEnabled ? 1 : 0); // no implicit dependency
|
||||
}
|
||||
|
||||
HWTEST2_F(InOrderCmdListTests, givenEventWithRequiredPipeControlWhenDispatchingCopyThenSignalInOrderAllocation, IsAtLeastXeHpCore) {
|
||||
@@ -2097,6 +2097,7 @@ HWTEST2_F(InOrderCmdListTests, givenEventWithRequiredPipeControlWhenDispatchingC
|
||||
HWTEST2_F(InOrderCmdListTests, givenEventWithRequiredPipeControlAndAllocFlushWhenDispatchingCopyThenSignalInOrderAllocation, IsAtLeastXeHpCore) {
|
||||
using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM;
|
||||
using WalkerVariant = typename FamilyType::WalkerVariant;
|
||||
using MI_ATOMIC = typename FamilyType::MI_ATOMIC;
|
||||
|
||||
auto immCmdList = createImmCmdList<gfxCoreFamily>();
|
||||
auto eventPool = createEvents<FamilyType>(1, false);
|
||||
@@ -2110,9 +2111,21 @@ HWTEST2_F(InOrderCmdListTests, givenEventWithRequiredPipeControlAndAllocFlushWhe
|
||||
immCmdList->appendMemoryCopy(©Data, ©Data, 1, eventHandle, 0, nullptr, copyParams);
|
||||
|
||||
auto dcFlushRequired = immCmdList->getDcFlushRequired(true);
|
||||
auto inOrderExecInfo = immCmdList->inOrderExecInfo;
|
||||
auto gpuAddress = inOrderExecInfo->getBaseDeviceAddress();
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(cmdList, ptrOffset(cmdStream->getCpuBase(), offset), cmdStream->getUsed() - offset));
|
||||
|
||||
auto miAtomicItor = find<MI_ATOMIC *>(cmdList.begin(), cmdList.end());
|
||||
if (device->getProductHelper().isDcFlushAllowed() && inOrderExecInfo->isHostStorageDuplicated()) {
|
||||
EXPECT_NE(cmdList.end(), miAtomicItor);
|
||||
auto miAtomicCmd = genCmdCast<MI_ATOMIC *>(*miAtomicItor);
|
||||
EXPECT_EQ(gpuAddress, miAtomicCmd->getMemoryAddress());
|
||||
} else {
|
||||
EXPECT_EQ(cmdList.end(), miAtomicItor);
|
||||
}
|
||||
|
||||
auto sdiItor = find<MI_STORE_DATA_IMM *>(cmdList.begin(), cmdList.end());
|
||||
if (immCmdList->eventSignalPipeControl(false, immCmdList->getDcFlushRequired(events[0]->isSignalScope()))) {
|
||||
EXPECT_NE(cmdList.end(), sdiItor);
|
||||
@@ -2120,9 +2133,13 @@ HWTEST2_F(InOrderCmdListTests, givenEventWithRequiredPipeControlAndAllocFlushWhe
|
||||
if (dcFlushRequired) {
|
||||
EXPECT_NE(cmdList.end(), sdiItor);
|
||||
|
||||
if (inOrderExecInfo->isHostStorageDuplicated()) {
|
||||
gpuAddress = reinterpret_cast<uint64_t>(inOrderExecInfo->getBaseHostAddress());
|
||||
}
|
||||
|
||||
auto sdiCmd = genCmdCast<MI_STORE_DATA_IMM *>(*sdiItor);
|
||||
|
||||
EXPECT_EQ(immCmdList->inOrderExecInfo->getBaseDeviceAddress(), sdiCmd->getAddress());
|
||||
EXPECT_EQ(gpuAddress, sdiCmd->getAddress());
|
||||
|
||||
} else {
|
||||
EXPECT_EQ(cmdList.end(), sdiItor);
|
||||
@@ -2132,12 +2149,12 @@ HWTEST2_F(InOrderCmdListTests, givenEventWithRequiredPipeControlAndAllocFlushWhe
|
||||
ASSERT_NE(cmdList.end(), walkerItor);
|
||||
|
||||
WalkerVariant walkerVariant = NEO::UnitTestHelper<FamilyType>::getWalkerVariant(*walkerItor);
|
||||
std::visit([&immCmdList, &dcFlushRequired](auto &&walker) {
|
||||
std::visit([&dcFlushRequired, gpuAddress](auto &&walker) {
|
||||
auto &postSync = walker->getPostSync();
|
||||
if (dcFlushRequired) {
|
||||
EXPECT_NE(immCmdList->inOrderExecInfo->getBaseDeviceAddress(), postSync.getDestinationAddress());
|
||||
EXPECT_NE(gpuAddress, postSync.getDestinationAddress());
|
||||
} else {
|
||||
EXPECT_EQ(immCmdList->inOrderExecInfo->getBaseDeviceAddress(), postSync.getDestinationAddress());
|
||||
EXPECT_EQ(gpuAddress, postSync.getDestinationAddress());
|
||||
}
|
||||
},
|
||||
walkerVariant);
|
||||
|
||||
Reference in New Issue
Block a user