fix: don't set Cacheable on xe_hp and later

Related-To: NEO-7194
Signed-off-by: Cencelewska, Katarzyna <katarzyna.cencelewska@intel.com>
This commit is contained in:
Cencelewska, Katarzyna
2023-05-17 15:36:43 +00:00
committed by Compute-Runtime-Automation
parent 813f9287d9
commit 5f22e9eaca
9 changed files with 39 additions and 10 deletions

View File

@@ -8,6 +8,7 @@
#include "shared/source/gmm_helper/cache_settings_helper.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/helpers/gfx_core_helper.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/memory_manager/allocation_type.h"
#include "shared/source/os_interface/product_helper.h"
@@ -28,11 +29,12 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getGmmUsageType(AllocationType
}
}
bool CacheSettingsHelper::isResourceCacheableOnCpu(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType) {
bool CacheSettingsHelper::isResourceCacheableOnCpu(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType, const GfxCoreHelper &gfxCoreHelper) {
bool isCachingOnCpuAvailable = gfxCoreHelper.isCachingOnCpuAvailable();
if (DebugManager.flags.EnableCpuCacheForResources.get()) {
return !CacheSettingsHelper::isUncachedType(gmmResourceUsageType);
isCachingOnCpuAvailable = true;
}
return false;
return isCachingOnCpuAvailable && !CacheSettingsHelper::isUncachedType(gmmResourceUsageType);
}
GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper) {

View File

@@ -16,6 +16,7 @@ namespace NEO {
enum class AllocationType;
struct HardwareInfo;
class ProductHelper;
class GfxCoreHelper;
struct CacheSettingsHelper {
static GMM_RESOURCE_USAGE_TYPE_ENUM getGmmUsageType(AllocationType allocationType, bool forceUncached, const ProductHelper &productHelper);
@@ -26,7 +27,7 @@ struct CacheSettingsHelper {
(gmmResourceUsageType == GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED));
}
static bool isResourceCacheableOnCpu(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType);
static bool isResourceCacheableOnCpu(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType, const GfxCoreHelper &gfxCoreHelper);
protected:
static GMM_RESOURCE_USAGE_TYPE_ENUM getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper);

View File

@@ -39,7 +39,8 @@ Gmm::Gmm(GmmHelper *gmmHelper, const void *alignedPtr, size_t alignedSize, size_
resourceParams.Usage = gmmResourceUsage;
resourceParams.Flags.Info.Linear = 1;
resourceParams.Flags.Info.Cacheable = CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsage);
auto &gfxCoreHelper = gmmHelper->getRootDeviceEnvironment().getHelper<GfxCoreHelper>();
resourceParams.Flags.Info.Cacheable = CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsage, gfxCoreHelper);
resourceParams.Flags.Gpu.Texture = 1;
if (alignedPtr) {