2018-09-27 21:22:36 +08:00
|
|
|
/*
|
2019-01-10 22:46:02 +08:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-09-27 21:22:36 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2019-07-12 22:50:14 +08:00
|
|
|
#include "core/command_stream/preemption_mode.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
|
|
|
#include "CL/cl.h"
|
|
|
|
|
2018-09-27 21:22:36 +08:00
|
|
|
#include <cstdint>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-09-27 21:22:36 +08:00
|
|
|
|
|
|
|
class CommandQueue;
|
|
|
|
class DispatchInfo;
|
|
|
|
class IndirectHeap;
|
|
|
|
class Kernel;
|
|
|
|
class LinearStream;
|
|
|
|
struct HwPerfCounter;
|
|
|
|
struct HwTimeStamps;
|
|
|
|
struct KernelOperation;
|
|
|
|
struct MultiDispatchInfo;
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
struct TagNode;
|
|
|
|
|
2018-09-28 22:16:18 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
|
2018-09-27 21:22:36 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
class HardwareInterface {
|
|
|
|
public:
|
|
|
|
using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA;
|
|
|
|
|
|
|
|
static void dispatchWalker(
|
|
|
|
CommandQueue &commandQueue,
|
|
|
|
const MultiDispatchInfo &multiDispatchInfo,
|
2019-01-25 17:20:32 +08:00
|
|
|
const CsrDependencies &csrDependencies,
|
2019-07-19 03:15:50 +08:00
|
|
|
KernelOperation *blockedCommandsData,
|
2018-12-21 20:05:21 +08:00
|
|
|
TagNode<HwTimeStamps> *hwTimeStamps,
|
2019-04-18 18:25:29 +08:00
|
|
|
TagNode<HwPerfCounter> *hwPerfCounter,
|
2018-10-03 05:37:30 +08:00
|
|
|
TimestampPacketContainer *previousTimestampPacketNodes,
|
|
|
|
TimestampPacketContainer *currentTimestampPacketNodes,
|
2019-07-19 03:15:50 +08:00
|
|
|
uint32_t commandType);
|
2018-09-27 21:22:36 +08:00
|
|
|
|
|
|
|
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(
|
2018-12-21 20:05:21 +08:00
|
|
|
TagNode<HwTimeStamps> *hwTimeStamps,
|
2019-04-18 18:25:29 +08:00
|
|
|
TagNode<HwPerfCounter> *hwPerfCounter,
|
2018-09-27 21:22:36 +08:00
|
|
|
LinearStream *commandStream,
|
|
|
|
CommandQueue &commandQueue);
|
|
|
|
|
|
|
|
static void dispatchProfilingPerfEndCommands(
|
2018-12-21 20:05:21 +08:00
|
|
|
TagNode<HwTimeStamps> *hwTimeStamps,
|
2019-04-18 18:25:29 +08:00
|
|
|
TagNode<HwPerfCounter> *hwPerfCounter,
|
2018-09-27 21:22:36 +08:00
|
|
|
LinearStream *commandStream,
|
|
|
|
CommandQueue &commandQueue);
|
2018-09-28 22:16:18 +08:00
|
|
|
|
2019-01-10 22:46:02 +08:00
|
|
|
static void programWalker(
|
|
|
|
LinearStream &commandStream,
|
|
|
|
Kernel &kernel,
|
|
|
|
CommandQueue &commandQueue,
|
|
|
|
TimestampPacketContainer *currentTimestampPacketNodes,
|
|
|
|
IndirectHeap &dsh,
|
|
|
|
IndirectHeap &ioh,
|
|
|
|
IndirectHeap &ssh,
|
2019-01-11 18:32:27 +08:00
|
|
|
size_t globalWorkSizes[3],
|
2019-01-10 22:46:02 +08:00
|
|
|
size_t localWorkSizes[3],
|
|
|
|
PreemptionMode preemptionMode,
|
|
|
|
size_t currentDispatchIndex,
|
|
|
|
uint32_t &interfaceDescriptorIndex,
|
|
|
|
const DispatchInfo &dispatchInfo,
|
2019-01-11 18:32:27 +08:00
|
|
|
size_t offsetInterfaceDescriptorTable,
|
|
|
|
Vec3<size_t> &numberOfWorkgroups,
|
|
|
|
Vec3<size_t> &startOfWorkgroups);
|
2019-01-10 22:46:02 +08:00
|
|
|
|
2018-09-28 22:16:18 +08:00
|
|
|
static WALKER_TYPE<GfxFamily> *allocateWalkerSpace(LinearStream &commandStream,
|
|
|
|
const Kernel &kernel);
|
2019-07-17 15:06:34 +08:00
|
|
|
|
|
|
|
static void obtainIndirectHeaps(CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo,
|
|
|
|
bool blockedQueue, IndirectHeap *&dsh, IndirectHeap *&ioh, IndirectHeap *&ssh);
|
2019-07-18 15:10:05 +08:00
|
|
|
|
|
|
|
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);
|
2018-09-27 21:22:36 +08:00
|
|
|
};
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|