refactor: change additional walker fields encoder 5/n

- move compute dispatch all walker into dedicated encoder
- group same implementations into single file

Related-To: NEO-12639

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2024-10-31 15:17:31 +00:00
committed by Compute-Runtime-Automation
parent 49d999abe6
commit 2e2b7a473a
11 changed files with 41 additions and 31 deletions

View File

@@ -231,6 +231,8 @@ struct EncodeDispatchKernel {
static void overrideDefaultValues(WalkerType &walkerCmd, InterfaceDescriptorType &interfaceDescriptor);
template <typename WalkerType>
static void encodeWalkerPostSyncFields(WalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs);
template <typename WalkerType>
static void encodeComputeDispatchAllWalker(WalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs);
};
template <typename GfxFamily>

View File

@@ -287,6 +287,7 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
args.device->getDeviceInfo().maxFrontEndThreads};
EncodeDispatchKernel<Family>::encodeAdditionalWalkerFields(rootDeviceEnvironment, cmd, walkerArgs);
EncodeDispatchKernel<Family>::encodeWalkerPostSyncFields(cmd, walkerArgs);
EncodeDispatchKernel<Family>::encodeComputeDispatchAllWalker(cmd, walkerArgs);
memcpy_s(iddPtr, sizeof(idd), &idd, sizeof(idd));
@@ -415,7 +416,11 @@ inline void EncodeDispatchKernel<Family>::encodeAdditionalWalkerFields(const Roo
template <typename Family>
template <typename WalkerType>
inline void NEO::EncodeDispatchKernel<Family>::encodeWalkerPostSyncFields(WalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs) {}
inline void EncodeDispatchKernel<Family>::encodeWalkerPostSyncFields(WalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs) {}
template <typename Family>
template <typename WalkerType>
inline void EncodeDispatchKernel<Family>::encodeComputeDispatchAllWalker(WalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs) {}
template <typename Family>
template <typename InterfaceDescriptorType>

View File

@@ -33,6 +33,7 @@ template void NEO::EncodeDispatchKernel<Family>::setWalkerRegionSettings<Family:
uint32_t workgroupSize, uint32_t maxWgCountPerTile, bool requiredWalkOrder);
template void NEO::EncodeDispatchKernel<Family>::overrideDefaultValues<Family::DefaultWalkerType, Family::INTERFACE_DESCRIPTOR_DATA>(Family::DefaultWalkerType &walkerCmd, Family::INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor);
template void NEO::EncodeDispatchKernel<Family>::encodeWalkerPostSyncFields<Family::DefaultWalkerType>(Family::DefaultWalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs);
template void NEO::EncodeDispatchKernel<Family>::encodeComputeDispatchAllWalker<Family::DefaultWalkerType>(Family::DefaultWalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs);
template struct NEO::EncodeStates<Family>;
template struct NEO::EncodeMath<Family>;

View File

@@ -25,4 +25,15 @@ uint32_t EncodeDispatchKernel<Family>::alignPreferredSlmSize(uint32_t slmSize) {
return slmSize;
}
template <typename Family>
template <typename WalkerType>
void EncodeDispatchKernel<Family>::encodeComputeDispatchAllWalker(WalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs) {
bool computeDispatchAllWalkerEnable = walkerArgs.kernelExecutionType == KernelExecutionType::concurrent;
int32_t overrideComputeDispatchAllWalkerEnable = debugManager.flags.ComputeDispatchAllWalkerEnableInComputeWalker.get();
if (overrideComputeDispatchAllWalkerEnable != -1) {
computeDispatchAllWalkerEnable = !!overrideComputeDispatchAllWalkerEnable;
}
walkerCmd.setComputeDispatchAllWalkerEnable(computeDispatchAllWalkerEnable);
}
} // namespace NEO

View File

@@ -413,6 +413,7 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
args.device->getDeviceInfo().maxFrontEndThreads};
EncodeDispatchKernel<Family>::encodeAdditionalWalkerFields(rootDeviceEnvironment, walkerCmd, walkerArgs);
EncodeDispatchKernel<Family>::encodeWalkerPostSyncFields(walkerCmd, walkerArgs);
EncodeDispatchKernel<Family>::encodeComputeDispatchAllWalker(walkerCmd, walkerArgs);
EncodeDispatchKernel<Family>::overrideDefaultValues(walkerCmd, idd);
@@ -1248,4 +1249,8 @@ void EncodeDispatchKernel<Family>::encodeWalkerPostSyncFields(WalkerType &walker
postSyncData.setSystemMemoryFenceRequest(programGlobalFenceAsPostSyncOperationInComputeWalker);
}
template <typename Family>
template <typename WalkerType>
void EncodeDispatchKernel<Family>::encodeAdditionalWalkerFields(const RootDeviceEnvironment &rootDeviceEnvironment, WalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs) {}
} // namespace NEO