2021-05-18 02:46:21 +00:00
|
|
|
/*
|
2022-02-10 23:33:40 +00:00
|
|
|
* Copyright (C) 2021-2022 Intel Corporation
|
2021-05-18 02:46:21 +00:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "shared/source/command_stream/stream_properties.h"
|
|
|
|
|
|
2021-07-07 13:34:46 +00:00
|
|
|
#include "shared/source/kernel/grf_config.h"
|
|
|
|
|
|
2021-05-18 02:46:21 +00:00
|
|
|
using namespace NEO;
|
|
|
|
|
|
2022-03-07 17:00:26 +00:00
|
|
|
void StateComputeModeProperties::setProperties(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy) {
|
2021-05-26 13:51:11 +00:00
|
|
|
clearIsDirty();
|
2021-05-18 02:46:21 +00:00
|
|
|
|
2021-05-26 13:51:11 +00:00
|
|
|
int32_t isCoherencyRequired = (requiresCoherency ? 1 : 0);
|
|
|
|
|
this->isCoherencyRequired.set(isCoherencyRequired);
|
2021-07-07 13:34:46 +00:00
|
|
|
|
|
|
|
|
int32_t largeGrfMode = (numGrfRequired == GrfConfig::LargeGrfNumber ? 1 : 0);
|
|
|
|
|
this->largeGrfMode.set(largeGrfMode);
|
2021-11-19 13:38:23 +00: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 11:46:24 +00:00
|
|
|
|
|
|
|
|
if (DebugManager.flags.OverrideThreadArbitrationPolicy.get() != -1) {
|
|
|
|
|
threadArbitrationPolicy = static_cast<uint32_t>(DebugManager.flags.OverrideThreadArbitrationPolicy.get());
|
|
|
|
|
}
|
|
|
|
|
this->threadArbitrationPolicy.set(threadArbitrationPolicy);
|
2021-05-18 02:46:21 +00:00
|
|
|
}
|
|
|
|
|
|
2021-05-26 13:51:11 +00:00
|
|
|
void StateComputeModeProperties::setProperties(const StateComputeModeProperties &properties) {
|
|
|
|
|
clearIsDirty();
|
2021-05-18 02:46:21 +00:00
|
|
|
|
2021-05-26 13:51:11 +00:00
|
|
|
isCoherencyRequired.set(properties.isCoherencyRequired.value);
|
2021-07-07 13:34:46 +00:00
|
|
|
largeGrfMode.set(properties.largeGrfMode.value);
|
2021-11-19 13:38:23 +00:00
|
|
|
zPassAsyncComputeThreadLimit.set(properties.zPassAsyncComputeThreadLimit.value);
|
|
|
|
|
pixelAsyncComputeThreadLimit.set(properties.pixelAsyncComputeThreadLimit.value);
|
2021-12-07 11:46:24 +00:00
|
|
|
threadArbitrationPolicy.set(properties.threadArbitrationPolicy.value);
|
2021-05-18 02:46:21 +00:00
|
|
|
}
|
|
|
|
|
|
2021-12-09 11:01:40 +00:00
|
|
|
bool StateComputeModeProperties::isDirty() const {
|
2021-11-19 13:38:23 +00:00
|
|
|
return isCoherencyRequired.isDirty || largeGrfMode.isDirty || zPassAsyncComputeThreadLimit.isDirty ||
|
2021-12-07 11:46:24 +00:00
|
|
|
pixelAsyncComputeThreadLimit.isDirty || threadArbitrationPolicy.isDirty;
|
2021-05-18 02:46:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StateComputeModeProperties::clearIsDirty() {
|
|
|
|
|
isCoherencyRequired.isDirty = false;
|
2021-07-07 13:34:46 +00:00
|
|
|
largeGrfMode.isDirty = false;
|
2021-11-19 13:38:23 +00:00
|
|
|
zPassAsyncComputeThreadLimit.isDirty = false;
|
|
|
|
|
pixelAsyncComputeThreadLimit.isDirty = false;
|
2021-12-07 11:46:24 +00:00
|
|
|
threadArbitrationPolicy.isDirty = false;
|
2021-05-18 02:46:21 +00:00
|
|
|
}
|
2021-05-26 13:51:11 +00:00
|
|
|
|
2022-02-10 23:33:40 +00:00
|
|
|
void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableEUFusion, bool disableOverdispatch, int32_t engineInstancedDevice,
|
2021-09-03 18:09:25 +00:00
|
|
|
const HardwareInfo &hwInfo) {
|
2021-07-28 17:17:51 +00:00
|
|
|
clearIsDirty();
|
|
|
|
|
|
2021-12-07 11:46:24 +00:00
|
|
|
this->computeDispatchAllWalkerEnable.set(isCooperativeKernel);
|
2022-02-10 23:33:40 +00:00
|
|
|
this->disableEUFusion.set(disableEUFusion);
|
2021-08-13 14:48:13 +00:00
|
|
|
this->disableOverdispatch.set(disableOverdispatch);
|
|
|
|
|
this->singleSliceDispatchCcsMode.set(engineInstancedDevice);
|
2021-05-26 13:51:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FrontEndProperties::setProperties(const FrontEndProperties &properties) {
|
2021-07-28 17:17:51 +00:00
|
|
|
clearIsDirty();
|
|
|
|
|
|
|
|
|
|
disableOverdispatch.set(properties.disableOverdispatch.value);
|
2022-02-10 23:33:40 +00:00
|
|
|
disableEUFusion.set(properties.disableEUFusion.value);
|
2021-08-13 14:48:13 +00:00
|
|
|
singleSliceDispatchCcsMode.set(properties.singleSliceDispatchCcsMode.value);
|
2021-12-07 11:46:24 +00:00
|
|
|
computeDispatchAllWalkerEnable.set(properties.computeDispatchAllWalkerEnable.value);
|
2021-05-26 13:51:11 +00:00
|
|
|
}
|
|
|
|
|
|
2021-12-09 11:01:40 +00:00
|
|
|
bool FrontEndProperties::isDirty() const {
|
2022-02-10 23:33:40 +00:00
|
|
|
return disableOverdispatch.isDirty || disableEUFusion.isDirty || singleSliceDispatchCcsMode.isDirty || computeDispatchAllWalkerEnable.isDirty;
|
2021-05-26 13:51:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FrontEndProperties::clearIsDirty() {
|
2022-02-10 23:33:40 +00:00
|
|
|
disableEUFusion.isDirty = false;
|
2021-07-28 17:17:51 +00:00
|
|
|
disableOverdispatch.isDirty = false;
|
2021-08-13 14:48:13 +00:00
|
|
|
singleSliceDispatchCcsMode.isDirty = false;
|
2021-12-07 11:46:24 +00:00
|
|
|
computeDispatchAllWalkerEnable.isDirty = false;
|
2021-05-26 13:51:11 +00:00
|
|
|
}
|