2021-05-18 10:46:21 +08:00
|
|
|
/*
|
2023-01-20 04:30:08 +08:00
|
|
|
* Copyright (C) 2021-2023 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"
|
2022-05-18 03:04:23 +08:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
2022-12-19 20:25:44 +08:00
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
2023-02-02 00:23:01 +08:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2021-07-07 21:34:46 +08:00
|
|
|
#include "shared/source/kernel/grf_config.h"
|
2023-03-10 20:28:11 +08:00
|
|
|
#include "shared/source/os_interface/product_helper.h"
|
2021-07-07 21:34:46 +08:00
|
|
|
|
2021-05-18 10:46:21 +08:00
|
|
|
using namespace NEO;
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void StateComputeModeProperties::setPropertiesAll(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, PreemptionMode devicePreemptionMode) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2021-05-26 21:51:11 +08:00
|
|
|
clearIsDirty();
|
2021-05-18 10:46:21 +08:00
|
|
|
|
2023-02-07 22:56:40 +08:00
|
|
|
setCoherencyProperty(requiresCoherency);
|
|
|
|
setGrfNumberProperty(numGrfRequired);
|
2023-03-10 07:12:09 +08:00
|
|
|
setThreadArbitrationProperty(threadArbitrationPolicy);
|
2021-11-19 21:38:23 +08:00
|
|
|
|
|
|
|
int32_t zPassAsyncComputeThreadLimit = -1;
|
|
|
|
if (DebugManager.flags.ForceZPassAsyncComputeThreadLimit.get() != -1) {
|
|
|
|
zPassAsyncComputeThreadLimit = DebugManager.flags.ForceZPassAsyncComputeThreadLimit.get();
|
|
|
|
}
|
2022-08-23 12:02:33 +08:00
|
|
|
if (zPassAsyncComputeThreadLimit != -1 && this->scmPropertiesSupport.zPassAsyncComputeThreadLimit) {
|
|
|
|
this->zPassAsyncComputeThreadLimit.set(zPassAsyncComputeThreadLimit);
|
|
|
|
}
|
2021-11-19 21:38:23 +08:00
|
|
|
|
|
|
|
int32_t pixelAsyncComputeThreadLimit = -1;
|
|
|
|
if (DebugManager.flags.ForcePixelAsyncComputeThreadLimit.get() != -1) {
|
|
|
|
pixelAsyncComputeThreadLimit = DebugManager.flags.ForcePixelAsyncComputeThreadLimit.get();
|
|
|
|
}
|
2022-08-23 12:02:33 +08:00
|
|
|
if (pixelAsyncComputeThreadLimit != -1 && this->scmPropertiesSupport.pixelAsyncComputeThreadLimit) {
|
|
|
|
this->pixelAsyncComputeThreadLimit.set(pixelAsyncComputeThreadLimit);
|
|
|
|
}
|
2023-02-07 22:56:40 +08:00
|
|
|
setDevicePreemptionProperty(devicePreemptionMode);
|
2022-06-23 23:25:10 +08:00
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
setPropertiesExtraPerContext();
|
|
|
|
setPropertiesExtraPerKernel();
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
|
|
|
|
2023-03-11 02:36:22 +08:00
|
|
|
void StateComputeModeProperties::copyPropertiesAll(const StateComputeModeProperties &properties) {
|
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
|
|
|
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-06-23 23:25:10 +08:00
|
|
|
devicePreemptionMode.set(properties.devicePreemptionMode.value);
|
2022-03-08 21:46:04 +08:00
|
|
|
|
2023-03-11 02:36:22 +08:00
|
|
|
copyPropertiesExtra(properties);
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateComputeModeProperties::copyPropertiesGrfNumberThreadArbitration(const StateComputeModeProperties &properties) {
|
|
|
|
largeGrfMode.isDirty = false;
|
|
|
|
threadArbitrationPolicy.isDirty = false;
|
|
|
|
|
|
|
|
clearIsDirtyExtraPerKernel();
|
|
|
|
|
|
|
|
largeGrfMode.set(properties.largeGrfMode.value);
|
|
|
|
threadArbitrationPolicy.set(properties.threadArbitrationPolicy.value);
|
|
|
|
|
|
|
|
copyPropertiesExtra(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-06-23 23:25:10 +08:00
|
|
|
pixelAsyncComputeThreadLimit.isDirty || threadArbitrationPolicy.isDirty || devicePreemptionMode.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-06-23 23:25:10 +08:00
|
|
|
devicePreemptionMode.isDirty = false;
|
2022-03-08 21:46:04 +08:00
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
clearIsDirtyExtraPerContext();
|
|
|
|
clearIsDirtyExtraPerKernel();
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
2021-05-26 21:51:11 +08:00
|
|
|
|
2023-02-07 22:56:40 +08:00
|
|
|
void StateComputeModeProperties::setCoherencyProperty(bool requiresCoherency) {
|
|
|
|
if (this->scmPropertiesSupport.coherencyRequired) {
|
|
|
|
int32_t isCoherencyRequired = (requiresCoherency ? 1 : 0);
|
|
|
|
this->isCoherencyRequired.set(isCoherencyRequired);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void StateComputeModeProperties::setDevicePreemptionProperty(PreemptionMode devicePreemptionMode) {
|
|
|
|
if (this->scmPropertiesSupport.devicePreemptionMode) {
|
|
|
|
this->devicePreemptionMode.set(static_cast<int32_t>(devicePreemptionMode));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateComputeModeProperties::setGrfNumberProperty(uint32_t numGrfRequired) {
|
|
|
|
if (this->scmPropertiesSupport.largeGrfMode &&
|
|
|
|
(this->largeGrfMode.value == -1 || numGrfRequired != GrfConfig::NotApplicable)) {
|
|
|
|
int32_t largeGrfMode = (numGrfRequired == GrfConfig::LargeGrfNumber ? 1 : 0);
|
|
|
|
this->largeGrfMode.set(largeGrfMode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void StateComputeModeProperties::setThreadArbitrationProperty(int32_t threadArbitrationPolicy) {
|
2023-02-07 22:56:40 +08:00
|
|
|
bool setDefaultThreadArbitrationPolicy = (threadArbitrationPolicy == ThreadArbitrationPolicy::NotPresent) &&
|
|
|
|
(NEO::DebugManager.flags.ForceDefaultThreadArbitrationPolicyIfNotSpecified.get() ||
|
|
|
|
(this->threadArbitrationPolicy.value == ThreadArbitrationPolicy::NotPresent));
|
|
|
|
if (setDefaultThreadArbitrationPolicy) {
|
2023-03-10 07:12:09 +08:00
|
|
|
threadArbitrationPolicy = this->defaultThreadArbitrationPolicy;
|
2023-02-07 22:56:40 +08:00
|
|
|
}
|
|
|
|
if (DebugManager.flags.OverrideThreadArbitrationPolicy.get() != -1) {
|
|
|
|
threadArbitrationPolicy = DebugManager.flags.OverrideThreadArbitrationPolicy.get();
|
|
|
|
}
|
|
|
|
if (this->scmPropertiesSupport.threadArbitrationPolicy) {
|
|
|
|
this->threadArbitrationPolicy.set(threadArbitrationPolicy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateComputeModeProperties::initSupport(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
2023-03-10 07:12:09 +08:00
|
|
|
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
|
|
|
productHelper.fillScmPropertiesSupportStructure(this->scmPropertiesSupport);
|
|
|
|
|
|
|
|
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
|
|
|
this->defaultThreadArbitrationPolicy = gfxCoreHelper.getDefaultThreadArbitrationPolicy();
|
|
|
|
|
|
|
|
this->propertiesSupportLoaded = true;
|
2023-02-07 22:56:40 +08:00
|
|
|
}
|
2023-01-20 04:30:08 +08:00
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void StateComputeModeProperties::setPropertiesCoherencyDevicePreemption(bool requiresCoherency, PreemptionMode devicePreemptionMode, bool clearDirtyState) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2023-02-07 22:56:40 +08:00
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
if (!clearDirtyState) {
|
|
|
|
this->isCoherencyRequired.isDirty = false;
|
|
|
|
this->devicePreemptionMode.isDirty = false;
|
|
|
|
clearIsDirtyExtraPerContext();
|
|
|
|
}
|
2023-02-07 22:56:40 +08:00
|
|
|
setCoherencyProperty(requiresCoherency);
|
|
|
|
setDevicePreemptionProperty(devicePreemptionMode);
|
2023-02-10 17:51:27 +08:00
|
|
|
setPropertiesExtraPerContext();
|
|
|
|
if (clearDirtyState) {
|
|
|
|
this->isCoherencyRequired.isDirty = false;
|
|
|
|
this->devicePreemptionMode.isDirty = false;
|
|
|
|
clearIsDirtyExtraPerContext();
|
|
|
|
}
|
2023-02-07 22:56:40 +08:00
|
|
|
}
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void StateComputeModeProperties::setPropertiesGrfNumberThreadArbitration(uint32_t numGrfRequired, int32_t threadArbitrationPolicy) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2023-02-07 22:56:40 +08:00
|
|
|
|
|
|
|
this->threadArbitrationPolicy.isDirty = false;
|
|
|
|
this->largeGrfMode.isDirty = false;
|
2023-02-10 17:51:27 +08:00
|
|
|
clearIsDirtyExtraPerKernel();
|
2023-02-07 22:56:40 +08:00
|
|
|
|
|
|
|
setGrfNumberProperty(numGrfRequired);
|
2023-03-10 07:12:09 +08:00
|
|
|
setThreadArbitrationProperty(threadArbitrationPolicy);
|
2023-02-10 17:51:27 +08:00
|
|
|
setPropertiesExtraPerKernel();
|
2023-02-07 22:56:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void FrontEndProperties::initSupport(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
2023-03-10 07:12:09 +08:00
|
|
|
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
|
|
|
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
|
|
|
productHelper.fillFrontEndPropertiesSupportStructure(this->frontEndPropertiesSupport, hwInfo);
|
|
|
|
this->propertiesSupportLoaded = true;
|
2023-02-07 22:56:40 +08:00
|
|
|
}
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void FrontEndProperties::setPropertiesAll(bool isCooperativeKernel, bool disableEuFusion, bool disableOverdispatch, int32_t engineInstancedDevice) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2021-07-29 01:17:51 +08:00
|
|
|
clearIsDirty();
|
|
|
|
|
2022-08-30 04:06:04 +08:00
|
|
|
if (this->frontEndPropertiesSupport.computeDispatchAllWalker) {
|
|
|
|
this->computeDispatchAllWalkerEnable.set(isCooperativeKernel);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->frontEndPropertiesSupport.disableEuFusion) {
|
2023-02-07 22:56:40 +08:00
|
|
|
this->disableEUFusion.set(disableEuFusion);
|
2022-08-30 04:06:04 +08:00
|
|
|
}
|
|
|
|
|
2022-09-13 03:11:56 +08:00
|
|
|
if (this->frontEndPropertiesSupport.disableOverdispatch) {
|
2022-08-30 04:06:04 +08:00
|
|
|
this->disableOverdispatch.set(disableOverdispatch);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->frontEndPropertiesSupport.singleSliceDispatchCcsMode) {
|
|
|
|
this->singleSliceDispatchCcsMode.set(engineInstancedDevice);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void FrontEndProperties::setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2023-02-07 22:56:40 +08:00
|
|
|
|
2022-08-30 04:06:04 +08:00
|
|
|
this->singleSliceDispatchCcsMode.isDirty = false;
|
|
|
|
if (this->frontEndPropertiesSupport.singleSliceDispatchCcsMode) {
|
|
|
|
this->singleSliceDispatchCcsMode.set(engineInstancedDevice);
|
|
|
|
}
|
2021-05-26 21:51:11 +08:00
|
|
|
}
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void FrontEndProperties::setPropertiesDisableOverdispatchEngineInstanced(bool disableOverdispatch, int32_t engineInstancedDevice, bool clearDirtyState) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2023-02-07 22:56:40 +08:00
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
if (!clearDirtyState) {
|
|
|
|
this->disableOverdispatch.isDirty = false;
|
|
|
|
this->singleSliceDispatchCcsMode.isDirty = false;
|
|
|
|
}
|
|
|
|
|
2023-02-07 22:56:40 +08:00
|
|
|
if (this->frontEndPropertiesSupport.disableOverdispatch) {
|
|
|
|
this->disableOverdispatch.set(disableOverdispatch);
|
|
|
|
}
|
2023-02-10 17:51:27 +08:00
|
|
|
if (this->frontEndPropertiesSupport.singleSliceDispatchCcsMode) {
|
|
|
|
this->singleSliceDispatchCcsMode.set(engineInstancedDevice);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clearDirtyState) {
|
|
|
|
this->disableOverdispatch.isDirty = false;
|
|
|
|
this->singleSliceDispatchCcsMode.isDirty = false;
|
|
|
|
}
|
2023-02-07 22:56:40 +08:00
|
|
|
}
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void FrontEndProperties::setPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(bool isCooperativeKernel, bool disableEuFusion) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2023-02-07 22:56:40 +08:00
|
|
|
|
|
|
|
this->computeDispatchAllWalkerEnable.isDirty = false;
|
|
|
|
this->disableEUFusion.isDirty = false;
|
|
|
|
|
|
|
|
if (this->frontEndPropertiesSupport.computeDispatchAllWalker) {
|
|
|
|
this->computeDispatchAllWalkerEnable.set(isCooperativeKernel);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->frontEndPropertiesSupport.disableEuFusion) {
|
|
|
|
this->disableEUFusion.set(disableEuFusion);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-11 02:36:22 +08:00
|
|
|
void FrontEndProperties::copyPropertiesAll(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
|
|
|
}
|
|
|
|
|
2023-03-11 02:36:22 +08:00
|
|
|
void FrontEndProperties::copyPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(const FrontEndProperties &properties) {
|
|
|
|
this->computeDispatchAllWalkerEnable.isDirty = false;
|
|
|
|
this->disableEUFusion.isDirty = false;
|
|
|
|
|
|
|
|
this->disableEUFusion.set(properties.disableEUFusion.value);
|
|
|
|
this->computeDispatchAllWalkerEnable.set(properties.computeDispatchAllWalkerEnable.value);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
2022-09-13 03:11:56 +08:00
|
|
|
|
2023-02-07 22:56:40 +08:00
|
|
|
void PipelineSelectProperties::initSupport(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
2023-03-10 07:12:09 +08:00
|
|
|
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
|
|
|
productHelper.fillPipelineSelectPropertiesSupportStructure(this->pipelineSelectPropertiesSupport, *rootDeviceEnvironment.getHardwareInfo());
|
|
|
|
this->propertiesSupportLoaded = true;
|
2023-02-07 22:56:40 +08:00
|
|
|
}
|
2022-09-13 03:11:56 +08:00
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void PipelineSelectProperties::setPropertiesAll(bool modeSelected, bool mediaSamplerDopClockGate, bool systolicMode) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2022-09-13 03:11:56 +08:00
|
|
|
clearIsDirty();
|
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
this->modeSelected.set(modeSelected);
|
2022-09-13 03:11:56 +08:00
|
|
|
|
|
|
|
if (this->pipelineSelectPropertiesSupport.mediaSamplerDopClockGate) {
|
|
|
|
this->mediaSamplerDopClockGate.set(mediaSamplerDopClockGate);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->pipelineSelectPropertiesSupport.systolicMode) {
|
2023-02-07 22:56:40 +08:00
|
|
|
this->systolicMode.set(systolicMode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void PipelineSelectProperties::setPropertiesModeSelectedMediaSamplerClockGate(bool modeSelected, bool mediaSamplerDopClockGate, bool clearDirtyState) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2023-02-10 17:51:27 +08:00
|
|
|
|
|
|
|
if (!clearDirtyState) {
|
|
|
|
this->modeSelected.isDirty = false;
|
|
|
|
this->mediaSamplerDopClockGate.isDirty = false;
|
|
|
|
}
|
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
this->modeSelected.set(modeSelected);
|
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
if (this->pipelineSelectPropertiesSupport.mediaSamplerDopClockGate) {
|
|
|
|
this->mediaSamplerDopClockGate.set(mediaSamplerDopClockGate);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clearDirtyState) {
|
|
|
|
this->modeSelected.isDirty = false;
|
|
|
|
this->mediaSamplerDopClockGate.isDirty = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void PipelineSelectProperties::setPropertySystolicMode(bool systolicMode) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2023-02-07 22:56:40 +08:00
|
|
|
|
|
|
|
this->systolicMode.isDirty = false;
|
|
|
|
|
|
|
|
if (this->pipelineSelectPropertiesSupport.systolicMode) {
|
2022-09-13 03:11:56 +08:00
|
|
|
this->systolicMode.set(systolicMode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-11 02:36:22 +08:00
|
|
|
void PipelineSelectProperties::copyPropertiesAll(const PipelineSelectProperties &properties) {
|
2022-09-13 03:11:56 +08:00
|
|
|
clearIsDirty();
|
|
|
|
|
|
|
|
modeSelected.set(properties.modeSelected.value);
|
|
|
|
mediaSamplerDopClockGate.set(properties.mediaSamplerDopClockGate.value);
|
|
|
|
systolicMode.set(properties.systolicMode.value);
|
|
|
|
}
|
|
|
|
|
2023-03-11 02:36:22 +08:00
|
|
|
void PipelineSelectProperties::copyPropertiesSystolicMode(const PipelineSelectProperties &properties) {
|
|
|
|
systolicMode.isDirty = false;
|
|
|
|
systolicMode.set(properties.systolicMode.value);
|
|
|
|
}
|
|
|
|
|
2022-09-13 03:11:56 +08:00
|
|
|
bool PipelineSelectProperties::isDirty() const {
|
|
|
|
return modeSelected.isDirty || mediaSamplerDopClockGate.isDirty || systolicMode.isDirty;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PipelineSelectProperties::clearIsDirty() {
|
|
|
|
modeSelected.isDirty = false;
|
|
|
|
mediaSamplerDopClockGate.isDirty = false;
|
|
|
|
systolicMode.isDirty = false;
|
|
|
|
}
|
2022-11-23 01:17:04 +08:00
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
void StateBaseAddressProperties::initSupport(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
2023-03-10 07:12:09 +08:00
|
|
|
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
|
|
|
productHelper.fillStateBaseAddressPropertiesSupportStructure(this->stateBaseAddressPropertiesSupport);
|
|
|
|
this->propertiesSupportLoaded = true;
|
2023-02-10 17:51:27 +08:00
|
|
|
}
|
|
|
|
|
2023-03-11 02:36:22 +08:00
|
|
|
void StateBaseAddressProperties::setPropertiesBindingTableSurfaceState(int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
|
|
|
|
int64_t surfaceStateBaseAddress, size_t surfaceStateSize) {
|
2023-03-10 07:12:09 +08:00
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2023-02-10 17:51:27 +08:00
|
|
|
|
|
|
|
this->bindingTablePoolBaseAddress.isDirty = false;
|
|
|
|
this->surfaceStateBaseAddress.isDirty = false;
|
|
|
|
|
|
|
|
if (this->stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress) {
|
|
|
|
this->bindingTablePoolBaseAddress.set(bindingTablePoolBaseAddress);
|
|
|
|
this->bindingTablePoolSize.set(bindingTablePoolSize);
|
|
|
|
}
|
|
|
|
this->surfaceStateBaseAddress.set(surfaceStateBaseAddress);
|
|
|
|
this->surfaceStateSize.set(surfaceStateSize);
|
|
|
|
}
|
|
|
|
|
2023-03-11 02:36:22 +08:00
|
|
|
void StateBaseAddressProperties::setPropertiesSurfaceState(int64_t surfaceStateBaseAddress, size_t surfaceStateSize) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
|
|
|
|
|
|
|
this->surfaceStateBaseAddress.isDirty = false;
|
|
|
|
|
|
|
|
this->surfaceStateBaseAddress.set(surfaceStateBaseAddress);
|
|
|
|
this->surfaceStateSize.set(surfaceStateSize);
|
|
|
|
}
|
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
void StateBaseAddressProperties::setPropertiesDynamicState(int64_t dynamicStateBaseAddress, size_t dynamicStateSize) {
|
|
|
|
this->dynamicStateBaseAddress.isDirty = false;
|
|
|
|
this->dynamicStateBaseAddress.set(dynamicStateBaseAddress);
|
|
|
|
this->dynamicStateSize.set(dynamicStateSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateBaseAddressProperties::setPropertiesIndirectState(int64_t indirectObjectBaseAddress, size_t indirectObjectSize) {
|
|
|
|
this->indirectObjectBaseAddress.isDirty = false;
|
|
|
|
this->indirectObjectBaseAddress.set(indirectObjectBaseAddress);
|
|
|
|
this->indirectObjectSize.set(indirectObjectSize);
|
|
|
|
}
|
2022-11-23 01:17:04 +08:00
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
void StateBaseAddressProperties::setPropertyStatelessMocs(int32_t statelessMocs) {
|
2023-02-10 17:51:27 +08:00
|
|
|
this->statelessMocs.isDirty = false;
|
2023-02-10 17:51:27 +08:00
|
|
|
this->statelessMocs.set(statelessMocs);
|
2023-02-10 17:51:27 +08:00
|
|
|
}
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void StateBaseAddressProperties::setPropertyGlobalAtomics(bool globalAtomics, bool clearDirtyState) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2023-02-10 17:51:27 +08:00
|
|
|
|
|
|
|
if (!clearDirtyState) {
|
|
|
|
this->globalAtomics.isDirty = false;
|
|
|
|
}
|
|
|
|
if (this->stateBaseAddressPropertiesSupport.globalAtomics) {
|
|
|
|
this->globalAtomics.set(globalAtomics);
|
|
|
|
}
|
|
|
|
if (clearDirtyState) {
|
|
|
|
this->globalAtomics.isDirty = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateBaseAddressProperties::setPropertiesAll(bool globalAtomics, int32_t statelessMocs,
|
|
|
|
int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
|
|
|
|
int64_t surfaceStateBaseAddress, size_t surfaceStateSize,
|
|
|
|
int64_t dynamicStateBaseAddress, size_t dynamicStateSize,
|
2023-03-10 07:12:09 +08:00
|
|
|
int64_t indirectObjectBaseAddress, size_t indirectObjectSize) {
|
|
|
|
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
|
2022-11-23 01:17:04 +08:00
|
|
|
clearIsDirty();
|
|
|
|
|
|
|
|
if (this->stateBaseAddressPropertiesSupport.globalAtomics) {
|
|
|
|
this->globalAtomics.set(globalAtomics);
|
|
|
|
}
|
|
|
|
|
2023-02-10 17:51:27 +08:00
|
|
|
this->statelessMocs.set(statelessMocs);
|
2022-11-23 01:17:04 +08:00
|
|
|
|
|
|
|
if (this->stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress) {
|
|
|
|
this->bindingTablePoolBaseAddress.set(bindingTablePoolBaseAddress);
|
2023-01-26 22:42:33 +08:00
|
|
|
this->bindingTablePoolSize.set(bindingTablePoolSize);
|
2022-11-23 01:17:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
this->surfaceStateBaseAddress.set(surfaceStateBaseAddress);
|
|
|
|
this->surfaceStateSize.set(surfaceStateSize);
|
|
|
|
this->dynamicStateBaseAddress.set(dynamicStateBaseAddress);
|
|
|
|
this->dynamicStateSize.set(dynamicStateSize);
|
|
|
|
this->indirectObjectBaseAddress.set(indirectObjectBaseAddress);
|
|
|
|
this->indirectObjectSize.set(indirectObjectSize);
|
|
|
|
}
|
|
|
|
|
2023-03-11 02:36:22 +08:00
|
|
|
void StateBaseAddressProperties::copyPropertiesAll(const StateBaseAddressProperties &properties) {
|
2022-11-23 01:17:04 +08:00
|
|
|
clearIsDirty();
|
|
|
|
|
2023-02-03 02:57:24 +08:00
|
|
|
this->globalAtomics.set(properties.globalAtomics.value);
|
|
|
|
this->statelessMocs.set(properties.statelessMocs.value);
|
|
|
|
|
|
|
|
this->bindingTablePoolBaseAddress.set(properties.bindingTablePoolBaseAddress.value);
|
|
|
|
this->bindingTablePoolSize.set(properties.bindingTablePoolSize.value);
|
|
|
|
|
|
|
|
this->surfaceStateBaseAddress.set(properties.surfaceStateBaseAddress.value);
|
|
|
|
this->surfaceStateSize.set(properties.surfaceStateSize.value);
|
|
|
|
this->dynamicStateBaseAddress.set(properties.dynamicStateBaseAddress.value);
|
|
|
|
this->dynamicStateSize.set(properties.dynamicStateSize.value);
|
|
|
|
this->indirectObjectBaseAddress.set(properties.indirectObjectBaseAddress.value);
|
2023-03-11 02:36:22 +08:00
|
|
|
this->indirectObjectSize.set(properties.indirectObjectSize.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateBaseAddressProperties::copyPropertiesStatelessMocs(const StateBaseAddressProperties &properties) {
|
|
|
|
this->statelessMocs.isDirty = false;
|
|
|
|
|
|
|
|
this->statelessMocs.set(properties.statelessMocs.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateBaseAddressProperties::copyPropertiesStatelessMocsIndirectState(const StateBaseAddressProperties &properties) {
|
|
|
|
this->statelessMocs.isDirty = false;
|
|
|
|
this->indirectObjectBaseAddress.isDirty = false;
|
|
|
|
|
|
|
|
this->statelessMocs.set(properties.statelessMocs.value);
|
|
|
|
this->indirectObjectBaseAddress.set(properties.indirectObjectBaseAddress.value);
|
2023-02-03 02:57:24 +08:00
|
|
|
this->indirectObjectSize.set(properties.indirectObjectSize.value);
|
2022-11-23 01:17:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool StateBaseAddressProperties::isDirty() const {
|
2023-01-26 22:42:33 +08:00
|
|
|
return globalAtomics.isDirty || statelessMocs.isDirty ||
|
2023-04-04 00:32:12 +08:00
|
|
|
bindingTablePoolBaseAddress.isDirty ||
|
|
|
|
surfaceStateBaseAddress.isDirty ||
|
|
|
|
dynamicStateBaseAddress.isDirty ||
|
|
|
|
indirectObjectBaseAddress.isDirty;
|
2022-11-23 01:17:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void StateBaseAddressProperties::clearIsDirty() {
|
|
|
|
globalAtomics.isDirty = false;
|
|
|
|
statelessMocs.isDirty = false;
|
|
|
|
bindingTablePoolBaseAddress.isDirty = false;
|
|
|
|
surfaceStateBaseAddress.isDirty = false;
|
|
|
|
dynamicStateBaseAddress.isDirty = false;
|
|
|
|
indirectObjectBaseAddress.isDirty = false;
|
|
|
|
}
|