refactor: improve single slice dispatch mode handling

Related-To: NEO-8210

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2024-01-04 10:27:27 +00:00
committed by Compute-Runtime-Automation
parent 4f7778b9e0
commit 57900c5455
8 changed files with 54 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -60,6 +60,7 @@ struct PreambleHelper {
static size_t getCmdSizeForPipelineSelect(const RootDeviceEnvironment &rootDeviceEnvironment);
static size_t getSemaphoreDelayCommandSize();
static uint32_t getScratchSizeValueToProgramMediaVfeState(uint32_t scratchSize);
static void setSingleSliceDispatchMode(void *cmd, bool enable);
};
template <PRODUCT_FAMILY productFamily>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 Intel Corporation
* Copyright (C) 2019-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -82,4 +82,8 @@ size_t PreambleHelper<GfxFamily>::getCmdSizeForPipelineSelect(const RootDeviceEn
return sizeof(PIPELINE_SELECT);
}
template <typename GfxFamily>
void PreambleHelper<GfxFamily>::setSingleSliceDispatchMode(void *cmd, bool enable) {
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -53,8 +53,17 @@ void PreambleHelper<GfxFamily>::programVfeState(void *pVfeState,
uint32_t lowAddress = uint32_t(0xFFFFFFFF & scratchAddress);
cmd.setScratchSpaceBuffer(lowAddress);
cmd.setMaximumNumberOfThreads(maxFrontEndThreads);
cmd.setComputeOverdispatchDisable(streamProperties.frontEndState.disableOverdispatch.value == 1);
PreambleHelper<Family>::setSingleSliceDispatchMode(&cmd, streamProperties.frontEndState.singleSliceDispatchCcsMode.value == 1);
appendProgramVFEState(rootDeviceEnvironment, streamProperties, &cmd);
if (debugManager.flags.CFEComputeOverdispatchDisable.get() != -1) {
cmd.setComputeOverdispatchDisable(debugManager.flags.CFEComputeOverdispatchDisable.get());
}
if (debugManager.flags.CFEMaximumNumberOfThreads.get() != -1) {
cmd.setMaximumNumberOfThreads(debugManager.flags.CFEMaximumNumberOfThreads.get());
}
@@ -84,6 +93,17 @@ uint32_t PreambleHelper<GfxFamily>::getL3Config(const HardwareInfo &hwInfo, bool
return 0u;
}
template <typename GfxFamily>
void PreambleHelper<GfxFamily>::setSingleSliceDispatchMode(void *cmd, bool enable) {
auto cfeState = reinterpret_cast<typename GfxFamily::CFE_STATE *>(cmd);
cfeState->setSingleSliceDispatchCcsMode(enable);
if (debugManager.flags.CFESingleSliceDispatchCCSMode.get() != -1) {
cfeState->setSingleSliceDispatchCcsMode(debugManager.flags.CFESingleSliceDispatchCCSMode.get());
}
}
template <>
const uint32_t L3CNTLRegisterOffset<Family>::registerOffset = std::numeric_limits<uint32_t>::max();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2023 Intel Corporation
* Copyright (C) 2020-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -24,9 +24,6 @@ template <>
void PreambleHelper<Family>::appendProgramVFEState(const RootDeviceEnvironment &rootDeviceEnvironment, const StreamProperties &streamProperties, void *cmd) {
auto command = static_cast<CFE_STATE *>(cmd);
command->setComputeOverdispatchDisable(streamProperties.frontEndState.disableOverdispatch.value == 1);
command->setSingleSliceDispatchCcsMode(streamProperties.frontEndState.singleSliceDispatchCcsMode.value == 1);
if (streamProperties.frontEndState.computeDispatchAllWalkerEnable.value > 0) {
command->setComputeDispatchAllWalkerEnable(true);
}
@@ -35,13 +32,6 @@ void PreambleHelper<Family>::appendProgramVFEState(const RootDeviceEnvironment &
command->setComputeDispatchAllWalkerEnable(debugManager.flags.CFEComputeDispatchAllWalkerEnable.get());
}
if (debugManager.flags.CFEComputeOverdispatchDisable.get() != -1) {
command->setComputeOverdispatchDisable(debugManager.flags.CFEComputeOverdispatchDisable.get());
}
if (debugManager.flags.CFESingleSliceDispatchCCSMode.get() != -1) {
command->setSingleSliceDispatchCcsMode(debugManager.flags.CFESingleSliceDispatchCCSMode.get());
}
command->setNumberOfWalkers(1);
if (debugManager.flags.CFENumberOfWalkers.get() != -1) {
command->setNumberOfWalkers(debugManager.flags.CFENumberOfWalkers.get());

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -22,16 +22,6 @@ template <>
void PreambleHelper<Family>::appendProgramVFEState(const RootDeviceEnvironment &rootDeviceEnvironment, const StreamProperties &streamProperties, void *cmd) {
auto command = static_cast<typename Family::CFE_STATE *>(cmd);
command->setComputeOverdispatchDisable(streamProperties.frontEndState.disableOverdispatch.value == 1);
command->setSingleSliceDispatchCcsMode(streamProperties.frontEndState.singleSliceDispatchCcsMode.value == 1);
if (debugManager.flags.CFEComputeOverdispatchDisable.get() != -1) {
command->setComputeOverdispatchDisable(debugManager.flags.CFEComputeOverdispatchDisable.get());
}
if (debugManager.flags.CFESingleSliceDispatchCCSMode.get() != -1) {
command->setSingleSliceDispatchCcsMode(debugManager.flags.CFESingleSliceDispatchCCSMode.get());
}
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
if (!gfxCoreHelper.isFusedEuDispatchEnabled(hwInfo, streamProperties.frontEndState.disableEUFusion.value == 1)) {