66 */
77
88#pragma once
9- #include " runtime/command_queue/hardware_interface/hardware_interface.h"
10- #include " runtime/utilities/tag_allocator.h"
9+ #include " runtime/command_queue/hardware_interface.h"
10+ #include " runtime/helpers/kernel_commands.h"
11+ #include " runtime/helpers/task_information.h"
1112
1213namespace OCLRT {
1314
@@ -19,15 +20,15 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
1920 const cl_event *eventWaitList,
2021 KernelOperation **blockedCommandsData,
2122 HwTimeStamps *hwTimeStamps,
22- OCLRT:: HwPerfCounter *hwPerfCounter,
23+ HwPerfCounter *hwPerfCounter,
2324 TagNode<TimestampPacket> *previousTimestampPacketNode,
2425 TimestampPacket *currentTimestampPacket,
2526 PreemptionMode preemptionMode,
2627 bool blockQueue,
2728 uint32_t commandType) {
2829
29- OCLRT:: LinearStream *commandStream = nullptr ;
30- OCLRT:: IndirectHeap *dsh = nullptr , *ioh = nullptr , *ssh = nullptr ;
30+ LinearStream *commandStream = nullptr ;
31+ IndirectHeap *dsh = nullptr , *ioh = nullptr , *ssh = nullptr ;
3132 auto parentKernel = multiDispatchInfo.peekParentKernel ();
3233
3334 for (auto &dispatchInfo : multiDispatchInfo) {
@@ -245,97 +246,4 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
245246 dispatchProfilingPerfEndCommands (hwTimeStamps, hwPerfCounter, commandStream, commandQueue);
246247}
247248
248- template <typename GfxFamily>
249- inline void BaseInterfaceVersion<GfxFamily>::getDefaultDshSpace(
250- const size_t &offsetInterfaceDescriptorTable,
251- CommandQueue &commandQueue,
252- const MultiDispatchInfo &multiDispatchInfo,
253- size_t &totalInterfaceDescriptorTableSize,
254- OCLRT::Kernel *parentKernel,
255- OCLRT::IndirectHeap *dsh,
256- OCLRT::LinearStream *commandStream) {
257-
258- size_t numDispatches = multiDispatchInfo.size ();
259- totalInterfaceDescriptorTableSize *= numDispatches;
260-
261- if (!parentKernel) {
262- dsh->getSpace (totalInterfaceDescriptorTableSize);
263- } else {
264- dsh->getSpace (commandQueue.getContext ().getDefaultDeviceQueue ()->getDshOffset () - dsh->getUsed ());
265- }
266- }
267-
268- template <typename GfxFamily>
269- inline typename BaseInterfaceVersion<GfxFamily>::INTERFACE_DESCRIPTOR_DATA *
270- BaseInterfaceVersion<GfxFamily>::obtainInterfaceDescriptorData(
271- WALKER_HANDLE pCmdData) {
272-
273- return nullptr ;
274- }
275-
276- template <typename GfxFamily>
277- inline void BaseInterfaceVersion<GfxFamily>::setOffsetCrossThreadData(
278- WALKER_HANDLE pCmdData,
279- size_t &offsetCrossThreadData,
280- uint32_t &interfaceDescriptorIndex) {
281-
282- WALKER_TYPE<GfxFamily> *pCmd = static_cast <WALKER_TYPE<GfxFamily> *>(pCmdData);
283- pCmd->setIndirectDataStartAddress (static_cast <uint32_t >(offsetCrossThreadData));
284- pCmd->setInterfaceDescriptorOffset (interfaceDescriptorIndex++);
285- }
286-
287- template <typename GfxFamily>
288- inline void BaseInterfaceVersion<GfxFamily>::dispatchWorkarounds(
289- OCLRT::LinearStream *commandStream,
290- CommandQueue &commandQueue,
291- OCLRT::Kernel &kernel,
292- const bool &enable) {
293-
294- if (enable) {
295- PreemptionHelper::applyPreemptionWaCmdsBegin<GfxFamily>(commandStream, commandQueue.getDevice ());
296- // Implement enabling special WA DisableLSQCROPERFforOCL if needed
297- GpgpuWalkerHelper<GfxFamily>::applyWADisableLSQCROPERFforOCL (commandStream, kernel, enable);
298- } else {
299- // Implement disabling special WA DisableLSQCROPERFforOCL if needed
300- GpgpuWalkerHelper<GfxFamily>::applyWADisableLSQCROPERFforOCL (commandStream, kernel, enable);
301- PreemptionHelper::applyPreemptionWaCmdsEnd<GfxFamily>(commandStream, commandQueue.getDevice ());
302- }
303- }
304-
305- template <typename GfxFamily>
306- inline void BaseInterfaceVersion<GfxFamily>::dispatchProfilingPerfStartCommands(
307- const OCLRT::DispatchInfo &dispatchInfo,
308- const MultiDispatchInfo &multiDispatchInfo,
309- HwTimeStamps *hwTimeStamps,
310- OCLRT::HwPerfCounter *hwPerfCounter,
311- OCLRT::LinearStream *commandStream,
312- CommandQueue &commandQueue) {
313-
314- if (&dispatchInfo == &*multiDispatchInfo.begin ()) {
315- // If hwTimeStampAlloc is passed (not nullptr), then we know that profiling is enabled
316- if (hwTimeStamps != nullptr ) {
317- GpgpuWalkerHelper<GfxFamily>::dispatchProfilingCommandsStart (*hwTimeStamps, commandStream);
318- }
319- if (hwPerfCounter != nullptr ) {
320- GpgpuWalkerHelper<GfxFamily>::dispatchPerfCountersCommandsStart (commandQueue, *hwPerfCounter, commandStream);
321- }
322- }
323- }
324-
325- template <typename GfxFamily>
326- inline void BaseInterfaceVersion<GfxFamily>::dispatchProfilingPerfEndCommands(
327- HwTimeStamps *hwTimeStamps,
328- OCLRT::HwPerfCounter *hwPerfCounter,
329- OCLRT::LinearStream *commandStream,
330- CommandQueue &commandQueue) {
331-
332- // If hwTimeStamps is passed (not nullptr), then we know that profiling is enabled
333- if (hwTimeStamps != nullptr ) {
334- GpgpuWalkerHelper<GfxFamily>::dispatchProfilingCommandsEnd (*hwTimeStamps, commandStream);
335- }
336- if (hwPerfCounter != nullptr ) {
337- GpgpuWalkerHelper<GfxFamily>::dispatchPerfCountersCommandsEnd (commandQueue, *hwPerfCounter, commandStream);
338- }
339- }
340-
341249} // namespace OCLRT
0 commit comments