mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
refactor: don't use global ProductHelper getter 12/n
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
438ae37aef
commit
b101f9f2f5
@@ -438,7 +438,6 @@ HWTEST_TEMPLATED_F(BlitAuxTranslationTests, givenBlitAuxTranslationWhenDispatchi
|
||||
using WALKER_TYPE = typename FamilyType::WALKER_TYPE;
|
||||
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
|
||||
|
||||
auto &hwInfo = device->getHardwareInfo();
|
||||
auto mockCmdQ = static_cast<MockCommandQueueHw<FamilyType> *>(commandQueue.get());
|
||||
mockCmdQ->overrideIsCacheFlushForBcsRequired.enabled = true;
|
||||
mockCmdQ->overrideIsCacheFlushForBcsRequired.returnValue = false;
|
||||
@@ -465,18 +464,18 @@ HWTEST_TEMPLATED_F(BlitAuxTranslationTests, givenBlitAuxTranslationWhenDispatchi
|
||||
|
||||
EXPECT_NE(firstDispatchInfo, lastDispatchInfo); // walker split
|
||||
|
||||
EXPECT_EQ(dependencySize, firstDispatchInfo->dispatchInitCommands.estimateCommandsSize(kernelObjects.size(), hwInfo, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(0u, firstDispatchInfo->dispatchEpilogueCommands.estimateCommandsSize(kernelObjects.size(), hwInfo, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
auto &rootDeviceEnvironment = device->getRootDeviceEnvironment();
|
||||
EXPECT_EQ(dependencySize, firstDispatchInfo->dispatchInitCommands.estimateCommandsSize(kernelObjects.size(), rootDeviceEnvironment, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(0u, firstDispatchInfo->dispatchEpilogueCommands.estimateCommandsSize(kernelObjects.size(), rootDeviceEnvironment, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
|
||||
EXPECT_EQ(0u, lastDispatchInfo->dispatchInitCommands.estimateCommandsSize(kernelObjects.size(), hwInfo, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(dependencySize, lastDispatchInfo->dispatchEpilogueCommands.estimateCommandsSize(kernelObjects.size(), hwInfo, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(0u, lastDispatchInfo->dispatchInitCommands.estimateCommandsSize(kernelObjects.size(), rootDeviceEnvironment, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(dependencySize, lastDispatchInfo->dispatchEpilogueCommands.estimateCommandsSize(kernelObjects.size(), rootDeviceEnvironment, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(BlitAuxTranslationTests, givenBlitAuxTranslationWithRequiredCacheFlushWhenDispatchingThenEstimateCmdBufferSize) {
|
||||
using WALKER_TYPE = typename FamilyType::WALKER_TYPE;
|
||||
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
|
||||
|
||||
auto &hwInfo = device->getHardwareInfo();
|
||||
auto mockCmdQ = static_cast<MockCommandQueueHw<FamilyType> *>(commandQueue.get());
|
||||
mockCmdQ->overrideIsCacheFlushForBcsRequired.enabled = true;
|
||||
mockCmdQ->overrideIsCacheFlushForBcsRequired.returnValue = true;
|
||||
@@ -492,7 +491,8 @@ HWTEST_TEMPLATED_F(BlitAuxTranslationTests, givenBlitAuxTranslationWithRequiredC
|
||||
size_t numBuffersToEstimate = 2;
|
||||
size_t dependencySize = numBuffersToEstimate * TimestampPacketHelper::getRequiredCmdStreamSizeForNodeDependencyWithBlitEnqueue<FamilyType>();
|
||||
|
||||
size_t cacheFlushSize = MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(hwInfo, false);
|
||||
auto &rootDeviceEnvironment = device->getRootDeviceEnvironment();
|
||||
size_t cacheFlushSize = MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(rootDeviceEnvironment, false);
|
||||
|
||||
setMockKernelArgs(std::array<Buffer *, 3>{{buffer0.get(), buffer1.get(), buffer2.get()}});
|
||||
|
||||
@@ -505,11 +505,11 @@ HWTEST_TEMPLATED_F(BlitAuxTranslationTests, givenBlitAuxTranslationWithRequiredC
|
||||
|
||||
EXPECT_NE(firstDispatchInfo, lastDispatchInfo); // walker split
|
||||
|
||||
EXPECT_EQ(dependencySize, firstDispatchInfo->dispatchInitCommands.estimateCommandsSize(kernelObjects.size(), hwInfo, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(0u, firstDispatchInfo->dispatchEpilogueCommands.estimateCommandsSize(kernelObjects.size(), hwInfo, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(dependencySize, firstDispatchInfo->dispatchInitCommands.estimateCommandsSize(kernelObjects.size(), rootDeviceEnvironment, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(0u, firstDispatchInfo->dispatchEpilogueCommands.estimateCommandsSize(kernelObjects.size(), rootDeviceEnvironment, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
|
||||
EXPECT_EQ(0u, lastDispatchInfo->dispatchInitCommands.estimateCommandsSize(kernelObjects.size(), hwInfo, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(dependencySize + cacheFlushSize, lastDispatchInfo->dispatchEpilogueCommands.estimateCommandsSize(kernelObjects.size(), hwInfo, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(0u, lastDispatchInfo->dispatchInitCommands.estimateCommandsSize(kernelObjects.size(), rootDeviceEnvironment, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
EXPECT_EQ(dependencySize + cacheFlushSize, lastDispatchInfo->dispatchEpilogueCommands.estimateCommandsSize(kernelObjects.size(), rootDeviceEnvironment, mockCmdQ->isCacheFlushForBcsRequired()));
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(BlitAuxTranslationTests, givenBlitTranslationWhenConstructingBlockedCommandBufferThenSynchronizeBarrier) {
|
||||
|
||||
@@ -1357,7 +1357,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma
|
||||
|
||||
auto itorPipeCtrl = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), itorPipeCtrl);
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(pDevice->getRootDeviceEnvironment())) {
|
||||
itorPipeCtrl++;
|
||||
}
|
||||
if (UnitTestHelper<FamilyType>::isAdditionalSynchronizationRequired()) {
|
||||
@@ -1372,7 +1372,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma
|
||||
|
||||
itorPipeCtrl++;
|
||||
itorPipeCtrl = find<typename FamilyType::PIPE_CONTROL *>(itorPipeCtrl, cmdList.end());
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(pDevice->getRootDeviceEnvironment())) {
|
||||
itorPipeCtrl++;
|
||||
}
|
||||
if (UnitTestHelper<FamilyType>::isAdditionalSynchronizationRequired()) {
|
||||
|
||||
@@ -1086,7 +1086,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&context, device, nullptr);
|
||||
auto &csr = cmdQ->getUltCommandStreamReceiver();
|
||||
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getHardwareInfo()) ? 2 : 1;
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1;
|
||||
|
||||
auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) +
|
||||
(sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) +
|
||||
@@ -1144,7 +1144,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&context, device, nullptr);
|
||||
auto &csr = cmdQ->getUltCommandStreamReceiver();
|
||||
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getHardwareInfo()) ? 2 : 1;
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1;
|
||||
|
||||
auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) +
|
||||
(sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) +
|
||||
@@ -1196,7 +1196,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, whenWalkerPart
|
||||
DebugManager.flags.EnableWalkerPartition.set(0u);
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(context.get(), device.get(), nullptr);
|
||||
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getHardwareInfo()) ? 2 : 1;
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1;
|
||||
|
||||
DispatchInfo dispatchInfo{};
|
||||
dispatchInfo.setNumberOfWorkgroups({32, 1, 1});
|
||||
@@ -1216,7 +1216,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, whenPipeContro
|
||||
hwInfo.featureTable.flags.ftrLocalMemory = true;
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(context.get(), device.get(), nullptr);
|
||||
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(hwInfo) ? 2 : 1;
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1;
|
||||
|
||||
auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) +
|
||||
(sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) +
|
||||
@@ -1234,7 +1234,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(context.get(), device.get(), nullptr);
|
||||
auto &csr = cmdQ->getUltCommandStreamReceiver();
|
||||
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getHardwareInfo()) ? 2 : 1;
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1;
|
||||
|
||||
auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) +
|
||||
(sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) +
|
||||
@@ -1265,7 +1265,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(context.get(), device.get(), nullptr);
|
||||
auto &csr = cmdQ->getUltCommandStreamReceiver();
|
||||
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getHardwareInfo()) ? 2 : 1;
|
||||
size_t numPipeControls = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1;
|
||||
|
||||
auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) +
|
||||
(sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) +
|
||||
|
||||
@@ -498,7 +498,7 @@ HWTEST_F(EnqueueHandlerTest, GivenCommandStreamWithoutKernelAndZeroSurfacesWhenE
|
||||
EXPECT_EQ(CL_SUCCESS, enqueueResult);
|
||||
|
||||
auto requiredCmdStreamSize = alignUp(MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(
|
||||
pDevice->getHardwareInfo(), false),
|
||||
pDevice->getRootDeviceEnvironment(), false),
|
||||
MemoryConstants::cacheLineSize);
|
||||
|
||||
EXPECT_EQ(mockCmdQ->getCS(0).getUsed(), requiredCmdStreamSize);
|
||||
|
||||
@@ -902,7 +902,7 @@ HWTEST_F(EnqueueAuxKernelTests, givenMultipleArgsWhenAuxTranslationIsRequiredThe
|
||||
auto pipeControls = findAll<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
|
||||
auto additionalPcCount = MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(
|
||||
pDevice->getHardwareInfo(), false) /
|
||||
pDevice->getRootDeviceEnvironment(), false) /
|
||||
sizeof(typename FamilyType::PIPE_CONTROL);
|
||||
|
||||
// |AuxToNonAux|NDR|NonAuxToAux|
|
||||
@@ -1037,7 +1037,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, EnqueueKernelTest, givenTimestampWriteEnableOnMulti
|
||||
auto baseCommandStreamSize = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_MARKER, {}, false, false, false, *pCmdQ, multiDispatchInfo, false, false, nullptr);
|
||||
auto extendedCommandStreamSize = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_MARKER, {}, false, false, false, *pCmdQ, multiDispatchInfo, true, false, nullptr);
|
||||
|
||||
EXPECT_EQ(baseCommandStreamSize + 4 * EncodeStoreMMIO<FamilyType>::size + ImplicitScalingDispatch<FamilyType>::getBarrierSize(csr.peekHwInfo(), false, false), extendedCommandStreamSize);
|
||||
EXPECT_EQ(baseCommandStreamSize + 4 * EncodeStoreMMIO<FamilyType>::size + ImplicitScalingDispatch<FamilyType>::getBarrierSize(pDevice->getRootDeviceEnvironment(), false, false), extendedCommandStreamSize);
|
||||
}
|
||||
|
||||
HWTEST_F(EnqueueKernelTest, givenTimestampWriteEnableWhenMarkerProfilingWithWaitListThenSizeHasFourMMIOStores) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -43,7 +43,7 @@ HWTEST_F(IOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenOnePipeC
|
||||
|
||||
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
|
||||
|
||||
auto waNeeded = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(pDevice->getHardwareInfo());
|
||||
auto waNeeded = MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(pDevice->getRootDeviceEnvironment());
|
||||
|
||||
auto itorCmd = find<PIPE_CONTROL *>(itorWalker1, itorWalker2);
|
||||
ASSERT_NE(itorWalker2, itorCmd);
|
||||
|
||||
@@ -440,7 +440,7 @@ HWTEST_F(GetSizeRequiredBufferTest, GivenOutEventForMultiDeviceContextWhenCalcul
|
||||
auto baseCommandStreamSize = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_MARKER, {}, false, false, false, *pCmdQ, multiDispatchInfo, false, false, nullptr);
|
||||
auto extendedCommandStreamSize = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(CL_COMMAND_MARKER, {}, false, false, false, *pCmdQ, multiDispatchInfo, false, false, &clEvent);
|
||||
|
||||
EXPECT_EQ(baseCommandStreamSize + MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(pContext.getDevices()[0]->getHardwareInfo(), false), extendedCommandStreamSize);
|
||||
EXPECT_EQ(baseCommandStreamSize + MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(pContext.getDevices()[0]->getRootDeviceEnvironment(), false), extendedCommandStreamSize);
|
||||
}
|
||||
|
||||
HWTEST_F(GetSizeRequiredBufferTest, givenMultipleKernelRequiringSshWhenTotalSizeIsComputedThenItIsProperlyAligned) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -73,7 +73,7 @@ HWTEST_F(GetSizeRequiredTest, WhenEnqueuingMarkerThenHeapsAndCommandBufferAreNot
|
||||
size_t expectedStreamSize = 0;
|
||||
if (pCmdQ->getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
|
||||
expectedStreamSize = alignUp(MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(
|
||||
pDevice->getHardwareInfo(), false),
|
||||
pDevice->getRootDeviceEnvironment(), false),
|
||||
MemoryConstants::cacheLineSize);
|
||||
}
|
||||
EXPECT_EQ(expectedStreamSize, commandStream.getUsed() - usedBeforeCS);
|
||||
@@ -100,7 +100,7 @@ HWTEST_F(GetSizeRequiredTest, WhenEnqueuingBarrierThenHeapsAndCommandBufferAreNo
|
||||
size_t expectedStreamSize = 0;
|
||||
if (pCmdQ->getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
|
||||
expectedStreamSize = alignUp(MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(
|
||||
pDevice->getHardwareInfo(), false),
|
||||
pDevice->getRootDeviceEnvironment(), false),
|
||||
MemoryConstants::cacheLineSize);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user