Skip to content

Commit a4f1cf1

Browse files
kgibalaCompute-Runtime-Automation
authored andcommitted
Force lowest NumberOfCCSEnabled in ULTs
Signed-off-by: Krzysztof Gibala <[email protected]>
1 parent e295e74 commit a4f1cf1

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,10 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleWh
931931
typedef typename FamilyType::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
932932
typedef typename FamilyType::MI_BATCH_BUFFER_END MI_BATCH_BUFFER_END;
933933

934-
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
934+
hardwareInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;
935+
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo, 0u));
936+
auto &commandStreamReceiver = mockDevice->getUltCommandStreamReceiver<FamilyType>();
937+
935938
commandStreamReceiver.timestampPacketWriteEnabled = false;
936939
// Force a PIPE_CONTROL through a taskLevel transition
937940
taskLevel = commandStreamReceiver.peekTaskLevel() + 1;
@@ -941,8 +944,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleWh
941944
commandStreamReceiver.lastSentL3Config = l3Config;
942945

943946
auto &csrCS = commandStreamReceiver.getCS();
944-
size_t sizeNeededForPreamble = commandStreamReceiver.getRequiredCmdSizeForPreamble(*pDevice);
945-
size_t sizeNeeded = commandStreamReceiver.getRequiredCmdStreamSize(flushTaskFlags, *pDevice);
947+
size_t sizeNeededForPreamble = commandStreamReceiver.getRequiredCmdSizeForPreamble(*mockDevice);
948+
size_t sizeNeeded = commandStreamReceiver.getRequiredCmdStreamSize(flushTaskFlags, *mockDevice);
946949
sizeNeeded -= sizeof(MI_BATCH_BUFFER_START); // no task to submit
947950
sizeNeeded += sizeof(MI_BATCH_BUFFER_END); // no task to submit, add BBE to CSR stream
948951
sizeNeeded = alignUp(sizeNeeded, MemoryConstants::cacheLineSize);
@@ -960,19 +963,22 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn
960963
typedef typename FamilyType::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
961964
typedef typename FamilyType::MI_BATCH_BUFFER_END MI_BATCH_BUFFER_END;
962965

963-
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
966+
hardwareInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;
967+
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo, 0u));
968+
auto &commandStreamReceiver = mockDevice->getUltCommandStreamReceiver<FamilyType>();
969+
964970
commandStreamReceiver.timestampPacketWriteEnabled = false;
965971
// Force a PIPE_CONTROL through a taskLevel transition
966972
taskLevel = commandStreamReceiver.peekTaskLevel() + 1;
967973
commandStreamReceiver.lastSentCoherencyRequest = 0;
968974

969-
auto l3Config = PreambleHelper<FamilyType>::getL3Config(pDevice->getHardwareInfo(), false);
975+
auto l3Config = PreambleHelper<FamilyType>::getL3Config(mockDevice->getHardwareInfo(), false);
970976
commandStreamReceiver.lastSentL3Config = l3Config;
971977

972978
auto &csrCS = commandStreamReceiver.getCS();
973-
size_t sizeNeededForPreamble = commandStreamReceiver.getRequiredCmdSizeForPreamble(*pDevice);
979+
size_t sizeNeededForPreamble = commandStreamReceiver.getRequiredCmdSizeForPreamble(*mockDevice);
974980
size_t sizeNeededForStateBaseAddress = sizeof(STATE_BASE_ADDRESS) + sizeof(PIPE_CONTROL);
975-
size_t sizeNeeded = commandStreamReceiver.getRequiredCmdStreamSize(flushTaskFlags, *pDevice);
981+
size_t sizeNeeded = commandStreamReceiver.getRequiredCmdStreamSize(flushTaskFlags, *mockDevice);
976982
sizeNeeded -= sizeof(MI_BATCH_BUFFER_START); // no task to submit
977983
sizeNeeded += sizeof(MI_BATCH_BUFFER_END); // no task to submit, add BBE to CSR stream
978984
sizeNeeded = alignUp(sizeNeeded, MemoryConstants::cacheLineSize);
@@ -992,18 +998,21 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn
992998

993999
commandStream.getSpace(sizeof(PIPE_CONTROL));
9941000

995-
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
1001+
hardwareInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;
1002+
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo, 0u));
1003+
auto &commandStreamReceiver = mockDevice->getUltCommandStreamReceiver<FamilyType>();
1004+
9961005
commandStreamReceiver.timestampPacketWriteEnabled = false;
9971006
// Force a PIPE_CONTROL through a taskLevel transition
9981007
taskLevel = commandStreamReceiver.peekTaskLevel() + 1;
9991008

10001009
commandStreamReceiver.lastSentCoherencyRequest = 0;
10011010

1002-
auto l3Config = PreambleHelper<FamilyType>::getL3Config(pDevice->getHardwareInfo(), false);
1011+
auto l3Config = PreambleHelper<FamilyType>::getL3Config(mockDevice->getHardwareInfo(), false);
10031012
commandStreamReceiver.lastSentL3Config = l3Config;
10041013

10051014
auto &csrCS = commandStreamReceiver.getCS();
1006-
size_t sizeNeeded = commandStreamReceiver.getRequiredCmdStreamSizeAligned(flushTaskFlags, *pDevice);
1015+
size_t sizeNeeded = commandStreamReceiver.getRequiredCmdStreamSizeAligned(flushTaskFlags, *mockDevice);
10071016

10081017
csrCS.getSpace(csrCS.getAvailableSpace() - sizeNeeded);
10091018
auto expectedBase = csrCS.getCpuBase();

0 commit comments

Comments
 (0)