mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Simplify WALKER_TYPE definition
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0e33279031
commit
4bf4b170f1
@@ -30,13 +30,13 @@ namespace NEO {
|
||||
|
||||
struct RootDeviceEnvironment;
|
||||
|
||||
template <typename GfxFamily>
|
||||
using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
|
||||
template <typename GfxFamily>
|
||||
using MI_STORE_REG_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM_CMD;
|
||||
|
||||
template <typename GfxFamily>
|
||||
class GpgpuWalkerHelper {
|
||||
using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
|
||||
|
||||
public:
|
||||
static void applyWADisableLSQCROPERFforOCL(LinearStream *pCommandStream,
|
||||
const Kernel &kernel,
|
||||
@@ -46,7 +46,7 @@ class GpgpuWalkerHelper {
|
||||
static size_t getSizeForWaDisableRccRhwoOptimization(const Kernel *pKernel);
|
||||
|
||||
static size_t setGpgpuWalkerThreadData(
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
const KernelDescriptor &kernelDescriptor,
|
||||
const size_t globalOffsets[3],
|
||||
const size_t startWorkGroups[3],
|
||||
@@ -80,7 +80,7 @@ class GpgpuWalkerHelper {
|
||||
|
||||
static void setupTimestampPacket(
|
||||
LinearStream *cmdStream,
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
TagNodeBase *timestampPacketNode,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace NEO {
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline size_t GpgpuWalkerHelper<GfxFamily>::setGpgpuWalkerThreadData(
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
const KernelDescriptor &kernelDescriptor,
|
||||
const size_t globalOffsets[3],
|
||||
const size_t startWorkGroups[3],
|
||||
@@ -45,11 +45,11 @@ inline size_t GpgpuWalkerHelper<GfxFamily>::setGpgpuWalkerThreadData(
|
||||
if (!executionMask)
|
||||
executionMask = ~executionMask;
|
||||
|
||||
using SIMD_SIZE = typename WALKER_TYPE<GfxFamily>::SIMD_SIZE;
|
||||
using SIMD_SIZE = typename WALKER_TYPE::SIMD_SIZE;
|
||||
|
||||
walkerCmd->setRightExecutionMask(static_cast<uint32_t>(executionMask));
|
||||
walkerCmd->setBottomExecutionMask(static_cast<uint32_t>(0xffffffff));
|
||||
walkerCmd->setSimdSize(getSimdConfig<WALKER_TYPE<GfxFamily>>(simd));
|
||||
walkerCmd->setSimdSize(getSimdConfig<WALKER_TYPE>(simd));
|
||||
|
||||
walkerCmd->setThreadGroupIdStartingX(static_cast<uint32_t>(startWorkGroups[0]));
|
||||
walkerCmd->setThreadGroupIdStartingY(static_cast<uint32_t>(startWorkGroups[1]));
|
||||
@@ -166,7 +166,7 @@ void GpgpuWalkerHelper<GfxFamily>::dispatchScheduler(
|
||||
template <typename GfxFamily>
|
||||
void GpgpuWalkerHelper<GfxFamily>::setupTimestampPacket(
|
||||
LinearStream *cmdStream,
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
TagNodeBase *timestampPacketNode,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace NEO {
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t GpgpuWalkerHelper<GfxFamily>::setGpgpuWalkerThreadData(
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
const KernelDescriptor &kernelDescriptor,
|
||||
const size_t globalOffsets[3],
|
||||
const size_t startWorkGroups[3],
|
||||
@@ -50,7 +50,7 @@ size_t GpgpuWalkerHelper<GfxFamily>::setGpgpuWalkerThreadData(
|
||||
}
|
||||
|
||||
walkerCmd->setExecutionMask(static_cast<uint32_t>(executionMask));
|
||||
walkerCmd->setSimdSize(getSimdConfig<WALKER_TYPE<GfxFamily>>(simd));
|
||||
walkerCmd->setSimdSize(getSimdConfig<WALKER_TYPE>(simd));
|
||||
walkerCmd->setMessageSimd(walkerCmd->getSimdSize());
|
||||
|
||||
walkerCmd->setThreadGroupIdStartingX(static_cast<uint32_t>(startWorkGroups[0]));
|
||||
@@ -103,7 +103,7 @@ void GpgpuWalkerHelper<GfxFamily>::dispatchScheduler(
|
||||
|
||||
template <typename GfxFamily>
|
||||
void GpgpuWalkerHelper<GfxFamily>::setupTimestampPacket(LinearStream *cmdStream,
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
TagNodeBase *timestampPacketNode,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
using COMPUTE_WALKER = typename GfxFamily::COMPUTE_WALKER;
|
||||
|
||||
@@ -27,13 +27,11 @@ struct MultiDispatchInfo;
|
||||
template <class T>
|
||||
class 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;
|
||||
using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
|
||||
|
||||
static void dispatchWalker(
|
||||
CommandQueue &commandQueue,
|
||||
@@ -97,8 +95,8 @@ class HardwareInterface {
|
||||
const Vec3<size_t> &numberOfWorkgroups,
|
||||
const Vec3<size_t> &startOfWorkgroups);
|
||||
|
||||
static WALKER_TYPE<GfxFamily> *allocateWalkerSpace(LinearStream &commandStream,
|
||||
const Kernel &kernel);
|
||||
static WALKER_TYPE *allocateWalkerSpace(LinearStream &commandStream,
|
||||
const Kernel &kernel);
|
||||
|
||||
static void obtainIndirectHeaps(CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo,
|
||||
bool blockedQueue, IndirectHeap *&dsh, IndirectHeap *&ioh, IndirectHeap *&ssh);
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
namespace NEO {
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline WALKER_TYPE<GfxFamily> *HardwareInterface<GfxFamily>::allocateWalkerSpace(LinearStream &commandStream,
|
||||
const Kernel &kernel) {
|
||||
auto walkerCmd = commandStream.getSpaceForCmd<WALKER_TYPE<GfxFamily>>();
|
||||
inline typename GfxFamily::WALKER_TYPE *HardwareInterface<GfxFamily>::allocateWalkerSpace(LinearStream &commandStream, const Kernel &kernel) {
|
||||
auto walkerCmd = commandStream.getSpaceForCmd<WALKER_TYPE>();
|
||||
return walkerCmd;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ inline void HardwareInterface<GfxFamily>::programWalker(
|
||||
const Vec3<size_t> &startOfWorkgroups) {
|
||||
|
||||
auto walkerCmdBuf = allocateWalkerSpace(commandStream, kernel);
|
||||
WALKER_TYPE<GfxFamily> walkerCmd = GfxFamily::cmdInitGpgpuWalker;
|
||||
WALKER_TYPE walkerCmd = GfxFamily::cmdInitGpgpuWalker;
|
||||
uint32_t dim = dispatchInfo.getDim();
|
||||
uint32_t simd = kernel.getKernelInfo().getMaxSimdSize();
|
||||
|
||||
|
||||
@@ -22,11 +22,9 @@ class IndirectHeap;
|
||||
struct CrossThreadInfo;
|
||||
struct MultiDispatchInfo;
|
||||
|
||||
template <typename GfxFamily>
|
||||
using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct HardwareCommandsHelper : public PerThreadDataHelper {
|
||||
using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
|
||||
using BINDING_TABLE_STATE = typename GfxFamily::BINDING_TABLE_STATE;
|
||||
using RENDER_SURFACE_STATE = typename GfxFamily::RENDER_SURFACE_STATE;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA;
|
||||
@@ -75,7 +73,7 @@ struct HardwareCommandsHelper : public PerThreadDataHelper {
|
||||
IndirectHeap &indirectHeap,
|
||||
Kernel &kernel,
|
||||
bool inlineDataProgrammingRequired,
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
uint32_t &sizeCrossThreadData);
|
||||
|
||||
static size_t sendIndirectState(
|
||||
@@ -90,7 +88,7 @@ struct HardwareCommandsHelper : public PerThreadDataHelper {
|
||||
const uint64_t offsetInterfaceDescriptorTable,
|
||||
uint32_t &interfaceDescriptorIndex,
|
||||
PreemptionMode preemptionMode,
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
INTERFACE_DESCRIPTOR_DATA *inlineInterfaceDescriptor,
|
||||
bool localIdsGenerationByRuntime,
|
||||
const Device &device);
|
||||
@@ -136,7 +134,7 @@ struct HardwareCommandsHelper : public PerThreadDataHelper {
|
||||
|
||||
static size_t getSshSizeForExecutionModel(const Kernel &kernel);
|
||||
static void setInterfaceDescriptorOffset(
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
uint32_t &interfaceDescriptorIndex);
|
||||
|
||||
static void programCacheFlushAfterWalkerCommand(LinearStream *commandStream, const CommandQueue &commandQueue, const Kernel *kernel, uint64_t postSyncAddress);
|
||||
|
||||
@@ -214,7 +214,7 @@ size_t HardwareCommandsHelper<GfxFamily>::sendIndirectState(
|
||||
const uint64_t offsetInterfaceDescriptorTable,
|
||||
uint32_t &interfaceDescriptorIndex,
|
||||
PreemptionMode preemptionMode,
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
INTERFACE_DESCRIPTOR_DATA *inlineInterfaceDescriptor,
|
||||
bool localIdsGenerationByRuntime,
|
||||
const Device &device) {
|
||||
@@ -327,7 +327,7 @@ size_t HardwareCommandsHelper<GfxFamily>::sendIndirectState(
|
||||
setInterfaceDescriptorOffset(walkerCmd, interfaceDescriptorIndex);
|
||||
|
||||
auto indirectDataLength = alignUp(static_cast<uint32_t>(sizeCrossThreadData + sizePerThreadDataTotal),
|
||||
WALKER_TYPE<GfxFamily>::INDIRECTDATASTARTADDRESS_ALIGN_SIZE);
|
||||
WALKER_TYPE::INDIRECTDATASTARTADDRESS_ALIGN_SIZE);
|
||||
walkerCmd->setIndirectDataLength(indirectDataLength);
|
||||
|
||||
return offsetCrossThreadData;
|
||||
|
||||
@@ -125,9 +125,9 @@ size_t HardwareCommandsHelper<GfxFamily>::sendCrossThreadData(
|
||||
IndirectHeap &indirectHeap,
|
||||
Kernel &kernel,
|
||||
bool inlineDataProgrammingRequired,
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
uint32_t &sizeCrossThreadData) {
|
||||
indirectHeap.align(WALKER_TYPE<GfxFamily>::INDIRECTDATASTARTADDRESS_ALIGN_SIZE);
|
||||
indirectHeap.align(WALKER_TYPE::INDIRECTDATASTARTADDRESS_ALIGN_SIZE);
|
||||
|
||||
auto offsetCrossThreadData = indirectHeap.getUsed();
|
||||
char *pDest = nullptr;
|
||||
@@ -156,7 +156,7 @@ bool HardwareCommandsHelper<GfxFamily>::resetBindingTablePrefetch(Kernel &kernel
|
||||
|
||||
template <typename GfxFamily>
|
||||
void HardwareCommandsHelper<GfxFamily>::setInterfaceDescriptorOffset(
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
uint32_t &interfaceDescriptorIndex) {
|
||||
|
||||
walkerCmd->setInterfaceDescriptorOffset(interfaceDescriptorIndex++);
|
||||
|
||||
@@ -91,10 +91,10 @@ size_t HardwareCommandsHelper<GfxFamily>::sendCrossThreadData(
|
||||
IndirectHeap &indirectHeap,
|
||||
Kernel &kernel,
|
||||
bool inlineDataProgrammingRequired,
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
uint32_t &sizeCrossThreadData) {
|
||||
|
||||
indirectHeap.align(WALKER_TYPE<GfxFamily>::INDIRECTDATASTARTADDRESS_ALIGN_SIZE);
|
||||
indirectHeap.align(WALKER_TYPE::INDIRECTDATASTARTADDRESS_ALIGN_SIZE);
|
||||
|
||||
auto offsetCrossThreadData = indirectHeap.getUsed();
|
||||
char *dest = nullptr;
|
||||
@@ -139,7 +139,7 @@ bool HardwareCommandsHelper<GfxFamily>::resetBindingTablePrefetch(Kernel &kernel
|
||||
|
||||
template <typename GfxFamily>
|
||||
void HardwareCommandsHelper<GfxFamily>::setInterfaceDescriptorOffset(
|
||||
WALKER_TYPE<GfxFamily> *walkerCmd,
|
||||
WALKER_TYPE *walkerCmd,
|
||||
uint32_t &interfaceDescriptorIndex) {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user