Refactor HwHelper

- move common implementation to hw_heleper_common.inl
- add method for setting localMemorySupported cap

Change-Id: I1b4e0b48ce45d6d60b2c9d61102d849ea69e4043
This commit is contained in:
Hoppe, Mateusz
2018-09-06 16:41:50 +02:00
committed by sys_ocldev
parent df41112b6a
commit b11e7b961a
5 changed files with 20 additions and 16 deletions

View File

@@ -27,11 +27,6 @@
namespace OCLRT {
typedef CNLFamily Family;
template <>
size_t HwHelperHw<Family>::getMaxBarrierRegisterPerSlice() const {
return 32;
}
template <>
void HwHelperHw<Family>::setCapabilityCoherencyFlag(const HardwareInfo *pHwInfo, bool &coherencyFlag) {
if (pHwInfo->pPlatform->usRevId < 0x4) {

View File

@@ -33,11 +33,6 @@ size_t HwHelperHw<Family>::getMaxBarrierRegisterPerSlice() const {
return 16;
}
template <>
bool HwHelperHw<Family>::setupPreemptionRegisters(HardwareInfo *pHwInfo, bool enable) {
return false;
}
template <>
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) {
caps->image3DMaxHeight = 2048;

View File

@@ -27,11 +27,6 @@
namespace OCLRT {
typedef SKLFamily Family;
template <>
size_t HwHelperHw<Family>::getMaxBarrierRegisterPerSlice() const {
return 32;
}
template <>
bool HwHelperHw<Family>::setupPreemptionRegisters(HardwareInfo *pHwInfo, bool enable) {
pHwInfo->capabilityTable.whitelistedRegisters.csChicken1_0x2580 = enable;

View File

@@ -49,6 +49,7 @@ class HwHelper {
protected:
HwHelper(){};
virtual bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) = 0;
};
template <typename GfxFamily>
@@ -97,6 +98,8 @@ class HwHelperHw : public HwHelper {
uint32_t getConfigureAddressSpaceMode() override;
bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) override;
private:
HwHelperHw(){};
};

View File

@@ -34,6 +34,11 @@ template <typename Family>
void HwHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo) {
}
template <typename Family>
bool HwHelperHw<Family>::isLocalMemoryEnabled(const HardwareInfo &hwInfo) {
return false;
}
template <typename Family>
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) {
caps->image3DMaxHeight = 16384;
@@ -42,7 +47,7 @@ void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, c
//Reason to subtract 8KB is that driver may pad the buffer with addition pages for over fetching..
caps->maxMemAllocSize = (4ULL * MemoryConstants::gigaByte) - (8ULL * MemoryConstants::kiloByte);
caps->isStatelesToStatefullWithOffsetSupported = true;
caps->localMemorySupported = false;
caps->localMemorySupported = isLocalMemoryEnabled(hwInfo);
}
template <typename Family>
@@ -63,4 +68,15 @@ template <typename Family>
uint32_t HwHelperHw<Family>::getConfigureAddressSpaceMode() {
return 0u;
}
template <typename Family>
bool HwHelperHw<Family>::setupPreemptionRegisters(HardwareInfo *pHwInfo, bool enable) {
return false;
}
template <typename Family>
size_t HwHelperHw<Family>::getMaxBarrierRegisterPerSlice() const {
return 32;
}
} // namespace OCLRT