Add isL3Configurable() method to HwHelper

Add isL3Configurable() method to HwHelper to query if L3 is
configurable using an HwHelper instance.

Change-Id: I0f350ae292f12980611a250301293378dbd8dd91
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
This commit is contained in:
Sebastian Sanchez
2019-08-28 20:46:37 -07:00
committed by sys_ocldev
parent 5f46acb089
commit 08a3046e4d
3 changed files with 22 additions and 0 deletions

View File

@ -37,6 +37,7 @@ class HwHelper {
virtual void setCapabilityCoherencyFlag(const HardwareInfo *pHwInfo, bool &coherencyFlag) = 0;
virtual void adjustDefaultEngineType(HardwareInfo *pHwInfo) = 0;
virtual void setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) = 0;
virtual bool isL3Configurable(const HardwareInfo &hwInfo) = 0;
virtual SipKernelType getSipKernelType(bool debuggingActive) = 0;
virtual uint32_t getConfigureAddressSpaceMode() = 0;
virtual bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) const = 0;
@ -124,6 +125,8 @@ class HwHelperHw : public HwHelper {
void setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) override;
bool isL3Configurable(const HardwareInfo &hwInfo) override;
SipKernelType getSipKernelType(bool debuggingActive) override;
uint32_t getConfigureAddressSpaceMode() override;

View File

@ -12,6 +12,7 @@
#include "runtime/helpers/hardware_commands_helper.h"
#include "runtime/helpers/hw_helper.h"
#include "runtime/helpers/hw_info.h"
#include "runtime/helpers/preamble.h"
#include "runtime/memory_manager/graphics_allocation.h"
#include "runtime/memory_manager/memory_constants.h"
#include "runtime/os_interface/os_interface.h"
@ -36,6 +37,11 @@ void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, c
caps->isStatelesToStatefullWithOffsetSupported = true;
}
template <typename Family>
bool HwHelperHw<Family>::isL3Configurable(const HardwareInfo &hwInfo) {
return PreambleHelper<Family>::isL3Configurable(hwInfo);
}
template <typename Family>
SipKernelType HwHelperHw<Family>::getSipKernelType(bool debuggingActive) {
if (!debuggingActive) {

View File

@ -571,6 +571,19 @@ HWTEST_F(HwHelperTest, DISABLED_profilingCreationOfRenderSurfaceStateVsMemcpyOfC
}
}
HWTEST_F(HwHelperTest, testIfL3ConfigProgrammable) {
bool PreambleHelperL3Config;
bool isL3Programmable;
const HardwareInfo &hwInfo = **platformDevices;
PreambleHelperL3Config =
PreambleHelper<FamilyType>::isL3Configurable(**platformDevices);
isL3Programmable =
HwHelperHw<FamilyType>::get().isL3Configurable(hwInfo);
EXPECT_EQ(PreambleHelperL3Config, isL3Programmable);
}
TEST(HwHelperCacheFlushTest, givenEnableCacheFlushFlagIsEnableWhenPlatformDoesNotSupportThenOverrideAndReturnSupportTrue) {
DebugManagerStateRestore restore;
DebugManager.flags.EnableCacheFlushAfterWalker.set(1);