mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Remove HW types from synchronization interface
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
975e2af781
commit
a3903c385e
@ -297,9 +297,9 @@ HWTEST_F(PipeControlHelperTests, givenPostSyncWriteTimestampModeWhenHelperIsUsed
|
||||
HardwareInfo hardwareInfo = *defaultHwInfo;
|
||||
|
||||
PipeControlArgs args;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControlAndProgramPostSyncOperation(
|
||||
stream, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_TIMESTAMP, address, immediateData, hardwareInfo, args);
|
||||
auto additionalPcSize = MemorySynchronizationCommands<FamilyType>::getSizeForPipeControlWithPostSyncOperation(hardwareInfo) - sizeof(PIPE_CONTROL);
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWithPostSyncOperation(
|
||||
stream, PostSyncMode::Timestamp, address, immediateData, hardwareInfo, args);
|
||||
auto additionalPcSize = MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(hardwareInfo) - sizeof(PIPE_CONTROL);
|
||||
auto pipeControlLocationSize = additionalPcSize - MemorySynchronizationCommands<FamilyType>::getSizeForSingleAdditionalSynchronization(hardwareInfo);
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(ptrOffset(stream.getCpuBase(), pipeControlLocationSize));
|
||||
ASSERT_NE(nullptr, pipeControl);
|
||||
@ -321,7 +321,7 @@ HWTEST_F(PipeControlHelperTests, givenDcFlushNotAllowedWhenProgrammingPipeContro
|
||||
PipeControlArgs args;
|
||||
args.dcFlushEnable = true;
|
||||
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
MemorySynchronizationCommands<FamilyType>::addSingleBarrier(stream, args);
|
||||
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(stream.getCpuBase());
|
||||
ASSERT_NE(nullptr, pipeControl);
|
||||
@ -346,9 +346,9 @@ HWTEST_F(PipeControlHelperTests, givenPostSyncWriteImmediateDataModeWhenHelperIs
|
||||
HardwareInfo hardwareInfo = *defaultHwInfo;
|
||||
|
||||
PipeControlArgs args;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControlAndProgramPostSyncOperation(
|
||||
stream, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, address, immediateData, hardwareInfo, args);
|
||||
auto additionalPcSize = MemorySynchronizationCommands<FamilyType>::getSizeForPipeControlWithPostSyncOperation(hardwareInfo) - sizeof(PIPE_CONTROL);
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWithPostSyncOperation(
|
||||
stream, PostSyncMode::ImmediateData, address, immediateData, hardwareInfo, args);
|
||||
auto additionalPcSize = MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(hardwareInfo) - sizeof(PIPE_CONTROL);
|
||||
auto pipeControlLocationSize = additionalPcSize - MemorySynchronizationCommands<FamilyType>::getSizeForSingleAdditionalSynchronization(hardwareInfo);
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(ptrOffset(stream.getCpuBase(), pipeControlLocationSize));
|
||||
ASSERT_NE(nullptr, pipeControl);
|
||||
@ -376,9 +376,9 @@ HWTEST_F(PipeControlHelperTests, givenNotifyEnableArgumentIsTrueWhenHelperIsUsed
|
||||
|
||||
PipeControlArgs args;
|
||||
args.notifyEnable = true;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControlAndProgramPostSyncOperation(
|
||||
stream, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, address, immediateData, hardwareInfo, args);
|
||||
auto additionalPcSize = MemorySynchronizationCommands<FamilyType>::getSizeForPipeControlWithPostSyncOperation(hardwareInfo) - sizeof(PIPE_CONTROL);
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWithPostSyncOperation(
|
||||
stream, PostSyncMode::ImmediateData, address, immediateData, hardwareInfo, args);
|
||||
auto additionalPcSize = MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(hardwareInfo) - sizeof(PIPE_CONTROL);
|
||||
auto pipeControlLocationSize = additionalPcSize - MemorySynchronizationCommands<FamilyType>::getSizeForSingleAdditionalSynchronization(hardwareInfo);
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(ptrOffset(stream.getCpuBase(), pipeControlLocationSize));
|
||||
ASSERT_NE(nullptr, pipeControl);
|
||||
@ -402,8 +402,8 @@ HWTEST_F(PipeControlHelperTests, WhenPipeControlPostSyncTimestampUsedThenCorrect
|
||||
uint64_t immediateData = 0x0;
|
||||
|
||||
PipeControlArgs args;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControlWithPostSync(
|
||||
stream, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_TIMESTAMP, address, immediateData, args);
|
||||
MemorySynchronizationCommands<FamilyType>::addSingleBarrier(
|
||||
stream, PostSyncMode::Timestamp, address, immediateData, args);
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(stream.getCpuBase());
|
||||
ASSERT_NE(nullptr, pipeControl);
|
||||
EXPECT_EQ(address, NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
|
||||
@ -420,8 +420,8 @@ HWTEST_F(PipeControlHelperTests, WhenPipeControlPostSyncWriteImmediateDataUsedTh
|
||||
uint64_t immediateData = 0x1234;
|
||||
|
||||
PipeControlArgs args;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControlWithPostSync(
|
||||
stream, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, address, immediateData, args);
|
||||
MemorySynchronizationCommands<FamilyType>::addSingleBarrier(
|
||||
stream, PostSyncMode::ImmediateData, address, immediateData, args);
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(stream.getCpuBase());
|
||||
ASSERT_NE(nullptr, pipeControl);
|
||||
EXPECT_EQ(address, NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
|
||||
|
@ -31,9 +31,9 @@ HWTEST2_F(PipeControlHelperTestsDg2AndLater, WhenAddingPipeControlWAThenCorrectC
|
||||
LinearStream stream(buffer, 128);
|
||||
hardwareInfo.featureTable.flags.ftrLocalMemory = ftrLocalMemory;
|
||||
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControlWA(stream, address, hardwareInfo);
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWa(stream, address, hardwareInfo);
|
||||
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(hardwareInfo) == false) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(hardwareInfo) == false) {
|
||||
EXPECT_EQ(0u, stream.getUsed());
|
||||
continue;
|
||||
}
|
||||
@ -104,7 +104,7 @@ HWTEST2_F(PipeControlHelperTestsDg2AndLater, givenRequestedCacheFlushesWhenProgr
|
||||
args.hdcPipelineFlush = true;
|
||||
args.unTypedDataPortCacheFlush = true;
|
||||
args.compressionControlSurfaceCcsFlush = true;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
MemorySynchronizationCommands<FamilyType>::addSingleBarrier(stream, args);
|
||||
|
||||
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(buffer);
|
||||
EXPECT_TRUE(UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pipeControl));
|
||||
@ -121,7 +121,7 @@ HWTEST2_F(PipeControlHelperTestsDg2AndLater, givenDebugVariableSetWhenProgrammin
|
||||
LinearStream stream(buffer, sizeof(buffer));
|
||||
|
||||
PipeControlArgs args;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
MemorySynchronizationCommands<FamilyType>::addSingleBarrier(stream, args);
|
||||
|
||||
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(buffer);
|
||||
EXPECT_TRUE(UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pipeControl));
|
||||
@ -141,7 +141,7 @@ HWTEST2_F(PipeControlHelperTestsDg2AndLater, givenDebugDisableCacheFlushWhenProg
|
||||
args.hdcPipelineFlush = true;
|
||||
args.unTypedDataPortCacheFlush = true;
|
||||
args.compressionControlSurfaceCcsFlush = true;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
MemorySynchronizationCommands<FamilyType>::addSingleBarrier(stream, args);
|
||||
|
||||
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(buffer);
|
||||
EXPECT_FALSE(UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pipeControl));
|
||||
|
@ -248,9 +248,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, PipeControlHelperTestsXeHPAndLater, WhenAddingPipeC
|
||||
LinearStream stream(buffer, 128);
|
||||
hardwareInfo.featureTable.flags.ftrLocalMemory = ftrLocalMemory;
|
||||
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControlWA(stream, address, hardwareInfo);
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWa(stream, address, hardwareInfo);
|
||||
|
||||
if (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(hardwareInfo) == false) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(hardwareInfo) == false) {
|
||||
EXPECT_EQ(0u, stream.getUsed());
|
||||
continue;
|
||||
}
|
||||
@ -322,7 +322,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, PipeControlHelperTestsXeHPAndLater, givenRequestedC
|
||||
PipeControlArgs args;
|
||||
args.hdcPipelineFlush = true;
|
||||
args.compressionControlSurfaceCcsFlush = true;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
MemorySynchronizationCommands<FamilyType>::addSingleBarrier(stream, args);
|
||||
|
||||
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(buffer);
|
||||
EXPECT_TRUE(UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pipeControl));
|
||||
@ -338,7 +338,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, PipeControlHelperTestsXeHPAndLater, givenDebugVaria
|
||||
LinearStream stream(buffer, sizeof(buffer));
|
||||
|
||||
PipeControlArgs args;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
MemorySynchronizationCommands<FamilyType>::addSingleBarrier(stream, args);
|
||||
|
||||
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(buffer);
|
||||
EXPECT_TRUE(UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pipeControl));
|
||||
@ -356,7 +356,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, PipeControlHelperTestsXeHPAndLater, givenDebugDisab
|
||||
PipeControlArgs args;
|
||||
args.hdcPipelineFlush = true;
|
||||
args.compressionControlSurfaceCcsFlush = true;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
MemorySynchronizationCommands<FamilyType>::addSingleBarrier(stream, args);
|
||||
|
||||
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(buffer);
|
||||
EXPECT_FALSE(UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pipeControl));
|
||||
@ -379,7 +379,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, HwHelperTestXeHPAndLater, WhenIsPipeControlWArequir
|
||||
hwInfo.featureTable.flags.ftrLocalMemory = ftrLocalMemory;
|
||||
|
||||
EXPECT_EQ(UnitTestHelper<FamilyType>::isPipeControlWArequired(hwInfo),
|
||||
MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(hwInfo));
|
||||
MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(hwInfo));
|
||||
}
|
||||
}
|
||||
|
||||
@ -432,9 +432,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, PipeControlHelperTestsXeHPAndLater, givenPostSyncPi
|
||||
PipeControlArgs args;
|
||||
args.workloadPartitionOffset = true;
|
||||
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControlAndProgramPostSyncOperation(
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWithPostSyncOperation(
|
||||
stream,
|
||||
POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA,
|
||||
PostSyncMode::ImmediateData,
|
||||
gpuAddress,
|
||||
data,
|
||||
hardwareInfo,
|
||||
|
@ -115,7 +115,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, KernelCommandsXeHPAndLater, whenKernelSizeIsRequire
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, KernelCommandsXeHPAndLater, whenPipeControlForWaIsRequiredThenReturnFalse) {
|
||||
auto &hwInfo = pDevice->getHardwareInfo();
|
||||
EXPECT_EQ(UnitTestHelper<FamilyType>::isPipeControlWArequired(hwInfo), MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(hwInfo));
|
||||
EXPECT_EQ(UnitTestHelper<FamilyType>::isPipeControlWArequired(hwInfo), MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(hwInfo));
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, KernelCommandsXeHPAndLater, whenMediaInterfaceDescriptorLoadIsRequiredThenDoNotProgramNonExistingCommand) {
|
||||
|
@ -271,7 +271,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 (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(device->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getHardwareInfo())) {
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(*++it);
|
||||
EXPECT_NE(nullptr, pipeControl);
|
||||
}
|
||||
@ -380,7 +380,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 (MemorySynchronizationCommands<FamilyType>::isPipeControlWArequired(device->getHardwareInfo())) {
|
||||
if (MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(device->getHardwareInfo())) {
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(*++it);
|
||||
EXPECT_NE(nullptr, pipeControl);
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ HWTEST_F(TimestampPacketTests, givenPipeControlRequestWithBarrierWriteWhenEstima
|
||||
csr.stallingCommandsOnNextFlushRequired = true;
|
||||
auto sizeWithPcRequest = device->getUltCommandStreamReceiver<FamilyType>().getRequiredCmdStreamSize(flags, device->getDevice());
|
||||
|
||||
size_t extendedSize = sizeWithoutPcRequest + MemorySynchronizationCommands<FamilyType>::getSizeForPipeControlWithPostSyncOperation(device->getHardwareInfo());
|
||||
size_t extendedSize = sizeWithoutPcRequest + MemorySynchronizationCommands<FamilyType>::getSizeForBarrierWithPostSyncOperation(device->getHardwareInfo());
|
||||
|
||||
EXPECT_EQ(sizeWithPcRequest, extendedSize);
|
||||
}
|
||||
|
Reference in New Issue
Block a user