2021-05-18 02:46:21 +00:00
|
|
|
/*
|
2023-01-19 20:30:08 +00:00
|
|
|
* Copyright (C) 2021-2023 Intel Corporation
|
2021-05-18 02:46:21 +00:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2022-07-24 04:21:16 +00:00
|
|
|
#include "shared/source/command_stream/preemption_mode.h"
|
2021-05-18 02:46:21 +00:00
|
|
|
#include "shared/source/command_stream/stream_property.h"
|
2022-11-10 09:37:42 +00:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2021-05-18 02:46:21 +00:00
|
|
|
|
|
|
|
|
namespace NEO {
|
2022-12-19 12:25:44 +00:00
|
|
|
struct RootDeviceEnvironment;
|
2021-05-18 02:46:21 +00:00
|
|
|
|
2022-08-23 04:02:33 +00:00
|
|
|
struct StateComputeModePropertiesSupport {
|
|
|
|
|
bool coherencyRequired = false;
|
|
|
|
|
bool largeGrfMode = false;
|
|
|
|
|
bool zPassAsyncComputeThreadLimit = false;
|
|
|
|
|
bool pixelAsyncComputeThreadLimit = false;
|
|
|
|
|
bool threadArbitrationPolicy = false;
|
|
|
|
|
bool devicePreemptionMode = false;
|
|
|
|
|
};
|
|
|
|
|
|
2021-05-18 02:46:21 +00:00
|
|
|
struct StateComputeModeProperties {
|
|
|
|
|
StreamProperty isCoherencyRequired{};
|
2021-07-07 13:34:46 +00:00
|
|
|
StreamProperty largeGrfMode{};
|
2021-11-19 13:38:23 +00:00
|
|
|
StreamProperty zPassAsyncComputeThreadLimit{};
|
|
|
|
|
StreamProperty pixelAsyncComputeThreadLimit{};
|
2021-12-07 11:46:24 +00:00
|
|
|
StreamProperty threadArbitrationPolicy{};
|
2022-06-23 15:25:10 +00:00
|
|
|
StreamProperty devicePreemptionMode{};
|
2021-05-18 02:46:21 +00:00
|
|
|
|
2023-02-10 09:51:27 +00:00
|
|
|
void setPropertiesAll(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, PreemptionMode devicePreemptionMode, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2021-05-26 13:51:11 +00:00
|
|
|
void setProperties(const StateComputeModeProperties &properties);
|
2023-02-07 14:56:40 +00:00
|
|
|
void setPropertiesGrfNumberThreadArbitration(uint32_t numGrfRequired, int32_t threadArbitrationPolicy, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2023-02-10 09:51:27 +00:00
|
|
|
void setPropertiesCoherencyDevicePreemption(bool requiresCoherency, PreemptionMode devicePreemptionMode, const RootDeviceEnvironment &rootDeviceEnvironment, bool clearDirtyState);
|
2021-12-09 11:01:40 +00:00
|
|
|
bool isDirty() const;
|
2022-03-08 13:46:04 +00:00
|
|
|
|
|
|
|
|
protected:
|
2021-05-18 02:46:21 +00:00
|
|
|
void clearIsDirty();
|
2023-02-10 09:51:27 +00:00
|
|
|
void clearIsDirtyExtraPerContext();
|
|
|
|
|
void clearIsDirtyExtraPerKernel();
|
2022-03-08 13:46:04 +00:00
|
|
|
bool isDirtyExtra() const;
|
2023-02-10 09:51:27 +00:00
|
|
|
|
|
|
|
|
void setPropertiesExtraPerContext();
|
|
|
|
|
void setPropertiesExtraPerKernel();
|
2022-03-08 13:46:04 +00:00
|
|
|
void setPropertiesExtra(const StateComputeModeProperties &properties);
|
2023-02-10 09:51:27 +00:00
|
|
|
|
2023-02-07 14:56:40 +00:00
|
|
|
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
|
|
|
|
|
|
|
|
|
|
void setCoherencyProperty(bool requiresCoherency);
|
|
|
|
|
void setDevicePreemptionProperty(PreemptionMode devicePreemptionMode);
|
|
|
|
|
void setGrfNumberProperty(uint32_t numGrfRequired);
|
|
|
|
|
void setThreadArbitrationProperty(int32_t threadArbitrationPolicy,
|
|
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment);
|
2022-08-23 04:02:33 +00:00
|
|
|
|
|
|
|
|
StateComputeModePropertiesSupport scmPropertiesSupport = {};
|
|
|
|
|
bool propertiesSupportLoaded = false;
|
2021-05-18 02:46:21 +00:00
|
|
|
};
|
|
|
|
|
|
2022-08-23 04:02:33 +00:00
|
|
|
struct FrontEndPropertiesSupport {
|
2022-08-29 20:06:04 +00:00
|
|
|
bool computeDispatchAllWalker = false;
|
|
|
|
|
bool disableEuFusion = false;
|
|
|
|
|
bool disableOverdispatch = false;
|
|
|
|
|
bool singleSliceDispatchCcsMode = false;
|
2022-08-23 04:02:33 +00:00
|
|
|
};
|
|
|
|
|
|
2021-05-18 02:46:21 +00:00
|
|
|
struct FrontEndProperties {
|
2022-02-10 23:33:40 +00:00
|
|
|
StreamProperty computeDispatchAllWalkerEnable{};
|
|
|
|
|
StreamProperty disableEUFusion{};
|
2021-07-28 17:17:51 +00:00
|
|
|
StreamProperty disableOverdispatch{};
|
2021-08-13 14:48:13 +00:00
|
|
|
StreamProperty singleSliceDispatchCcsMode{};
|
2021-07-28 17:17:51 +00:00
|
|
|
|
2023-02-10 09:51:27 +00:00
|
|
|
void setPropertiesAll(bool isCooperativeKernel, bool disableEuFusion, bool disableOverdispatch, int32_t engineInstancedDevice, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2021-05-26 13:51:11 +00:00
|
|
|
void setProperties(const FrontEndProperties &properties);
|
2023-01-23 14:08:25 +00:00
|
|
|
void setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2023-02-10 09:51:27 +00:00
|
|
|
void setPropertiesDisableOverdispatchEngineInstanced(bool disableOverdispatch, int32_t engineInstancedDevice, const RootDeviceEnvironment &rootDeviceEnvironment, bool clearDirtyState);
|
2023-02-07 14:56:40 +00:00
|
|
|
void setPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(bool isCooperativeKernel, bool disableEuFusion, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2021-12-09 11:01:40 +00:00
|
|
|
bool isDirty() const;
|
2022-03-08 13:46:04 +00:00
|
|
|
|
|
|
|
|
protected:
|
2021-05-26 13:51:11 +00:00
|
|
|
void clearIsDirty();
|
2023-02-07 14:56:40 +00:00
|
|
|
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2022-08-29 20:06:04 +00:00
|
|
|
|
|
|
|
|
FrontEndPropertiesSupport frontEndPropertiesSupport = {};
|
|
|
|
|
bool propertiesSupportLoaded = false;
|
2021-05-18 02:46:21 +00:00
|
|
|
};
|
|
|
|
|
|
2022-09-12 19:11:56 +00:00
|
|
|
struct PipelineSelectPropertiesSupport {
|
|
|
|
|
bool modeSelected = false;
|
|
|
|
|
bool mediaSamplerDopClockGate = false;
|
|
|
|
|
bool systolicMode = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct PipelineSelectProperties {
|
|
|
|
|
StreamProperty modeSelected{};
|
|
|
|
|
StreamProperty mediaSamplerDopClockGate{};
|
|
|
|
|
StreamProperty systolicMode{};
|
|
|
|
|
|
2023-02-10 09:51:27 +00:00
|
|
|
void setPropertiesAll(bool modeSelected, bool mediaSamplerDopClockGate, bool systolicMode, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2022-09-12 19:11:56 +00:00
|
|
|
void setProperties(const PipelineSelectProperties &properties);
|
2023-02-10 09:51:27 +00:00
|
|
|
void setPropertiesModeSelectedMediaSamplerClockGate(bool modeSelected, bool mediaSamplerDopClockGate, const RootDeviceEnvironment &rootDeviceEnvironment, bool clearDirtyState);
|
2023-02-07 14:56:40 +00:00
|
|
|
void setPropertySystolicMode(bool systolicMode, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2022-09-12 19:11:56 +00:00
|
|
|
bool isDirty() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void clearIsDirty();
|
2023-02-07 14:56:40 +00:00
|
|
|
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2022-09-12 19:11:56 +00:00
|
|
|
|
|
|
|
|
PipelineSelectPropertiesSupport pipelineSelectPropertiesSupport = {};
|
|
|
|
|
bool propertiesSupportLoaded = false;
|
|
|
|
|
};
|
|
|
|
|
|
2022-11-22 17:17:04 +00:00
|
|
|
struct StateBaseAddressPropertiesSupport {
|
|
|
|
|
bool globalAtomics = false;
|
|
|
|
|
bool statelessMocs = false;
|
|
|
|
|
bool bindingTablePoolBaseAddress = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct StateBaseAddressProperties {
|
|
|
|
|
StreamProperty64 bindingTablePoolBaseAddress{};
|
|
|
|
|
StreamProperty64 surfaceStateBaseAddress{};
|
|
|
|
|
StreamProperty64 dynamicStateBaseAddress{};
|
|
|
|
|
StreamProperty64 indirectObjectBaseAddress{};
|
2023-01-26 14:42:33 +00:00
|
|
|
StreamPropertySizeT bindingTablePoolSize{};
|
2022-11-22 17:17:04 +00:00
|
|
|
StreamPropertySizeT surfaceStateSize{};
|
|
|
|
|
StreamPropertySizeT dynamicStateSize{};
|
|
|
|
|
StreamPropertySizeT indirectObjectSize{};
|
|
|
|
|
StreamProperty globalAtomics{};
|
|
|
|
|
StreamProperty statelessMocs{};
|
|
|
|
|
|
2023-02-10 09:51:27 +00:00
|
|
|
void setPropertiesAll(bool globalAtomics, int32_t statelessMocs,
|
|
|
|
|
int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
|
|
|
|
|
int64_t surfaceStateBaseAddress, size_t surfaceStateSize,
|
|
|
|
|
int64_t dynamicStateBaseAddress, size_t dynamicStateSize,
|
|
|
|
|
int64_t indirectObjectBaseAddress, size_t indirectObjectSize, const RootDeviceEnvironment &rootDeviceEnvironment);
|
|
|
|
|
void setPropertiesSurfaceState(int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
|
|
|
|
|
int64_t surfaceStateBaseAddress, size_t surfaceStateSize, const RootDeviceEnvironment &rootDeviceEnvironment);
|
|
|
|
|
void setPropertiesDynamicState(int64_t dynamicStateBaseAddress, size_t dynamicStateSize);
|
|
|
|
|
void setPropertiesIndirectState(int64_t indirectObjectBaseAddress, size_t indirectObjectSize);
|
|
|
|
|
void setPropertyStatelessMocs(int32_t statelessMocs, const RootDeviceEnvironment &rootDeviceEnvironment);
|
|
|
|
|
void setPropertyGlobalAtomics(bool globalAtomics, const RootDeviceEnvironment &rootDeviceEnvironment, bool clearDirtyState);
|
2022-11-22 17:17:04 +00:00
|
|
|
void setProperties(const StateBaseAddressProperties &properties);
|
|
|
|
|
bool isDirty() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void clearIsDirty();
|
2023-02-10 09:51:27 +00:00
|
|
|
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2022-11-22 17:17:04 +00:00
|
|
|
|
|
|
|
|
StateBaseAddressPropertiesSupport stateBaseAddressPropertiesSupport = {};
|
|
|
|
|
bool propertiesSupportLoaded = false;
|
|
|
|
|
};
|
|
|
|
|
|
2021-05-18 02:46:21 +00:00
|
|
|
} // namespace NEO
|