Skip to content

Commit 59683ec

Browse files
Remove device enqueue part 6
- isParentKernel, peekParentKernel, parentKernel - structs: AUBParentKernelFixture, MockParentKernel, ParentKernelCommandQueueFixture Related-To: NEO-6559 Signed-off-by: Katarzyna Cencelewska <[email protected]>
1 parent d9aae80 commit 59683ec

27 files changed

+24
-895
lines changed

opencl/source/command_queue/enqueue_common.h

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface *(&surfaces)[surfaceCount
9898
}
9999

100100
if (AuxTranslationMode::Builtin == auxTranslationMode) {
101-
UNRECOVERABLE_IF(kernel->isParentKernel);
102101
dispatchAuxTranslationBuiltin(multiDispatchInfo, AuxTranslationDirection::NonAuxToAux);
103102
}
104103

@@ -127,8 +126,6 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
127126
return;
128127
}
129128

130-
Kernel *parentKernel = multiDispatchInfo.peekParentKernel();
131-
132129
TagNodeBase *hwTimeStamps = nullptr;
133130
CommandStreamReceiver &computeCommandStreamReceiver = getGpgpuCommandStreamReceiver();
134131
auto commandStreamReceiverOwnership = computeCommandStreamReceiver.obtainUniqueOwnership();
@@ -333,11 +330,6 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
333330
updateFromCompletionStamp(completionStamp, eventBuilder.getEvent());
334331

