mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Move pipecontrol w/a estimation to dedicated class
Change-Id: I8ceaa2dff94dd7148daf921568fd30f098e5dae4 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
ff85c29e5c
commit
28ef5fa709
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/memory_manager/internal_allocation_storage.h"
|
||||
#include "shared/source/utilities/tag_allocator.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
@ -1399,7 +1400,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 (HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
itorPipeCtrl++;
|
||||
}
|
||||
if (UnitTestHelper<FamilyType>::isAdditionalSynchronizationRequired(pDevice->getHardwareInfo())) {
|
||||
@ -1414,7 +1415,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma
|
||||
|
||||
itorPipeCtrl++;
|
||||
itorPipeCtrl = find<typename FamilyType::PIPE_CONTROL *>(itorPipeCtrl, cmdList.end());
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
itorPipeCtrl++;
|
||||
}
|
||||
if (UnitTestHelper<FamilyType>::isAdditionalSynchronizationRequired(pDevice->getHardwareInfo())) {
|
||||
|
@ -5,7 +5,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/two_walker_fixture.h"
|
||||
#include "opencl/test/unit_test/libult/ult_command_stream_receiver.h"
|
||||
#include "test.h"
|
||||
@ -41,7 +42,7 @@ HWTEST_F(IOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenOnePipeC
|
||||
|
||||
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
|
||||
|
||||
auto WaNeeded = HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo());
|
||||
auto WaNeeded = MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo());
|
||||
|
||||
auto itorCmd = find<PIPE_CONTROL *>(itorWalker1, itorWalker2);
|
||||
ASSERT_NE(itorWalker2, itorCmd);
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/unit_test/helpers/dispatch_flags_helper.h"
|
||||
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/raii_hw_helper.h"
|
||||
#include "opencl/test/unit_test/helpers/unit_test_helper.h"
|
||||
@ -1057,7 +1056,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenSpecialPipelineSelectModeChan
|
||||
size_t size = commandStreamReceiver.getCmdSizeForPipelineSelect();
|
||||
|
||||
size_t expectedSize = sizeof(PIPELINE_SELECT);
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlPriorToPipelineSelectWArequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlPriorToPipelineSelectWArequired(pDevice->getHardwareInfo())) {
|
||||
expectedSize += sizeof(PIPE_CONTROL);
|
||||
}
|
||||
EXPECT_EQ(expectedSize, size);
|
||||
@ -1085,7 +1084,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenPreambleSentThenRequir
|
||||
auto difference = mediaSamplerConfigChangedSize - mediaSamplerConfigNotChangedSize;
|
||||
|
||||
size_t expectedDifference = sizeof(PIPELINE_SELECT);
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlPriorToPipelineSelectWArequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlPriorToPipelineSelectWArequired(pDevice->getHardwareInfo())) {
|
||||
expectedDifference += sizeof(PIPE_CONTROL);
|
||||
}
|
||||
|
||||
|
@ -6,11 +6,11 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/memory_manager/internal_allocation_storage.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_experimental_command_buffer.h"
|
||||
@ -93,7 +93,7 @@ HWTEST_F(MockExperimentalCommandBufferTest, givenEnabledExperimentalCmdBufferWhe
|
||||
it = hwParserExCmdBuffer.cmdList.begin();
|
||||
GenCmdList::iterator end = hwParserExCmdBuffer.cmdList.end();
|
||||
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
//1st PIPE_CONTROL with CS Stall
|
||||
ASSERT_NE(end, it);
|
||||
pipeControl = genCmdCast<PIPE_CONTROL *>(*it);
|
||||
@ -131,7 +131,7 @@ HWTEST_F(MockExperimentalCommandBufferTest, givenEnabledExperimentalCmdBufferWhe
|
||||
EXPECT_EQ(exAllocationGpuAddr, semaphoreCmd->getSemaphoreGraphicsAddress());
|
||||
EXPECT_EQ(MI_SEMAPHORE_WAIT::COMPARE_OPERATION_SAD_EQUAL_SDD, semaphoreCmd->getCompareOperation());
|
||||
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
//3rd PIPE_CONTROL with CS stall
|
||||
it++;
|
||||
ASSERT_NE(end, it);
|
||||
@ -237,7 +237,7 @@ HWTEST_F(MockExperimentalCommandBufferTest, givenEnabledExperimentalCmdBufferWhe
|
||||
hwParserExCmdBuffer.parseCommands<FamilyType>(*mockExCmdBuffer->currentStream, cmbBufferOffset);
|
||||
it = hwParserExCmdBuffer.cmdList.begin();
|
||||
GenCmdList::iterator end = hwParserExCmdBuffer.cmdList.end();
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
it++;
|
||||
}
|
||||
if (UnitTestHelper<FamilyType>::isAdditionalSynchronizationRequired(pDevice->getHardwareInfo())) {
|
||||
@ -255,7 +255,7 @@ HWTEST_F(MockExperimentalCommandBufferTest, givenEnabledExperimentalCmdBufferWhe
|
||||
EXPECT_EQ(expectedTsAddress, pipeControl->getAddress());
|
||||
EXPECT_EQ(expectedTsAddressHigh, pipeControl->getAddressHigh());
|
||||
//omit SEMAPHORE_WAIT and 3rd PIPE_CONTROL
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
|
||||
it++;
|
||||
}
|
||||
if (UnitTestHelper<FamilyType>::isAdditionalSynchronizationRequired(pDevice->getHardwareInfo())) {
|
||||
|
@ -5,9 +5,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/test/unit_test/helpers/default_hw_info.h"
|
||||
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "test.h"
|
||||
|
||||
namespace NEO {
|
||||
@ -78,7 +78,7 @@ HWTEST_TEMPLATED_F(DerivedTemplatedFixtureTests, whenExecutingTemplatedTestThenC
|
||||
struct TemplatedFixtureBaseTests : public ::testing::Test {
|
||||
template <typename T>
|
||||
void SetUpT() {
|
||||
capturedPipeControlWaRequiredInSetUp = HardwareCommandsHelper<T>::isPipeControlWArequired(*defaultHwInfo);
|
||||
capturedPipeControlWaRequiredInSetUp = MemorySynchronizationCommands<T>::isPipeControlWArequired(*defaultHwInfo);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -88,7 +88,7 @@ struct TemplatedFixtureBaseTests : public ::testing::Test {
|
||||
};
|
||||
|
||||
HWTEST_TEMPLATED_F(TemplatedFixtureBaseTests, whenExecutingTemplatedSetupThenTemplateTargetsCorrectPlatform) {
|
||||
bool capturedPipeControlWaRequiredInTestBody = HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(*defaultHwInfo);
|
||||
bool capturedPipeControlWaRequiredInTestBody = MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(*defaultHwInfo);
|
||||
|
||||
EXPECT_EQ(capturedPipeControlWaRequiredInTestBody, capturedPipeControlWaRequiredInSetUp);
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "shared/test/unit_test/helpers/dispatch_flags_helper.h"
|
||||
#include "shared/test/unit_test/mocks/mock_device.h"
|
||||
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
@ -244,7 +243,7 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenCoherencyRequirementWithoutShar
|
||||
auto hwInfo = device->getHardwareInfo();
|
||||
|
||||
flushTask(false);
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlPriorToPipelineSelectWArequired(hwInfo)) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlPriorToPipelineSelectWArequired(hwInfo)) {
|
||||
findCmd(true, false, true); // first time
|
||||
} else {
|
||||
findCmd(true, false, false); // first time
|
||||
|
@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/timestamp_packet.h"
|
||||
#include "shared/source/utilities/tag_allocator.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
@ -606,7 +607,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, TimestampPacketTests, givenTimestampPacketWhenDispat
|
||||
uint32_t walkersFound = 0;
|
||||
for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) {
|
||||
if (genCmdCast<GPGPU_WALKER *>(*it)) {
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(device->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(device->getHardwareInfo())) {
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(*++it);
|
||||
EXPECT_NE(nullptr, pipeControl);
|
||||
}
|
||||
@ -714,7 +715,7 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEnqueueingThe
|
||||
bool walkerFound = false;
|
||||
for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) {
|
||||
if (genCmdCast<GPGPU_WALKER *>(*it)) {
|
||||
if (HardwareCommandsHelper<FamilyType>::isPipeControlWArequired(device->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(device->getHardwareInfo())) {
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(*++it);
|
||||
EXPECT_NE(nullptr, pipeControl);
|
||||
}
|
||||
|
Reference in New Issue
Block a user