Skip to content

Commit e1f42c2

Browse files
Remove TSP atomic dependency tracking
This reverts commit d17668f023bee409ee68e766bbc7d5f16ce8d52b. Signed-off-by: Bartosz Dunajski <[email protected]>
1 parent 13b9f54 commit e1f42c2

24 files changed

+58
-459
lines changed

opencl/source/built_ins/aux_translation_builtin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class BuiltInOp<EBuiltInOps::AuxTranslation> : public BuiltinDispatchInfoBuilder
8080
using RegisteredMethodDispatcherT = RegisteredMethodDispatcher<DispatchInfo::DispatchCommandMethodT,
8181
DispatchInfo::EstimateCommandsMethodT>;
8282
template <typename GfxFamily, bool dcFlush>
83-
static void dispatchPipeControl(LinearStream &linearStream, TimestampPacketDependencies *, const HardwareInfo &, uint32_t) {
83+
static void dispatchPipeControl(LinearStream &linearStream, TimestampPacketDependencies *, const HardwareInfo &) {
8484
PipeControlArgs args(dcFlush);
8585
MemorySynchronizationCommands<GfxFamily>::addPipeControl(linearStream, args);
8686
}

opencl/source/command_queue/command_queue_hw_base.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ bool CommandQueueHw<Family>::isCacheFlushForBcsRequired() const {
137137
template <typename Family>
138138
void CommandQueueHw<Family>::setupBlitAuxTranslation(MultiDispatchInfo &multiDispatchInfo) {
139139
multiDispatchInfo.begin()->dispatchInitCommands.registerMethod(
140-
TimestampPacketHelper::programSemaphoreWithImplicitDependencyForAuxTranslation<Family, AuxTranslationDirection::AuxToNonAux>);
140+
TimestampPacketHelper::programSemaphoreForAuxTranslation<Family, AuxTranslationDirection::AuxToNonAux>);
141141

142142
multiDispatchInfo.begin()->dispatchInitCommands.registerCommandsSizeEstimationMethod(
143143
TimestampPacketHelper::getRequiredCmdStreamSizeForAuxTranslationNodeDependency<Family, AuxTranslationDirection::AuxToNonAux>);
144144

145145
multiDispatchInfo.rbegin()->dispatchEpilogueCommands.registerMethod(
146-
TimestampPacketHelper::programSemaphoreWithImplicitDependencyForAuxTranslation<Family, AuxTranslationDirection::NonAuxToAux>);
146+
TimestampPacketHelper::programSemaphoreForAuxTranslation<Family, AuxTranslationDirection::NonAuxToAux>);
147147

148148
multiDispatchInfo.rbegin()->dispatchEpilogueCommands.registerCommandsSizeEstimationMethod(
149149
TimestampPacketHelper::getRequiredCmdStreamSizeForAuxTranslationNodeDependency<Family, AuxTranslationDirection::NonAuxToAux>);

opencl/source/command_queue/enqueue_common.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
275275
}
276276

277277
if (flushDependenciesForNonKernelCommand) {
278-
TimestampPacketHelper::programCsrDependenciesForTimestampPacketContainer<GfxFamily>(
279-
commandStream,
280-
csrDeps,
281-
getGpgpuCommandStreamReceiver().getOsContext().getNumSupportedDevices());
278+
TimestampPacketHelper::programCsrDependenciesForTimestampPacketContainer<GfxFamily>(commandStream, csrDeps);
282279
}
283280

284281
if (isMarkerWithProfiling) {
@@ -511,8 +508,7 @@ BlitProperties CommandQueueHw<GfxFamily>::processDispatchForBlitEnqueue(const Mu
511508
args);
512509
}
513510

