mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
fix: Remove default setting of gmm flag Cacheable to true
- add debug flag EnableCpuCacheForResources to be able to allow coherency when resources could be cacheable Resolves: NEO-7194 Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
af2c61c54b
commit
004a3d875c
@@ -28,6 +28,13 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getGmmUsageType(AllocationType
|
||||
}
|
||||
}
|
||||
|
||||
bool CacheSettingsHelper::isResourceCacheableOnCpu(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType) {
|
||||
if (DebugManager.flags.EnableCpuCacheForResources.get()) {
|
||||
return !CacheSettingsHelper::isUncachedType(gmmResourceUsageType);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper) {
|
||||
|
||||
switch (allocationType) {
|
||||
|
||||
@@ -26,6 +26,8 @@ struct CacheSettingsHelper {
|
||||
(gmmResourceUsageType == GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED));
|
||||
}
|
||||
|
||||
static bool isResourceCacheableOnCpu(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType);
|
||||
|
||||
protected:
|
||||
static GMM_RESOURCE_USAGE_TYPE_ENUM getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper);
|
||||
static GMM_RESOURCE_USAGE_TYPE_ENUM getDefaultUsageTypeWithCachingDisabled(AllocationType allocationType);
|
||||
|
||||
@@ -39,7 +39,7 @@ Gmm::Gmm(GmmHelper *gmmHelper, const void *alignedPtr, size_t alignedSize, size_
|
||||
|
||||
resourceParams.Usage = gmmResourceUsage;
|
||||
resourceParams.Flags.Info.Linear = 1;
|
||||
resourceParams.Flags.Info.Cacheable = !CacheSettingsHelper::isUncachedType(gmmResourceUsage);
|
||||
resourceParams.Flags.Info.Cacheable = CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsage);
|
||||
resourceParams.Flags.Gpu.Texture = 1;
|
||||
|
||||
if (alignedPtr) {
|
||||
|
||||
Reference in New Issue
Block a user