2021-05-18 10:46:21 +08:00
|
|
|
/*
|
2022-02-11 07:33:40 +08:00
|
|
|
* Copyright (C) 2021-2022 Intel Corporation
|
2021-05-18 10:46:21 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "shared/source/command_stream/stream_properties.h"
|
|
|
|
|
2022-03-08 04:29:02 +08:00
|
|
|
#include "shared/source/command_stream/thread_arbitration_policy.h"
|
2021-07-07 21:34:46 +08:00
|
|
|
#include "shared/source/kernel/grf_config.h"
|
2022-04-26 22:28:18 +08:00
|
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
2021-07-07 21:34:46 +08:00
|
|
|
|
2021-05-18 10:46:21 +08:00
|
|
|
using namespace NEO;
|
|
|
|
|
2022-03-08 04:29:02 +08:00
|
|
|
void StateComputeModeProperties::setProperties(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy,
|
|
|
|
const HardwareInfo &hwInfo) {
|
2022-04-26 22:28:18 +08:00
|
|
|
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
|
|
|
|
2021-05-26 21:51:11 +08:00
|
|
|
clearIsDirty();
|
2021-05-18 10:46:21 +08:00
|
|
|
|
2021-05-26 21:51:11 +08:00
|
|
|
int32_t isCoherencyRequired = (requiresCoherency ? 1 : 0);
|
|
|
|
this->isCoherencyRequired.set(isCoherencyRequired);
|
2021-07-07 21:34:46 +08:00
|
|
|
|
2022-04-29 22:33:41 +08:00
|
|
|
bool reportNumGrf = hwInfoConfig.isGrfNumReportedWithScm();
|
|
|
|
if (reportNumGrf && (this->largeGrfMode.value == -1 || numGrfRequired != GrfConfig::NotApplicable)) {
|
2022-03-15 00:40:32 +08:00
|
|
|
int32_t largeGrfMode = (numGrfRequired == GrfConfig::LargeGrfNumber ? 1 : 0);
|
|
|
|
this->largeGrfMode.set(largeGrfMode);
|
|
|
|
}
|
2021-11-19 21:38:23 +08:00
|
|
|
|
|
|
|
int32_t zPassAsyncComputeThreadLimit = -1;
|
|
|
|
if (DebugManager.flags.ForceZPassAsyncComputeThreadLimit.get() != -1) {
|
|
|
|
zPassAsyncComputeThreadLimit = DebugManager.flags.ForceZPassAsyncComputeThreadLimit.get();
|
|
|
|
}
|
|
|
|
this->zPassAsyncComputeThreadLimit.set(zPassAsyncComputeThreadLimit);
|
|
|
|
|
|
|
|
int32_t pixelAsyncComputeThreadLimit = -1;
|
|
|
|
if (DebugManager.flags.ForcePixelAsyncComputeThreadLimit.get() != -1) {
|
|
|
|
pixelAsyncComputeThreadLimit = DebugManager.flags.ForcePixelAsyncComputeThreadLimit.get();
|
|
|
|
}
|
|
|
|
this->pixelAsyncComputeThreadLimit.set(pixelAsyncComputeThreadLimit);
|
2021-12-07 19:46:24 +08:00
|
|
|
|
2022-03-08 04:29:02 +08:00
|
|
|
bool setDefaultThreadArbitrationPolicy = (threadArbitrationPolicy == ThreadArbitrationPolicy::NotPresent) &&
|
|
|
|
(NEO::DebugManager.flags.ForceDefaultThreadArbitrationPolicyIfNotSpecified.get() ||
|
|
|
|
(this->threadArbitrationPolicy.value == ThreadArbitrationPolicy::NotPresent));
|
|
|
|
if (setDefaultThreadArbitrationPolicy) {
|
|
|
|
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
|
|
|
threadArbitrationPolicy = hwHelper.getDefaultThreadArbitrationPolicy();
|
|
|
|
}
|
2021-12-07 19:46:24 +08:00
|
|
|
if (DebugManager.flags.OverrideThreadArbitrationPolicy.get() != -1) {
|
2022-03-08 04:29:02 +08:00
|
|
|
threadArbitrationPolicy = DebugManager.flags.OverrideThreadArbitrationPolicy.get();
|
2021-12-07 19:46:24 +08:00
|
|
|
}
|
|
|
|
this->threadArbitrationPolicy.set(threadArbitrationPolicy);
|
2022-03-08 21:46:04 +08:00
|
|
|
|
2022-04-29 22:33:41 +08:00
|
|
|
setPropertiesExtra(reportNumGrf);
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
|
|
|
|
2021-05-26 21:51:11 +08:00
|
|
|
void StateComputeModeProperties::setProperties(const StateComputeModeProperties &properties) {
|
|
|
|
clearIsDirty();
|
2021-05-18 10:46:21 +08:00
|
|
|
|
2021-05-26 21:51:11 +08:00
|
|
|
isCoherencyRequired.set(properties.isCoherencyRequired.value);
|
2021-07-07 21:34:46 +08:00
|
|
|
largeGrfMode.set(properties.largeGrfMode.value);
|
2021-11-19 21:38:23 +08:00
|
|
|
zPassAsyncComputeThreadLimit.set(properties.zPassAsyncComputeThreadLimit.value);
|
|
|
|
pixelAsyncComputeThreadLimit.set(properties.pixelAsyncComputeThreadLimit.value);
|
2021-12-07 19:46:24 +08:00
|
|
|
threadArbitrationPolicy.set(properties.threadArbitrationPolicy.value);
|
2022-03-08 21:46:04 +08:00
|
|
|
|
|
|
|
setPropertiesExtra(properties);
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
|
|
|
|
2021-12-09 19:01:40 +08:00
|
|
|
bool StateComputeModeProperties::isDirty() const {
|
2021-11-19 21:38:23 +08:00
|
|
|
return isCoherencyRequired.isDirty || largeGrfMode.isDirty || zPassAsyncComputeThreadLimit.isDirty ||
|
2022-03-08 21:46:04 +08:00
|
|
|
pixelAsyncComputeThreadLimit.isDirty || threadArbitrationPolicy.isDirty || isDirtyExtra();
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void StateComputeModeProperties::clearIsDirty() {
|
|
|
|
isCoherencyRequired.isDirty = false;
|
2021-07-07 21:34:46 +08:00
|
|
|
largeGrfMode.isDirty = false;
|
2021-11-19 21:38:23 +08:00
|
|
|
zPassAsyncComputeThreadLimit.isDirty = false;
|
|
|
|
pixelAsyncComputeThreadLimit.isDirty = false;
|
2021-12-07 19:46:24 +08:00
|
|
|
threadArbitrationPolicy.isDirty = false;
|
2022-03-08 21:46:04 +08:00
|
|
|
|
|
|
|
clearIsDirtyExtra();
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
2021-05-26 21:51:11 +08:00
|
|
|
|
2022-03-08 21:46:04 +08:00
|
|
|
void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableEUFusion, bool disableOverdispatch,
|
|
|
|
int32_t engineInstancedDevice, const HardwareInfo &hwInfo) {
|
2021-07-29 01:17:51 +08:00
|
|
|
clearIsDirty();
|
|
|
|
|
2021-12-07 19:46:24 +08:00
|
|
|
this->computeDispatchAllWalkerEnable.set(isCooperativeKernel);
|
2022-02-11 07:33:40 +08:00
|
|
|
this->disableEUFusion.set(disableEUFusion);
|
2021-08-13 22:48:13 +08:00
|
|
|
this->disableOverdispatch.set(disableOverdispatch);
|
|
|
|
this->singleSliceDispatchCcsMode.set(engineInstancedDevice);
|
2021-05-26 21:51:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void FrontEndProperties::setProperties(const FrontEndProperties &properties) {
|
2021-07-29 01:17:51 +08:00
|
|
|
clearIsDirty();
|
|
|
|
|
|
|
|
disableOverdispatch.set(properties.disableOverdispatch.value);
|
2022-02-11 07:33:40 +08:00
|
|
|
disableEUFusion.set(properties.disableEUFusion.value);
|
2021-08-13 22:48:13 +08:00
|
|
|
singleSliceDispatchCcsMode.set(properties.singleSliceDispatchCcsMode.value);
|
2021-12-07 19:46:24 +08:00
|
|
|
computeDispatchAllWalkerEnable.set(properties.computeDispatchAllWalkerEnable.value);
|
2021-05-26 21:51:11 +08:00
|
|
|
}
|
|
|
|
|
2021-12-09 19:01:40 +08:00
|
|
|
bool FrontEndProperties::isDirty() const {
|
2022-03-08 21:46:04 +08:00
|
|
|
return disableOverdispatch.isDirty || disableEUFusion.isDirty || singleSliceDispatchCcsMode.isDirty ||
|
|
|
|
computeDispatchAllWalkerEnable.isDirty;
|
2021-05-26 21:51:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void FrontEndProperties::clearIsDirty() {
|
2022-02-11 07:33:40 +08:00
|
|
|
disableEUFusion.isDirty = false;
|
2021-07-29 01:17:51 +08:00
|
|
|
disableOverdispatch.isDirty = false;
|
2021-08-13 22:48:13 +08:00
|
|
|
singleSliceDispatchCcsMode.isDirty = false;
|
2021-12-07 19:46:24 +08:00
|
|
|
computeDispatchAllWalkerEnable.isDirty = false;
|
2021-05-26 21:51:11 +08:00
|
|
|
}
|