514-
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(*commandStream, *currentTimestampPacketNode,
515-
getGpgpuCommandStreamReceiver().getOsContext().getNumSupportedDevices());
511+
TimestampPacketHelper::programSemaphore<GfxFamily>(*commandStream, *currentTimestampPacketNode);
516512
}
517513
return blitProperties;
518514
}
@@ -570,10 +566,7 @@ void CommandQueueHw<GfxFamily>::processDispatchForCacheFlush(Surface **surfaces,
570566
LinearStream *commandStream,
571567
CsrDependencies &csrDeps) {
572568

573-
TimestampPacketHelper::programCsrDependenciesForTimestampPacketContainer<GfxFamily>(
574-
*commandStream,
575-
csrDeps,
576-
getGpgpuCommandStreamReceiver().getOsContext().getNumSupportedDevices());
569+
TimestampPacketHelper::programCsrDependenciesForTimestampPacketContainer<GfxFamily>(*commandStream, csrDeps);
577570

578571
uint64_t postSyncAddress = 0;
579572
if (getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {

opencl/source/command_queue/hardware_interface_base.inl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
106106
mainKernel->areMultipleSubDevicesInContext());
107107
}
108108

109-
auto numSupportedDevices = commandQueue.getGpgpuCommandStreamReceiver().getOsContext().getNumSupportedDevices();
110-
TimestampPacketHelper::programCsrDependenciesForTimestampPacketContainer<GfxFamily>(*commandStream, csrDependencies, numSupportedDevices);
109+
TimestampPacketHelper::programCsrDependenciesForTimestampPacketContainer<GfxFamily>(*commandStream, csrDependencies);
111110

112111
dsh->align(EncodeStates<GfxFamily>::alignInterfaceDescriptorData);
113112

@@ -141,15 +140,15 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
141140

142141
size_t currentDispatchIndex = 0;
143142
for (auto &dispatchInfo : multiDispatchInfo) {
144-
dispatchInfo.dispatchInitCommands(*commandStream, timestampPacketDependencies, commandQueue.getDevice().getHardwareInfo(), numSupportedDevices);
143+
dispatchInfo.dispatchInitCommands(*commandStream, timestampPacketDependencies, commandQueue.getDevice().getHardwareInfo());
145144
bool isMainKernel = (dispatchInfo.getKernel() == mainKernel);
146145

147146
dispatchKernelCommands(commandQueue, dispatchInfo, commandType, *commandStream, isMainKernel,
148147
currentDispatchIndex, currentTimestampPacketNodes, preemptionMode, interfaceDescriptorIndex,
149148
offsetInterfaceDescriptorTable, *dsh, *ioh, *ssh);
150149

151150
currentDispatchIndex++;
152-
dispatchInfo.dispatchEpilogueCommands(*commandStream, timestampPacketDependencies, commandQueue.getDevice().getHardwareInfo(), numSupportedDevices);
151+
dispatchInfo.dispatchEpilogueCommands(*commandStream, timestampPacketDependencies, commandQueue.getDevice().getHardwareInfo());
153152
}
154153

155154
if (mainKernel->requiresCacheFlushCommand(commandQueue)) {

opencl/source/helpers/dispatch_info.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct TimestampPacketDependencies;
2828
class DispatchInfo {
2929

3030
public:
31-
using DispatchCommandMethodT = void(LinearStream &commandStream, TimestampPacketDependencies *timestampPacketDependencies, const HardwareInfo &, uint32_t);
31+
using DispatchCommandMethodT = void(LinearStream &commandStream, TimestampPacketDependencies *timestampPacketDependencies, const HardwareInfo &);
3232
using EstimateCommandsMethodT = size_t(size_t, const HardwareInfo &, bool);
3333

3434
DispatchInfo() = default;

opencl/source/kernel/kernel.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,10 @@ bool Kernel::hasTunningFinished(KernelSubmissionData &submissionData) {
11491149

11501150
bool Kernel::hasRunFinished(TimestampPacketContainer *timestampContainer) {
11511151
for (const auto &node : timestampContainer->peekNodes()) {
1152-
if (!node->isCompleted()) {
1153-
return false;
1152+
for (uint32_t i = 0; i < node->getPacketsUsed(); i++) {
1153+
if (node->getContextEndValue(i) == 1) {
1154+
return false;
1155+
}
11541156
}
11551157
}
11561158
return true;

opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ HWTEST_F(BcsTests, WhenGetNumberOfBlitsIsCalledThenCorrectValuesAreReturned) {
203203
}
204204
}
205205

206-
HWTEST_F(BcsTests, givenCsrDependenciesWhenProgrammingCommandStreamThenAddSemaphoreAndAtomic) {
206+
HWTEST_F(BcsTests, givenCsrDependenciesWhenProgrammingCommandStreamThenAddSemaphore) {
207207
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
208208

209209
cl_int retVal = CL_SUCCESS;
@@ -243,12 +243,9 @@ HWTEST_F(BcsTests, givenCsrDependenciesWhenProgrammingCommandStreamThenAddSemaph
243243
}
244244
dependenciesFound = true;
245245
EXPECT_FALSE(xyCopyBltCmdFound);
246-
auto miAtomic = genCmdCast<typename FamilyType::MI_ATOMIC *>(*(++cmdIterator));
247-
EXPECT_NE(nullptr, miAtomic);
248246

249247
for (uint32_t i = 1; i < numberOfDependencyContainers * numberNodesPerContainer; i++) {
250248
EXPECT_NE(nullptr, genCmdCast<typename FamilyType::MI_SEMAPHORE_WAIT *>(*(++cmdIterator)));
251-
EXPECT_NE(nullptr, genCmdCast<typename FamilyType::MI_ATOMIC *>(*(++cmdIterator)));
252249
}
253250
}
254251
}

opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ HWTEST_F(CommandStreamReceiverTest, WhenCreatingCsrThenTimestampTypeIs32b) {
8383
auto allocator = csr.getTimestampPacketAllocator();
8484
auto tag = allocator->getTag();
8585

86-
auto expectedOffset = sizeof(typename FamilyType::TimestampPacketType) * 4 * static_cast<size_t>(TimestampPacketSizeControl::preferredPacketCount);
86+
auto expectedOffset = sizeof(typename FamilyType::TimestampPacketType);
8787

88-
EXPECT_EQ(expectedOffset, tag->getImplicitGpuDependenciesCountOffset());
88+
EXPECT_EQ(expectedOffset, tag->getGlobalStartOffset());
8989
}
9090

9191
HWTEST_F(CommandStreamReceiverTest, WhenCreatingCsrThenFlagsAreSetCorrectly) {

opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,6 @@ struct CommandStreamReceiverTagTests : public ::testing::Test {
297297
tag->assignDataToAllTimestamps(i, zeros);
298298
}
299299

300-
EXPECT_TRUE(tag->isCompleted());
301-
302300
bool canBeReleased = tag->canBeReleased();
303301
allocator->returnTag(tag);
304302

opencl/test/unit_test/event/event_tests.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,8 +1129,6 @@ HWTEST_F(EventTest, WhenGettingHwTimeStampsThenValidPointerIsReturned) {
11291129
ASSERT_EQ(0ULL, timeStamps->GlobalCompleteTS);
11301130
ASSERT_EQ(0ULL, timeStamps->ContextCompleteTS);
11311131

1132-
EXPECT_TRUE(event->getHwTimeStampNode()->isCompleted());
1133-
11341132
HwTimeStamps *timeStamps2 = static_cast<TagNode<HwTimeStamps> *>(event->getHwTimeStampNode())->tagForCpuAccess;
11351133
ASSERT_EQ(timeStamps, timeStamps2);
11361134
}

0 commit comments

Comments
 (0)