1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/command_stream/preemption_mode.h"
#include "CL/cl.h"
#include <cstdint>
namespace NEO {
class CommandQueue;
class DispatchInfo;
class IndirectHeap;
class Kernel;
class LinearStream;
struct HwPerfCounter;
struct HwTimeStamps;
struct KernelOperation;
struct MultiDispatchInfo;
template <class T>
struct TagNode;
template <typename GfxFamily>
using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
template <typename GfxFamily>
class HardwareInterface {
public:
using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA;
static void dispatchWalker(
CommandQueue &commandQueue,
const MultiDispatchInfo &multiDispatchInfo,
const CsrDependencies &csrDependencies,
KernelOperation *blockedCommandsData,
TagNode<HwTimeStamps> *hwTimeStamps,
TagNode<HwPerfCounter> *hwPerfCounter,
TimestampPacketDependencies *timestampPacketDependencies,
TimestampPacketContainer *currentTimestampPacketNodes,
uint32_t commandType);
static void getDefaultDshSpace(
const size_t &offsetInterfaceDescriptorTable,
CommandQueue &commandQueue,
const MultiDispatchInfo &multiDispatchInfo,
size_t &totalInterfaceDescriptorTableSize,
Kernel *parentKernel,
IndirectHeap *dsh,
LinearStream *commandStream);
static void dispatchWorkarounds(
LinearStream *commandStream,
CommandQueue &commandQueue,
Kernel &kernel,
const bool &enable);
static void dispatchProfilingPerfStartCommands(
TagNode<HwTimeStamps> *hwTimeStamps,
TagNode<HwPerfCounter> *hwPerfCounter,
LinearStream *commandStream,
CommandQueue &commandQueue);
static void dispatchProfilingPerfEndCommands(
TagNode<HwTimeStamps> *hwTimeStamps,
TagNode<HwPerfCounter> *hwPerfCounter,
LinearStream *commandStream,
CommandQueue &commandQueue);
static void dispatchDebugPauseCommands(
LinearStream *commandStream,
CommandQueue &commandQueue,
DebugPauseState confirmationTrigger,
DebugPauseState waitCondition);
static void programWalker(
LinearStream &commandStream,
Kernel &kernel,
CommandQueue &commandQueue,
TimestampPacketContainer *currentTimestampPacketNodes,
IndirectHeap &dsh,
IndirectHeap &ioh,
IndirectHeap &ssh,
size_t globalWorkSizes[3],
size_t localWorkSizes[3],
PreemptionMode preemptionMode,
size_t currentDispatchIndex,
uint32_t &interfaceDescriptorIndex,
const DispatchInfo &dispatchInfo,
size_t offsetInterfaceDescriptorTable,
Vec3<size_t> &numberOfWorkgroups,
Vec3<size_t> &startOfWorkgroups);
static WALKER_TYPE<GfxFamily> *allocateWalkerSpace(LinearStream &commandStream,
const Kernel &kernel);
static void obtainIndirectHeaps(CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo,
bool blockedQueue, IndirectHeap *&dsh, IndirectHeap *&ioh, IndirectHeap *&ssh);
static void dispatchKernelCommands(CommandQueue &commandQueue, const DispatchInfo &dispatchInfo, uint32_t commandType,
LinearStream &commandStream, bool isMainKernel, size_t currentDispatchIndex,
TimestampPacketContainer *currentTimestampPacketNodes, PreemptionMode preemptionMode,
uint32_t &interfaceDescriptorIndex, size_t offsetInterfaceDescriptorTable,
IndirectHeap &dsh, IndirectHeap &ioh, IndirectHeap &ssh);
};
} // namespace NEO
|