335332
if (blockQueue) {
336-
if (parentKernel) {
337-
size_t minSizeSSHForEM = HardwareCommandsHelper<GfxFamily>::getSshSizeForExecutionModel(*parentKernel);
338-
blockedCommandsData->surfaceStateHeapSizeEM = minSizeSSHForEM;
339-
}
340-
341333
enqueueBlocked(commandType,
342334
surfacesForResidency,
343335
numSurfaceForResidency,
@@ -414,13 +406,6 @@ void CommandQueueHw<GfxFamily>::processDispatchForKernels(const MultiDispatchInf
414406
hwTimeStamps = event->getHwTimeStampNode();
415407
}
416408

417-
if (auto parentKernel = multiDispatchInfo.peekParentKernel()) {
418-
parentKernel->createReflectionSurface();
419-
parentKernel->patchDefaultDeviceQueue(context->getDefaultDeviceQueue());
420-
parentKernel->patchEventPool(context->getDefaultDeviceQueue());
421-
parentKernel->patchReflectionSurface(context->getDefaultDeviceQueue(), printfHandler.get());
422-
}
423-
424409
if (event && this->isPerfCountersEnabled()) {
425410
hwPerfCounter = event->getHwPerfCounterNode();
426411
}
@@ -761,7 +746,7 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
761746
getSliceCount(), //sliceCount
762747
blocking, //blocking
763748
shouldFlushDC(commandType, printfHandler) || allocNeedsFlushDC, //dcFlush
764-
multiDispatchInfo.usesSlm() || multiDispatchInfo.peekParentKernel(), //useSLM
749+
multiDispatchInfo.usesSlm(), //useSLM
765750
true, //guardCommandBufferWithPipeControl
766751
commandType == CL_COMMAND_NDRANGE_KERNEL, //GSBA32BitRequired
767752
requiresCoherency, //requiresCoherency
@@ -905,7 +890,7 @@ void CommandQueueHw<GfxFamily>::enqueueBlocked(
905890
}
906891

907892
PreemptionMode preemptionMode = ClPreemptionHelper::taskPreemptionMode(getDevice(), multiDispatchInfo);
908-
bool slmUsed = multiDispatchInfo.usesSlm() || multiDispatchInfo.peekParentKernel();
893+
bool slmUsed = multiDispatchInfo.usesSlm();
909894
command = std::make_unique<CommandComputeKernel>(*this,
910895
blockedCommandsData,
911896
allSurfaces,

opencl/source/command_queue/enqueue_kernel.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -43,10 +43,6 @@ cl_int CommandQueueHw<GfxFamily>::enqueueKernel(
4343
auto &kernel = *pKernel;
4444
const auto &kernelInfo = kernel.getKernelInfo();
4545

46-
if (kernel.isParentKernel && !this->context->getDefaultDeviceQueue()) {
47-
return CL_INVALID_OPERATION;
48-
}
49-
5046
if (!kernel.isPatched()) {
5147
if (event) {
5248
*event = nullptr;

opencl/source/command_queue/gpgpu_walker.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,6 @@ IndirectHeap &getIndirectHeap(CommandQueue &commandQueue, const MultiDispatchInf
129129
}
130130
// clang-format on
131131

132-
if (Kernel *parentKernel = multiDispatchInfo.peekParentKernel()) {
133-
if (heapType == IndirectHeap::SURFACE_STATE) {
134-
expectedSize += HardwareCommandsHelper<GfxFamily>::getSshSizeForExecutionModel(*parentKernel);
135-
}
136-
}
137-
138132
if (ih == nullptr)
139133
ih = &commandQueue.getIndirectHeap(heapType, expectedSize);
140134

opencl/source/command_queue/hardware_interface.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -49,7 +49,6 @@ class HardwareInterface {
4949
CommandQueue &commandQueue,
5050
const MultiDispatchInfo &multiDispatchInfo,
5151
size_t &totalInterfaceDescriptorTableSize,
52-
Kernel *parentKernel,
5352
IndirectHeap *dsh,
5453
LinearStream *commandStream);
5554

opencl/source/command_queue/hardware_interface_base.inl

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -73,7 +73,6 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
7373

7474
LinearStream *commandStream = nullptr;
7575
IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr;
76-
auto parentKernel = multiDispatchInfo.peekParentKernel();
7776
auto mainKernel = multiDispatchInfo.peekMainKernel();
7877
auto preemptionMode = ClPreemptionHelper::taskPreemptionMode(commandQueue.getDevice(), multiDispatchInfo);
7978

@@ -125,8 +124,7 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
125124

126125
size_t totalInterfaceDescriptorTableSize = sizeof(INTERFACE_DESCRIPTOR_DATA);
127126

128-
getDefaultDshSpace(offsetInterfaceDescriptorTable, commandQueue, multiDispatchInfo, totalInterfaceDescriptorTableSize,
129-
parentKernel, dsh, commandStream);
127+
getDefaultDshSpace(offsetInterfaceDescriptorTable, commandQueue, multiDispatchInfo, totalInterfaceDescriptorTableSize, dsh, commandStream);
130128

131129
// Program media interface descriptor load
132130
HardwareCommandsHelper<GfxFamily>::sendMediaInterfaceDescriptorLoad(
@@ -255,22 +253,13 @@ void HardwareInterface<GfxFamily>::dispatchKernelCommands(CommandQueue &commandQ
255253
template <typename GfxFamily>
256254
void HardwareInterface<GfxFamily>::obtainIndirectHeaps(CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo,
257255
bool blockedQueue, IndirectHeap *&dsh, IndirectHeap *&ioh, IndirectHeap *&ssh) {
258-
auto parentKernel = multiDispatchInfo.peekParentKernel();
259-
260256
if (blockedQueue) {
261257
size_t dshSize = 0;
262258
size_t colorCalcSize = 0;
263259
size_t sshSize = HardwareCommandsHelper<GfxFamily>::getTotalSizeRequiredSSH(multiDispatchInfo);
264260
bool iohEqualsDsh = false;
265261

266-
if (parentKernel) {
267-
dshSize = commandQueue.getContext().getDefaultDeviceQueue()->getDshBuffer()->getUnderlyingBufferSize();
268-
sshSize += HardwareCommandsHelper<GfxFamily>::getSshSizeForExecutionModel(*parentKernel);
269-
iohEqualsDsh = true;
270-
colorCalcSize = static_cast<size_t>(commandQueue.getContext().getDefaultDeviceQueue()->colorCalcStateSize);
271-
} else {
272-
dshSize = HardwareCommandsHelper<GfxFamily>::getTotalSizeRequiredDSH(multiDispatchInfo);
273-
}
262+
dshSize = HardwareCommandsHelper<GfxFamily>::getTotalSizeRequiredDSH(multiDispatchInfo);
274263

275264
commandQueue.allocateHeapMemory(IndirectHeap::DYNAMIC_STATE, dshSize, dsh);
276265
dsh->getSpace(colorCalcSize);
@@ -284,12 +273,6 @@ void HardwareInterface<GfxFamily>::obtainIndirectHeaps(CommandQueue &commandQueu
284273
HardwareCommandsHelper<GfxFamily>::getTotalSizeRequiredIOH(multiDispatchInfo), ioh);
285274
}
286275
} else {
287-
if (parentKernel && (commandQueue.getIndirectHeap(IndirectHeap::SURFACE_STATE, 0).getUsed() > 0)) {
288-
commandQueue.releaseIndirectHeap(IndirectHeap::SURFACE_STATE);
289-
// clean reserved bindless offsets
290-
ssh = &getIndirectHeap<GfxFamily, IndirectHeap::SURFACE_STATE>(commandQueue, multiDispatchInfo);
291-
ssh->replaceBuffer(ssh->getCpuBase(), ssh->getMaxAvailableSpace());
292-
}
293276
dsh = &getIndirectHeap<GfxFamily, IndirectHeap::DYNAMIC_STATE>(commandQueue, multiDispatchInfo);
294277
ioh = &getIndirectHeap<GfxFamily, IndirectHeap::INDIRECT_OBJECT>(commandQueue, multiDispatchInfo);
295278
ssh = &getIndirectHeap<GfxFamily, IndirectHeap::SURFACE_STATE>(commandQueue, multiDispatchInfo);

opencl/source/command_queue/hardware_interface_bdw_and_later.inl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 Intel Corporation
2+
* Copyright (C) 2019-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -19,18 +19,13 @@ inline void HardwareInterface<GfxFamily>::getDefaultDshSpace(
1919
CommandQueue &commandQueue,
2020
const MultiDispatchInfo &multiDispatchInfo,
2121
size_t &totalInterfaceDescriptorTableSize,
22-
Kernel *parentKernel,
2322
IndirectHeap *dsh,
2423
LinearStream *commandStream) {
2524

2625
size_t numDispatches = multiDispatchInfo.size();
2726
totalInterfaceDescriptorTableSize *= numDispatches;
2827

29-
if (!parentKernel) {
30-
dsh->getSpace(totalInterfaceDescriptorTableSize);
31-
} else {
32-
dsh->getSpace(commandQueue.getContext().getDefaultDeviceQueue()->getDshOffset() - dsh->getUsed());
33-
}
28+
dsh->getSpace(totalInterfaceDescriptorTableSize);
3429
}
3530

3631
template <typename GfxFamily>

opencl/source/command_queue/hardware_interface_xehp_and_later.inl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -24,13 +24,8 @@ inline void HardwareInterface<GfxFamily>::getDefaultDshSpace(
2424
CommandQueue &commandQueue,
2525
const MultiDispatchInfo &multiDispatchInfo,
2626
size_t &totalInterfaceDescriptorTableSize,
27-
Kernel *parentKernel,
2827
IndirectHeap *dsh,
2928
LinearStream *commandStream) {
30-
31-
if (parentKernel) {
32-
dsh->getSpace(commandQueue.getContext().getDefaultDeviceQueue()->getDshOffset() - dsh->getUsed());
33-
}
3429
}
3530

3631
template <typename GfxFamily>

opencl/source/gtpin/gtpin_callbacks.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -72,7 +72,7 @@ void gtpinNotifyKernelCreate(cl_kernel kernel) {
7272
// Enlarge local copy of SSH by 1 SS
7373
GFXCORE_FAMILY genFamily = device.getHardwareInfo().platform.eRenderCoreFamily;
7474
GTPinHwHelper &gtpinHelper = GTPinHwHelper::get(genFamily);
75-
if (pKernel->isParentKernel || !gtpinHelper.addSurfaceState(pKernel)) {
75+
if (!gtpinHelper.addSurfaceState(pKernel)) {
7676
// Kernel with no SSH or Kernel EM, not supported
7777
return;
7878
}
@@ -117,7 +117,7 @@ void gtpinNotifyKernelSubmit(cl_kernel kernel, void *pCmdQueue) {
117117
auto rootDeviceIndex = device.getRootDeviceIndex();
118118
auto pMultiDeviceKernel = castToObjectOrAbort<MultiDeviceKernel>(kernel);
119119
auto pKernel = pMultiDeviceKernel->getKernel(rootDeviceIndex);
120-
if (pKernel->isParentKernel || pKernel->getSurfaceStateHeapSize() == 0) {
120+
if (pKernel->getSurfaceStateHeapSize() == 0) {
121121
// Kernel with no SSH, not supported
122122
return;
123123
}

opencl/source/gtpin/gtpin_hw_helper.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -20,7 +20,7 @@ bool GTPinHwHelperHw<GfxFamily>::addSurfaceState(Kernel *pKernel) {
2020
using BINDING_TABLE_STATE = typename GfxFamily::BINDING_TABLE_STATE;
2121

2222
size_t sshSize = pKernel->getSurfaceStateHeapSize();
23-
if ((sshSize == 0) || pKernel->isParentKernel) {
23+
if (sshSize == 0) {
2424
// Kernels which do not use SSH or use Execution Model are not supported (yet)
2525
return false;
2626
}

opencl/source/helpers/dispatch_info.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -33,10 +33,6 @@ Kernel *MultiDispatchInfo::peekMainKernel() const {
3333
return mainKernel ? mainKernel : dispatchInfos.begin()->getKernel();
3434
}
3535

36-
Kernel *MultiDispatchInfo::peekParentKernel() const {
37-
return (mainKernel && mainKernel->isParentKernel) ? mainKernel : nullptr;
38-
}
39-
4036
void MultiDispatchInfo::backupUnifiedMemorySyncRequirement() {
4137
for (const auto &dispatchInfo : dispatchInfos) {
4238
dispatchInfo.getKernel()->setUnifiedMemorySyncRequirement(true);

opencl/source/helpers/dispatch_info.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -187,7 +187,6 @@ struct MultiDispatchInfo {
187187
redescribedSurfaces.push_back(memObj.release());
188188
}
189189

190-
Kernel *peekParentKernel() const;
191190
Kernel *peekMainKernel() const;
192191

193192
void setBuiltinOpParams(const BuiltinOpParams &builtinOpParams) {

opencl/source/helpers/task_information.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,10 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
140140
return completionStamp;
141141
}
142142
auto &commandStreamReceiver = commandQueue.getGpgpuCommandStreamReceiver();
143-
bool executionModelKernel = kernel->isParentKernel;
144-
auto devQueue = commandQueue.getContext().getDefaultDeviceQueue();
145143
auto bcsCsrForAuxTranslation = commandQueue.getBcsForAuxTranslation();
146144

147145
auto commandStreamReceiverOwnership = commandStreamReceiver.obtainUniqueOwnership();
148146

149-
if (executionModelKernel) {
150-
while (!devQueue->isEMCriticalSectionFree())
151-
;
152-
153-
devQueue->resetDeviceQueue();
154-
devQueue->acquireEMCriticalSection();
155-
}
156-
157147
IndirectHeap *dsh = kernelOperation->dsh.get();
158148
IndirectHeap *ioh = kernelOperation->ioh.get();
159149
IndirectHeap *ssh = kernelOperation->ssh.get();

0 commit comments

Comments
 (0)