performance: Cache host resources when mitigate dc flush

Related-To: NEO-10556

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2024-05-21 08:54:21 +00:00 committed by Compute-Runtime-Automation
parent cf8f0b9cd8
commit c39b750790
4 changed files with 17 additions and 4 deletions

View File

@ -131,6 +131,7 @@ class ProductHelper {
virtual bool isDcFlushAllowed() const = 0;
virtual bool isDcFlushMitigated() const = 0;
virtual bool overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const = 0;
virtual bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const = 0;
virtual uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const = 0;
virtual bool getUuid(NEO::DriverModel *driverModel, const uint32_t subDeviceCount, const uint32_t deviceIndex, std::array<uint8_t, ProductHelper::uuidSize> &uuid) const = 0;
virtual bool isFlushTaskAllowed() const = 0;

View File

@ -407,16 +407,22 @@ bool ProductHelperHw<gfxProduct>::isDcFlushMitigated() const {
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const {
return this->isDcFlushMitigated() &&
(this->overrideCacheableForDcFlushMitigation(allocationType) ||
allocationType == AllocationType::timestampPacketTagBuffer ||
allocationType == AllocationType::tagBuffer ||
allocationType == AllocationType::gpuTimestampDeviceBuffer);
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::overrideCacheableForDcFlushMitigation(AllocationType allocationType) const {
return this->isDcFlushMitigated() &&
(allocationType == AllocationType::externalHostPtr ||
allocationType == AllocationType::bufferHostMemory ||
allocationType == AllocationType::mapAllocation ||
allocationType == AllocationType::svmCpu ||
allocationType == AllocationType::svmZeroCopy ||
allocationType == AllocationType::internalHostMemory ||
allocationType == AllocationType::timestampPacketTagBuffer ||
allocationType == AllocationType::tagBuffer ||
allocationType == AllocationType::gpuTimestampDeviceBuffer);
allocationType == AllocationType::internalHostMemory);
}
template <PRODUCT_FAMILY gfxProduct>

View File

@ -76,6 +76,7 @@ class ProductHelperHw : public ProductHelper {
bool isDcFlushAllowed() const override;
bool isDcFlushMitigated() const override;
bool overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const override;
bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const override;
uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const override;
bool getUuid(NEO::DriverModel *driverModel, uint32_t subDeviceCount, uint32_t deviceIndex, std::array<uint8_t, ProductHelper::uuidSize> &uuid) const override;
bool isFlushTaskAllowed() const override;

View File

@ -281,6 +281,11 @@ bool ProductHelperHw<IGFX_UNKNOWN>::overridePatAndUsageForDcFlushMitigation(Allo
return false;
}
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::overrideCacheableForDcFlushMitigation(AllocationType allocationType) const {
return false;
}
template <>
uint32_t ProductHelperHw<IGFX_UNKNOWN>::computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const {
return hwInfo.gtSystemInfo.MaxSubSlicesSupported;