mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Change DG2 l1 cache policy to WB
With compiler LSC WAs this gives better performance. If debugger is active, policy will not be changed ie. will be WBP. Related-To: NEO-7003 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
6118e41741
commit
8cc0177f1c
@ -779,7 +779,7 @@ void OfflineCompiler::appendExtraInternalOptions(std::string &internalOptions) {
|
||||
if (compilerHwInfoConfig.isForceEmuInt32DivRemSPRequired()) {
|
||||
CompilerOptions::concatenateAppend(internalOptions, CompilerOptions::forceEmuInt32DivRemSP);
|
||||
}
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerHwInfoConfig.getCachingPolicyOptions());
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerHwInfoConfig.getCachingPolicyOptions(false));
|
||||
}
|
||||
|
||||
void OfflineCompiler::parseDebugSettings() {
|
||||
|
@ -286,7 +286,7 @@ struct EncodeSurfaceState {
|
||||
static void encodeBuffer(EncodeSurfaceStateArgs &args);
|
||||
static void encodeExtraBufferParams(EncodeSurfaceStateArgs &args);
|
||||
static void encodeImplicitScalingParams(const EncodeSurfaceStateArgs &args);
|
||||
static void encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const HardwareInfo &hwInfo);
|
||||
static void encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const EncodeSurfaceStateArgs &args);
|
||||
static void appendBufferSurfaceState(EncodeSurfaceStateArgs &args);
|
||||
|
||||
static constexpr uintptr_t getSurfaceBaseAddressAlignmentMask() {
|
||||
|
@ -467,7 +467,7 @@ size_t EncodeSurfaceState<Family>::pushBindingTableAndSurfaceStates(IndirectHeap
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
inline void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const HardwareInfo &hwInfo) {}
|
||||
inline void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const EncodeSurfaceStateArgs &args) {}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::setImageAuxParamsForCCS(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
|
@ -390,6 +390,7 @@ void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &
|
||||
auto dsh = args.container->isHeapDirty(HeapType::DYNAMIC_STATE) ? args.container->getIndirectHeap(HeapType::DYNAMIC_STATE) : nullptr;
|
||||
auto ioh = args.container->isHeapDirty(HeapType::INDIRECT_OBJECT) ? args.container->getIndirectHeap(HeapType::INDIRECT_OBJECT) : nullptr;
|
||||
auto ssh = args.container->isHeapDirty(HeapType::SURFACE_STATE) ? args.container->getIndirectHeap(HeapType::SURFACE_STATE) : nullptr;
|
||||
auto isDebuggerActive = device.isDebuggerActive() || device.getDebugger() != nullptr;
|
||||
|
||||
StateBaseAddressHelperArgs<Family> stateBaseAddressHelperArgs = {
|
||||
0, // generalStateBase
|
||||
@ -410,7 +411,8 @@ void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &
|
||||
false, // isMultiOsContextCapable
|
||||
args.useGlobalAtomics, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
isDebuggerActive // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<Family>::programStateBaseAddress(stateBaseAddressHelperArgs);
|
||||
@ -476,7 +478,7 @@ inline void EncodeWA<GfxFamily>::adjustCompressionFormatForPlanarImage(uint32_t
|
||||
template <typename GfxFamily>
|
||||
inline void EncodeSurfaceState<GfxFamily>::encodeExtraBufferParams(EncodeSurfaceStateArgs &args) {
|
||||
auto surfaceState = reinterpret_cast<R_SURFACE_STATE *>(args.outMemory);
|
||||
encodeExtraCacheSettings(surfaceState, *args.gmmHelper->getHardwareInfo());
|
||||
encodeExtraCacheSettings(surfaceState, args);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
@ -13,16 +13,16 @@
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const HardwareInfo &hwInfo) {
|
||||
void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const EncodeSurfaceStateArgs &args) {
|
||||
using L1_CACHE_POLICY = typename R_SURFACE_STATE::L1_CACHE_POLICY;
|
||||
const auto &hwInfo = *args.gmmHelper->getHardwareInfo();
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
auto cachePolicy = static_cast<L1_CACHE_POLICY>(hwInfoConfig->getL1CachePolicy());
|
||||
surfaceState->setL1CachePolicyL1CacheControl(cachePolicy);
|
||||
|
||||
auto cachePolicy = static_cast<L1_CACHE_POLICY>(hwInfoConfig->getL1CachePolicy(args.isDebuggerActive));
|
||||
if (DebugManager.flags.OverrideL1CacheControlInSurfaceState.get() != -1 &&
|
||||
DebugManager.flags.ForceAllResourcesUncached.get() == false) {
|
||||
surfaceState->setL1CachePolicyL1CacheControl(static_cast<L1_CACHE_POLICY>(DebugManager.flags.OverrideL1CacheControlInSurfaceState.get()));
|
||||
cachePolicy = static_cast<L1_CACHE_POLICY>(DebugManager.flags.OverrideL1CacheControlInSurfaceState.get());
|
||||
}
|
||||
surfaceState->setL1CachePolicyL1CacheControl(cachePolicy);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
@ -492,11 +492,13 @@ void EncodeStateBaseAddress<Family>::setSbaAddressesForDebugger(NEO::Debugger::S
|
||||
|
||||
template <typename Family>
|
||||
void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &args) {
|
||||
auto gmmHelper = args.container->getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
||||
auto &device = *args.container->getDevice();
|
||||
auto gmmHelper = device.getRootDeviceEnvironment().getGmmHelper();
|
||||
|
||||
auto dsh = args.container->isHeapDirty(HeapType::DYNAMIC_STATE) ? args.container->getIndirectHeap(HeapType::DYNAMIC_STATE) : nullptr;
|
||||
auto ioh = args.container->isHeapDirty(HeapType::INDIRECT_OBJECT) ? args.container->getIndirectHeap(HeapType::INDIRECT_OBJECT) : nullptr;
|
||||
auto ssh = args.container->isHeapDirty(HeapType::SURFACE_STATE) ? args.container->getIndirectHeap(HeapType::SURFACE_STATE) : nullptr;
|
||||
auto isDebuggerActive = device.isDebuggerActive() || device.getDebugger() != nullptr;
|
||||
|
||||
StateBaseAddressHelperArgs<Family> stateBaseAddressHelperArgs = {
|
||||
0, // generalStateBase
|
||||
@ -517,7 +519,8 @@ void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &
|
||||
args.multiOsContextCapable, // isMultiOsContextCapable
|
||||
args.useGlobalAtomics, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
isDebuggerActive // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<Family>::programStateBaseAddress(stateBaseAddressHelperArgs);
|
||||
@ -525,7 +528,7 @@ void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &
|
||||
auto cmdSpace = StateBaseAddressHelper<Family>::getSpaceForSbaCmd(*args.container->getCommandStream());
|
||||
*cmdSpace = args.sbaCmd;
|
||||
|
||||
auto &hwInfo = args.container->getDevice()->getHardwareInfo();
|
||||
auto &hwInfo = device.getHardwareInfo();
|
||||
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
if (hwInfoConfig.isAdditionalStateBaseAddressWARequired(hwInfo)) {
|
||||
cmdSpace = StateBaseAddressHelper<Family>::getSpaceForSbaCmd(*args.container->getCommandStream());
|
||||
@ -649,7 +652,7 @@ void EncodeSurfaceState<Family>::encodeExtraBufferParams(EncodeSurfaceStateArgs
|
||||
surfaceState->setMemoryObjectControlState(args.gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST));
|
||||
}
|
||||
|
||||
encodeExtraCacheSettings(surfaceState, *args.gmmHelper->getHardwareInfo());
|
||||
encodeExtraCacheSettings(surfaceState, args);
|
||||
|
||||
encodeImplicitScalingParams(args);
|
||||
|
||||
|
@ -31,6 +31,7 @@ struct EncodeSurfaceStateArgsBase {
|
||||
bool useGlobalAtomics = false;
|
||||
bool areMultipleSubDevicesInContext = false;
|
||||
bool implicitScaling = false;
|
||||
bool isDebuggerActive = false;
|
||||
|
||||
protected:
|
||||
EncodeSurfaceStateArgsBase() = default;
|
||||
|
@ -428,7 +428,8 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
isMultiOsContextCapable(), // isMultiOsContextCapable
|
||||
dispatchFlags.useGlobalAtomics, // useGlobalAtomics
|
||||
dispatchFlags.areMultipleSubDevicesInContext, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
debuggingEnabled || device.isDebuggerActive() // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(args);
|
||||
|
@ -26,6 +26,9 @@ inline size_t getSizeNeededForL3Control(const Range<L3Range> &ranges) {
|
||||
return size;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void adjustL3ControlField(void *l3ControlBuffer);
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void flushGpuCache(LinearStream *commandStream, const Range<L3Range> &ranges, uint64_t postSyncAddress, const HardwareInfo &hwInfo) {
|
||||
using L3_FLUSH_ADDRESS_RANGE = typename GfxFamily::L3_FLUSH_ADDRESS_RANGE;
|
||||
@ -45,6 +48,7 @@ inline void flushGpuCache(LinearStream *commandStream, const Range<L3Range> &ran
|
||||
cmdL3Control.getPostSyncData().setAddress(postSyncAddress);
|
||||
cmdL3Control.getPostSyncData().setImmediateData(0);
|
||||
}
|
||||
adjustL3ControlField<GfxFamily>(&cmdL3Control);
|
||||
*l3Control = cmdL3Control;
|
||||
|
||||
l3Control++;
|
||||
|
@ -21,13 +21,13 @@ bool isL3Capable(const GraphicsAllocation &graphicsAllocation);
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
struct L1CachePolicyHelper {
|
||||
|
||||
static const char *getCachingPolicyOptions();
|
||||
static const char *getCachingPolicyOptions(bool isDebuggerActive);
|
||||
|
||||
static uint32_t getDefaultL1CachePolicy();
|
||||
static uint32_t getDefaultL1CachePolicy(bool isDebuggerActive);
|
||||
|
||||
static uint32_t getUncachedL1CachePolicy();
|
||||
|
||||
static uint32_t getL1CachePolicy();
|
||||
static uint32_t getL1CachePolicy(bool isDebuggerActive);
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -12,14 +12,14 @@
|
||||
namespace NEO {
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getL1CachePolicy(bool isDebuggerActive) {
|
||||
if (DebugManager.flags.ForceAllResourcesUncached.get()) {
|
||||
return L1CachePolicyHelper<gfxProduct>::getUncachedL1CachePolicy();
|
||||
}
|
||||
if (DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.get() != -1) {
|
||||
return DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.get();
|
||||
}
|
||||
return L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy();
|
||||
return L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy(isDebuggerActive);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
@ -11,12 +11,12 @@
|
||||
namespace NEO {
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions() {
|
||||
const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions(bool isDebuggerActive) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy(bool isDebuggerActive) {
|
||||
return 0u;
|
||||
}
|
||||
|
||||
|
@ -12,14 +12,14 @@
|
||||
namespace NEO {
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions() {
|
||||
const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions(bool isDebuggerActive) {
|
||||
using GfxFamily = typename HwMapper<gfxProduct>::GfxFamily;
|
||||
|
||||
static constexpr const char *writeBackCachingPolicy = "-cl-store-cache-default=7 -cl-load-cache-default=4";
|
||||
static constexpr const char *writeByPassCachingPolicy = "-cl-store-cache-default=2 -cl-load-cache-default=4";
|
||||
static constexpr const char *uncachedCachingPolicy = "-cl-store-cache-default=1 -cl-load-cache-default=1";
|
||||
|
||||
switch (L1CachePolicyHelper<gfxProduct>::getL1CachePolicy()) {
|
||||
switch (L1CachePolicyHelper<gfxProduct>::getL1CachePolicy(isDebuggerActive)) {
|
||||
case GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP:
|
||||
return writeByPassCachingPolicy;
|
||||
case GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB:
|
||||
@ -32,7 +32,7 @@ const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions() {
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy(bool isDebuggerActive) {
|
||||
using GfxFamily = typename HwMapper<gfxProduct>::GfxFamily;
|
||||
return GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class CompilerHwInfoConfig {
|
||||
virtual bool isForceToStatelessRequired() const = 0;
|
||||
virtual void adjustHwInfoForIgc(HardwareInfo &hwInfo) const = 0;
|
||||
virtual void setProductConfigForHwInfo(HardwareInfo &hwInfo, AheadOfTimeConfig config) const = 0;
|
||||
virtual const char *getCachingPolicyOptions() const = 0;
|
||||
virtual const char *getCachingPolicyOptions(bool isDebuggerActive) const = 0;
|
||||
};
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
@ -47,7 +47,7 @@ class CompilerHwInfoConfigHw : public CompilerHwInfoConfig {
|
||||
bool isForceToStatelessRequired() const override;
|
||||
void adjustHwInfoForIgc(HardwareInfo &hwInfo) const override;
|
||||
void setProductConfigForHwInfo(HardwareInfo &hwInfo, AheadOfTimeConfig config) const override;
|
||||
const char *getCachingPolicyOptions() const override;
|
||||
const char *getCachingPolicyOptions(bool isDebuggerActive) const override;
|
||||
|
||||
protected:
|
||||
CompilerHwInfoConfigHw() = default;
|
||||
|
@ -26,8 +26,8 @@ void CompilerHwInfoConfigHw<gfxProduct>::adjustHwInfoForIgc(HardwareInfo &hwInfo
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
const char *CompilerHwInfoConfigHw<gfxProduct>::getCachingPolicyOptions() const {
|
||||
return L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions();
|
||||
const char *CompilerHwInfoConfigHw<gfxProduct>::getCachingPolicyOptions(bool isDebuggerActive) const {
|
||||
return L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions(isDebuggerActive);
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -45,6 +45,7 @@ struct StateBaseAddressHelperArgs {
|
||||
bool useGlobalAtomics = false;
|
||||
bool areMultipleSubDevicesInContext = false;
|
||||
bool overrideSurfaceStateBaseAddress = false;
|
||||
bool isDebuggerActive = false;
|
||||
};
|
||||
|
||||
template <typename GfxFamily>
|
||||
@ -60,7 +61,7 @@ struct StateBaseAddressHelper {
|
||||
static void appendStateBaseAddressParameters(StateBaseAddressHelperArgs<GfxFamily> &args,
|
||||
bool overrideBindlessSurfaceStateBase);
|
||||
|
||||
static void appendExtraCacheSettings(STATE_BASE_ADDRESS *stateBaseAddress, const HardwareInfo *hwInfo);
|
||||
static void appendExtraCacheSettings(StateBaseAddressHelperArgs<GfxFamily> &args);
|
||||
|
||||
static void programBindingTableBaseAddress(LinearStream &commandStream, const IndirectHeap &ssh, GmmHelper *gmmHelper);
|
||||
|
||||
|
@ -29,6 +29,6 @@ void StateBaseAddressHelper<GfxFamily>::appendIohParameters(StateBaseAddressHelp
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void StateBaseAddressHelper<GfxFamily>::appendExtraCacheSettings(STATE_BASE_ADDRESS *stateBaseAddress, const HardwareInfo *hwInfo) {}
|
||||
void StateBaseAddressHelper<GfxFamily>::appendExtraCacheSettings(StateBaseAddressHelperArgs<GfxFamily> &args) {}
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -6,13 +6,13 @@
|
||||
*/
|
||||
|
||||
template <typename GfxFamily>
|
||||
void StateBaseAddressHelper<GfxFamily>::appendExtraCacheSettings(STATE_BASE_ADDRESS *stateBaseAddress, const HardwareInfo *hwInfo) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo->platform.eProductFamily);
|
||||
auto cachePolicy = hwInfoConfig->getL1CachePolicy();
|
||||
stateBaseAddress->setL1CachePolicyL1CacheControl(static_cast<typename STATE_BASE_ADDRESS::L1_CACHE_POLICY>(cachePolicy));
|
||||
void StateBaseAddressHelper<GfxFamily>::appendExtraCacheSettings(StateBaseAddressHelperArgs<GfxFamily> &args) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(args.gmmHelper->getHardwareInfo()->platform.eProductFamily);
|
||||
auto cachePolicy = hwInfoConfig->getL1CachePolicy(args.isDebuggerActive);
|
||||
args.stateBaseAddressCmd->setL1CachePolicyL1CacheControl(static_cast<typename STATE_BASE_ADDRESS::L1_CACHE_POLICY>(cachePolicy));
|
||||
|
||||
if (DebugManager.flags.ForceStatelessL1CachingPolicy.get() != -1 &&
|
||||
DebugManager.flags.ForceAllResourcesUncached.get() == false) {
|
||||
stateBaseAddress->setL1CachePolicyL1CacheControl(static_cast<typename STATE_BASE_ADDRESS::L1_CACHE_POLICY>(DebugManager.flags.ForceStatelessL1CachingPolicy.get()));
|
||||
args.stateBaseAddressCmd->setL1CachePolicyL1CacheControl(static_cast<typename STATE_BASE_ADDRESS::L1_CACHE_POLICY>(DebugManager.flags.ForceStatelessL1CachingPolicy.get()));
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ void StateBaseAddressHelper<GfxFamily>::appendStateBaseAddressParameters(
|
||||
args.stateBaseAddressCmd->setStatelessDataPortAccessMemoryObjectControlState(args.gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST));
|
||||
}
|
||||
|
||||
appendExtraCacheSettings(args.stateBaseAddressCmd, args.gmmHelper->getHardwareInfo());
|
||||
appendExtraCacheSettings(args);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
@ -133,7 +133,7 @@ class HwInfoConfig {
|
||||
virtual bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const = 0;
|
||||
virtual bool isAdjustWalkOrderAvailable(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isAssignEngineRoundRobinSupported() const = 0;
|
||||
virtual uint32_t getL1CachePolicy() const = 0;
|
||||
virtual uint32_t getL1CachePolicy(bool isDebuggerActive) const = 0;
|
||||
virtual bool isEvictionIfNecessaryFlagSupported() const = 0;
|
||||
virtual void adjustNumberOfCcs(HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isPrefetcherDisablingInDirectSubmissionRequired() const = 0;
|
||||
@ -264,7 +264,7 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const override;
|
||||
bool isAdjustWalkOrderAvailable(const HardwareInfo &hwInfo) const override;
|
||||
bool isAssignEngineRoundRobinSupported() const override;
|
||||
uint32_t getL1CachePolicy() const override;
|
||||
uint32_t getL1CachePolicy(bool isDebuggerActive) const override;
|
||||
bool isEvictionIfNecessaryFlagSupported() const override;
|
||||
void adjustNumberOfCcs(HardwareInfo &hwInfo) const override;
|
||||
bool isPrefetcherDisablingInDirectSubmissionRequired() const override;
|
||||
|
@ -482,8 +482,8 @@ template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::isAdjustWalkOrderAvailable(const HardwareInfo &hwInfo) const { return false; }
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint32_t HwInfoConfigHw<gfxProduct>::getL1CachePolicy() const {
|
||||
return L1CachePolicyHelper<gfxProduct>::getL1CachePolicy();
|
||||
uint32_t HwInfoConfigHw<gfxProduct>::getL1CachePolicy(bool isDebuggerActive) const {
|
||||
return L1CachePolicyHelper<gfxProduct>::getL1CachePolicy(isDebuggerActive);
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
|
@ -18,7 +18,7 @@ using Family = NEO::XeHpFamily;
|
||||
#include "shared/source/command_container/command_encoder_tgllp_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_tgllp_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_xehp_and_later.inl"
|
||||
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
@ -26,7 +26,7 @@ void EncodeDispatchKernel<Family>::adjustTimestampPacket(WALKER_TYPE &walkerCmd,
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const HardwareInfo &hwInfo) {
|
||||
inline void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const EncodeSurfaceStateArgs &args) {
|
||||
}
|
||||
|
||||
template <>
|
||||
@ -82,6 +82,11 @@ constexpr bool EncodeDispatchKernel<Family>::shouldUpdateGlobalAtomics(bool &cur
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
void adjustL3ControlField<Family>(void *l3ControlBuffer) { ; }
|
||||
|
||||
template void flushGpuCache<Family>(LinearStream *commandStream, const Range<L3Range> &ranges, uint64_t postSyncAddress, const HardwareInfo &hwInfo);
|
||||
|
||||
template struct EncodeDispatchKernel<Family>;
|
||||
template struct EncodeStates<Family>;
|
||||
template struct EncodeMath<Family>;
|
||||
|
@ -11,7 +11,7 @@
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
void StateBaseAddressHelper<XeHpFamily>::appendExtraCacheSettings(STATE_BASE_ADDRESS *stateBaseAddress, const HardwareInfo *hwInfo) {
|
||||
void StateBaseAddressHelper<XeHpFamily>::appendExtraCacheSettings(StateBaseAddressHelperArgs<XeHpFamily> &args) {
|
||||
}
|
||||
|
||||
template struct StateBaseAddressHelper<XeHpFamily>;
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "shared/source/command_container/command_encoder_xehp_and_later.inl"
|
||||
#include "shared/source/command_container/encode_compute_mode_tgllp_and_later.inl"
|
||||
#include "shared/source/command_stream/stream_properties.h"
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/source/utilities/lookup_array.h"
|
||||
#include "shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h"
|
||||
@ -185,6 +186,15 @@ void EncodeDispatchKernel<Family>::adjustWalkOrder(WALKER_TYPE &walkerCmd, uint3
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void adjustL3ControlField<Family>(void *l3ControlBuffer) {
|
||||
using L3_CONTROL = typename Family::L3_CONTROL;
|
||||
auto l3Control = reinterpret_cast<L3_CONTROL *>(l3ControlBuffer);
|
||||
l3Control->setUnTypedDataPortCacheFlush(true);
|
||||
}
|
||||
|
||||
template void flushGpuCache<Family>(LinearStream *commandStream, const Range<L3Range> &ranges, uint64_t postSyncAddress, const HardwareInfo &hwInfo);
|
||||
|
||||
template struct EncodeDispatchKernel<Family>;
|
||||
template struct EncodeStates<Family>;
|
||||
template struct EncodeMath<Family>;
|
||||
|
@ -18,9 +18,12 @@ namespace NEO {
|
||||
#ifdef SUPPORT_DG2
|
||||
|
||||
template <>
|
||||
uint32_t L1CachePolicyHelper<IGFX_DG2>::getDefaultL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<IGFX_DG2>::getDefaultL1CachePolicy(bool isDebuggerActive) {
|
||||
using GfxFamily = HwMapper<IGFX_DG2>::GfxFamily;
|
||||
return GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP;
|
||||
if (isDebuggerActive) {
|
||||
return GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP;
|
||||
}
|
||||
return GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB;
|
||||
}
|
||||
|
||||
template struct L1CachePolicyHelper<IGFX_DG2>;
|
||||
|
@ -393,12 +393,12 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::isEvictionIfNecessaryFlagSupported() const {
|
||||
}
|
||||
|
||||
template <>
|
||||
const char *L1CachePolicyHelper<IGFX_UNKNOWN>::getCachingPolicyOptions() {
|
||||
const char *L1CachePolicyHelper<IGFX_UNKNOWN>::getCachingPolicyOptions(bool isDebuggerActive) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t L1CachePolicyHelper<IGFX_UNKNOWN>::getDefaultL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<IGFX_UNKNOWN>::getDefaultL1CachePolicy(bool isDebuggerActive) {
|
||||
return 0u;
|
||||
}
|
||||
|
||||
@ -408,8 +408,8 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::isPrefetcherDisablingInDirectSubmissionRequir
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t L1CachePolicyHelper<IGFX_UNKNOWN>::getL1CachePolicy() {
|
||||
return L1CachePolicyHelper<IGFX_UNKNOWN>::getDefaultL1CachePolicy();
|
||||
uint32_t L1CachePolicyHelper<IGFX_UNKNOWN>::getL1CachePolicy(bool isDebuggerActive) {
|
||||
return L1CachePolicyHelper<IGFX_UNKNOWN>::getDefaultL1CachePolicy(isDebuggerActive);
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@ -48,7 +48,10 @@ if(TESTS_DG2_AND_LATER)
|
||||
endif()
|
||||
|
||||
if(TESTS_DG2)
|
||||
target_sources(neo_shared_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_tests_dg2.cpp)
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_tests_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_states_dg2.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(TESTS_XE_HPG_CORE)
|
||||
|
66
shared/test/unit_test/encoders/test_encode_states_dg2.cpp
Normal file
66
shared/test/unit_test/encoders/test_encode_states_dg2.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/mocks/mock_debugger.h"
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
|
||||
#include "test_traits_common.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CommandEncodeStatesDG2Test = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesDG2Test, givenCommandContainerWhenSetStateBaseAddressCalledThenCachePolicyIsWB, IsDG2) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
cmdContainer->dirtyHeaps = 0;
|
||||
|
||||
STATE_BASE_ADDRESS sba;
|
||||
auto gmmHelper = cmdContainer->getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
||||
uint32_t statelessMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
|
||||
|
||||
EncodeStateBaseAddressArgs<FamilyType> args = createDefaultEncodeStateBaseAddressArgs<FamilyType>(cmdContainer.get(), sba, statelessMocsIndex);
|
||||
|
||||
EncodeStateBaseAddress<FamilyType>::encode(args);
|
||||
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
|
||||
auto itorCmd = find<STATE_BASE_ADDRESS *>(commands.begin(), commands.end());
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
|
||||
auto cmd = genCmdCast<STATE_BASE_ADDRESS *>(*itorCmd);
|
||||
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, cmd->getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesDG2Test, givenCommandContainerAndDebuggerActiveWhenSetStateBaseAddressCalledThenCachePolicyIsWBP, IsDG2) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
cmdContainer->dirtyHeaps = 0;
|
||||
auto debugger = new MockDebugger();
|
||||
|
||||
cmdContainer->getDevice()->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger);
|
||||
STATE_BASE_ADDRESS sba;
|
||||
auto gmmHelper = cmdContainer->getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
||||
uint32_t statelessMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
|
||||
|
||||
EncodeStateBaseAddressArgs<FamilyType> args = createDefaultEncodeStateBaseAddressArgs<FamilyType>(cmdContainer.get(), sba, statelessMocsIndex);
|
||||
const_cast<DeviceInfo &>(pDevice->getDeviceInfo()).debuggerActive = true;
|
||||
EncodeStateBaseAddress<FamilyType>::encode(args);
|
||||
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
|
||||
auto itorCmd = find<STATE_BASE_ADDRESS *>(commands.begin(), commands.end());
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
|
||||
auto cmd = genCmdCast<STATE_BASE_ADDRESS *>(*itorCmd);
|
||||
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, cmd->getL1CachePolicyL1CacheControl());
|
||||
}
|
@ -13,7 +13,8 @@
|
||||
using namespace NEO;
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenL1CachePolicyHelperWhenUnsupportedL1PoliciesAndGetDefaultL1CachePolicyThenReturnZero, IsAtMostXeHpCore) {
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 0u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 0u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 0u);
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenL1CachePolicyHelperWhenUnsupportedL1PoliciesAndGetUncached1CachePolicyThenReturnOne, IsAtMostXeHpCore) {
|
||||
@ -22,7 +23,8 @@ HWTEST2_F(HwInfoConfigTest, givenL1CachePolicyHelperWhenUnsupportedL1PoliciesAnd
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetL1CachePolicyThenReturnCorrectValue, IsAtLeastXeHpgCore) {
|
||||
using GfxFamily = typename HwMapper<productFamily>::GfxFamily;
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetUncached1CachePolicyThenReturnCorrectValue, IsAtLeastXeHpgCore) {
|
||||
@ -35,7 +37,8 @@ HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndWriteBackPolicyWhenGetL1Cach
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2);
|
||||
|
||||
const char *expectedStr = "-cl-store-cache-default=7 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndForceAllResourcesUncachedWhenGetL1CachePolicyThenReturnCorrectValue, IsAtLeastXeHpgCore) {
|
||||
@ -44,21 +47,26 @@ HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndForceAllResourcesUncachedWhe
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(4);
|
||||
|
||||
const char *expectedStr = "-cl-store-cache-default=1 -cl-load-cache-default=1";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenL1CachePolicyHelperWhenDebugFlagSetAndGetL1CachePolicyThenReturnCorrectValue, MatchAny) {
|
||||
DebugManagerStateRestore restorer;
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(0);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 0u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 0u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 0u);
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 2u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 2u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 2u);
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(3);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 3u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 3u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 3u);
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(4);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 4u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 4u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 4u);
|
||||
}
|
||||
|
@ -42,7 +42,8 @@ HWTEST2_F(SbaTest, WhenAppendStateBaseAddressParametersIsCalledThenSBACmdHasBind
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendStateBaseAddressParameters(args, true);
|
||||
@ -84,7 +85,8 @@ HWTEST2_F(SbaTest, WhenProgramStateBaseAddressParametersIsCalledThenSBACmdHasBin
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@ -126,7 +128,8 @@ HWTEST2_F(SbaTest,
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
true // overrideSurfaceStateBaseAddress
|
||||
true, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@ -168,7 +171,8 @@ HWTEST2_F(SbaForBindlessTests, givenGlobalBindlessBaseAddressWhenProgramStateBas
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@ -223,7 +227,8 @@ HWTEST2_F(SbaForBindlessTests,
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
true // overrideSurfaceStateBaseAddress
|
||||
true, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@ -279,7 +284,8 @@ HWTEST2_F(SbaForBindlessTests, givenGlobalBindlessBaseAddressWhenPassingIndirect
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@ -316,7 +322,8 @@ HWTEST2_F(SbaTest, givenSbaWhenOverrideBindlessSurfaceBaseIsFalseThenBindlessSur
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendStateBaseAddressParameters(args, false);
|
||||
@ -355,7 +362,8 @@ HWTEST2_F(SbaTest, givenGlobalBindlessBaseAddressWhenSshIsPassedThenBindlessSurf
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@ -393,7 +401,8 @@ HWTEST2_F(SbaTest, givenSurfaceStateHeapWhenNotUsingGlobalHeapBaseThenBindlessSu
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@ -407,41 +416,110 @@ HWTEST2_F(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendExtraCacheSetti
|
||||
auto expectedStateBaseAddress = FamilyType::cmdInitStateBaseAddress;
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
StateBaseAddressHelperArgs<FamilyType> args = {
|
||||
0, // generalStateBase
|
||||
0, // indirectObjectHeapBaseAddress
|
||||
0, // instructionHeapBaseAddress
|
||||
0, // globalHeapsBaseAddress
|
||||
0, // surfaceStateBaseAddress
|
||||
&stateBaseAddress, // stateBaseAddressCmd
|
||||
nullptr, // dsh
|
||||
nullptr, // ioh
|
||||
&ssh, // ssh
|
||||
pDevice->getGmmHelper(), // gmmHelper
|
||||
0, // statelessMocsIndex
|
||||
MemoryCompressionState::NotApplicable, // memoryCompressionState
|
||||
false, // setInstructionStateBaseAddress
|
||||
false, // setGeneralStateBaseAddress
|
||||
false, // useGlobalHeapsBaseAddress
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(0, memcmp(&stateBaseAddress, &expectedStateBaseAddress, sizeof(STATE_BASE_ADDRESS)));
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(2);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(0, memcmp(&stateBaseAddress, &expectedStateBaseAddress, sizeof(STATE_BASE_ADDRESS)));
|
||||
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(0, memcmp(&stateBaseAddress, &expectedStateBaseAddress, sizeof(STATE_BASE_ADDRESS)));
|
||||
}
|
||||
|
||||
HWTEST2_F(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendExtraCacheSettingsThenProgramCorrectL1CachePolicy, IsAtLeastXeHpgCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
auto stateBaseAddress = FamilyType::cmdInitStateBaseAddress;
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
StateBaseAddressHelperArgs<FamilyType> args = {
|
||||
0, // generalStateBase
|
||||
0, // indirectObjectHeapBaseAddress
|
||||
0, // instructionHeapBaseAddress
|
||||
0, // globalHeapsBaseAddress
|
||||
0, // surfaceStateBaseAddress
|
||||
&stateBaseAddress, // stateBaseAddressCmd
|
||||
nullptr, // dsh
|
||||
nullptr, // ioh
|
||||
&ssh, // ssh
|
||||
pDevice->getGmmHelper(), // gmmHelper
|
||||
0, // statelessMocsIndex
|
||||
MemoryCompressionState::NotApplicable, // memoryCompressionState
|
||||
false, // setInstructionStateBaseAddress
|
||||
false, // setGeneralStateBaseAddress
|
||||
false, // useGlobalHeapsBaseAddress
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
{
|
||||
DebugManagerStateRestore restore;
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(2);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(2);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(3);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(3);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(4);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(4);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
args.isDebuggerActive = true;
|
||||
{
|
||||
DebugManagerStateRestore restore;
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(2);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(3);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(4);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(SbaTest, givenDebugFlagSetWhenAppendingSbaThenProgramCorrectL1CachePolicy, IsAtLeastXeHpgCore) {
|
||||
@ -475,7 +553,8 @@ HWTEST2_F(SbaTest, givenDebugFlagSetWhenAppendingSbaThenProgramCorrectL1CachePol
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
for (const auto &input : testInputs) {
|
||||
@ -555,7 +634,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, SbaTest, whenGeneralStateBaseAddressIsProgrammedThen
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
@ -586,7 +666,8 @@ HWTEST_F(SbaTest, givenNonZeroGeneralStateBaseAddressWhenProgrammingIsDisabledTh
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
@ -619,7 +700,8 @@ HWTEST_F(SbaTest, givenNonZeroInternalHeapBaseAddressWhenProgrammingIsDisabledTh
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
@ -658,7 +740,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, SbaTest, givenSbaProgrammingWhenHeapsAreNotProvidedT
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
@ -717,7 +800,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, SbaTest,
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
|
@ -104,13 +104,15 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsAdjustWalkOrderAvailableCallTh
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtMostXeHPWhenGetCachingPolicyOptionsThenReturnNullptr, IsAtMostXeHpCore) {
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(), nullptr);
|
||||
EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(false), nullptr);
|
||||
EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(true), nullptr);
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteByPassPolicyOption, IsAtLeastXeHpgCore) {
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
const char *expectedStr = "-cl-store-cache-default=2 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteBackPolicyOption, IsAtLeastXeHpgCore) {
|
||||
@ -119,7 +121,8 @@ HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThen
|
||||
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
const char *expectedStr = "-cl-store-cache-default=7 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndDebugFlagSetForceAllResourcesUncachedWhenGetCachingPolicyOptionsThenReturnUncachedPolicyOption, IsAtLeastXeHpgCore) {
|
||||
@ -129,7 +132,8 @@ HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndDebugFlagSetForceAllResource
|
||||
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
const char *expectedStr = "-cl-store-cache-default=1 -cl-load-cache-default=1";
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenCachePolicyWithoutCorrespondingBuildOptionWhenGetCachingPolicyOptionsThenReturnNullptr, IsAtLeastXeHpgCore) {
|
||||
@ -137,7 +141,8 @@ HWTEST2_F(HwInfoConfigTest, givenCachePolicyWithoutCorrespondingBuildOptionWhenG
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(5);
|
||||
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions());
|
||||
EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions(false));
|
||||
EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions(true));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigAndDebugFlagWhenGetL1CachePolicyThenReturnCorrectPolicy, IsAtLeastXeHpgCore) {
|
||||
@ -146,33 +151,40 @@ HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigAndDebugFlagWhenGetL1CachePolicyThe
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(0);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(true));
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, hwInfoConfig->getL1CachePolicy(true));
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(3);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, hwInfoConfig->getL1CachePolicy(true));
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(4);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, hwInfoConfig->getL1CachePolicy(true));
|
||||
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, hwInfoConfig->getL1CachePolicy(true));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenGetL1CachePolicyThenReturnWriteByPass, IsAtLeastXeHpgCore) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(true));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenPlatformWithUnsupportedL1CachePoliciesWhenGetL1CachePolicyThenReturnZero, IsAtMostXeHpCore) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
EXPECT_EQ(0u, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(0u, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(0u, hwInfoConfig->getL1CachePolicy(true));
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsPrefetcherDisablingInDirectSubmissionRequiredThenTrueIsReturned) {
|
||||
|
@ -7,6 +7,7 @@
|
||||
if(TESTS_XE_HP_CORE)
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_tests_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/excludes_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hp_core_tests.cpp
|
||||
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using L3ControlTests = ::testing::Test;
|
||||
|
||||
HWTEST2_F(L3ControlTests, givenL3ControlWhenAdjustCalledThenItIsNotChanged, IsXeHpCore) {
|
||||
using L3_CONTROL = typename FamilyType::L3_CONTROL;
|
||||
auto l3Control = FamilyType::cmdInitL3Control;
|
||||
auto l3ControlOnStart = l3Control;
|
||||
|
||||
adjustL3ControlField<FamilyType>(&l3Control);
|
||||
EXPECT_EQ(0, memcmp(&l3ControlOnStart, &l3Control, sizeof(L3_CONTROL))); // no change
|
||||
}
|
@ -11,6 +11,7 @@ if(TESTS_XE_HPG_CORE)
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${IGDRCL_SRCS_tests_xe_hpg_core_excludes}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_tests_xe_hpg_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_xe_hpg_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpg_core_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_xe_hpg_core.cpp
|
||||
|
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using L3ControlTests = ::testing::Test;
|
||||
|
||||
HWTEST2_F(L3ControlTests, givenL3ControlWhenAdjustCalledThenUnTypedDataPortCacheFlushIsSet, IsXeHpgCore) {
|
||||
using L3_CONTROL = typename FamilyType::L3_CONTROL;
|
||||
auto l3Control = FamilyType::cmdInitL3Control;
|
||||
auto l3ControlOnStart = l3Control;
|
||||
|
||||
adjustL3ControlField<FamilyType>(&l3Control);
|
||||
EXPECT_NE(0, memcmp(&l3ControlOnStart, &l3Control, sizeof(L3_CONTROL))); // no change
|
||||
|
||||
EXPECT_FALSE(l3ControlOnStart.getUnTypedDataPortCacheFlush());
|
||||
EXPECT_TRUE(l3Control.getUnTypedDataPortCacheFlush());
|
||||
}
|
@ -15,12 +15,16 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
DG2TEST_F(HwInfoConfigTest, givenDG2WhenGetL1CachePolicyThenReturnWbpPolicy) {
|
||||
DG2TEST_F(HwInfoConfigTest, givenDG2WhenGetL1CachePolicyThenReturnWbPolicyUnlessDebuggerIsActive) {
|
||||
using GfxFamily = typename HwMapper<IGFX_DG2>::GfxFamily;
|
||||
EXPECT_EQ(L1CachePolicyHelper<IGFX_DG2>::getL1CachePolicy(), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
EXPECT_EQ(L1CachePolicyHelper<IGFX_DG2>::getL1CachePolicy(false), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB);
|
||||
EXPECT_EQ(L1CachePolicyHelper<IGFX_DG2>::getL1CachePolicy(true), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
}
|
||||
|
||||
DG2TEST_F(HwInfoConfigTest, givenDG2WhenGetCachingPolicyOptionsThenReturnCorrectValue) {
|
||||
const char *expectedStr = "-cl-store-cache-default=2 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<IGFX_DG2>::getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
const char *writeBackPolicyOptions = "-cl-store-cache-default=7 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<IGFX_DG2>::getCachingPolicyOptions(false), writeBackPolicyOptions, strlen(writeBackPolicyOptions)));
|
||||
|
||||
const char *writeByPassPolicyOptions = "-cl-store-cache-default=2 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<IGFX_DG2>::getCachingPolicyOptions(true), writeByPassPolicyOptions, strlen(writeByPassPolicyOptions)));
|
||||
}
|
@ -18,8 +18,13 @@ HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfTile64With3
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenConvertingTimestampsToCsDomainThenNothingIsChanged, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfStorageInfoAdjustmentIsRequiredThenFalseIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteByPassPolicyOption_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenGetL1CachePolicyThenReturnWriteByPass_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetL1CachePolicyThenReturnCorrectValue_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(AILTests, whenModifyKernelIfRequiredIsCalledThenDontChangeKernelSources, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(CommandEncodeStatesTest, givenSlmTotalSizeEqualZeroWhenDispatchingKernelThenSharedMemorySizeIsSetCorrectly, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateInternalAllocationInDevicePoolThen32BitAllocationIsCreated, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenLinearStreamIsAllocatedInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKernelIsaInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKernelIsaInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendExtraCacheSettingsThenProgramCorrectL1CachePolicy_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHpgSbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWBPL1CachePolicy, IGFX_DG2);
|
||||
|
@ -53,7 +53,7 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgrammingStateComputeModeThenProperFieldsA
|
||||
|
||||
using Dg2SbaTest = SbaTest;
|
||||
|
||||
DG2TEST_F(Dg2SbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWtL1CachePolicy) {
|
||||
DG2TEST_F(Dg2SbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWBL1CachePolicyUnlessDebuggerIsActive) {
|
||||
auto sbaCmd = FamilyType::cmdInitStateBaseAddress;
|
||||
StateBaseAddressHelperArgs<FamilyType> args = {
|
||||
0, // generalStateBase
|
||||
@ -74,10 +74,14 @@ DG2TEST_F(Dg2SbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWtL1C
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::appendStateBaseAddressParameters(args, true);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, sbaCmd.getL1CachePolicyL1CacheControl());
|
||||
|
||||
args.isDebuggerActive = true;
|
||||
StateBaseAddressHelper<FamilyType>::appendStateBaseAddressParameters(args, true);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, sbaCmd.getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user