fix: set host function allocation as uncached

The usage of host function allocation is similar to tagBuffer.
Ensure it's uncached and it follows tag buffer's cache policy.
Host function allocation will be readable and writable
by both: cpu and gpu.

Related-To: NEO-14577
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2025-09-24 16:34:45 +00:00
committed by Compute-Runtime-Automation
parent 16050126e3
commit 4133827e6f
2 changed files with 3 additions and 3 deletions

View File

@@ -56,12 +56,10 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching
}
if (hwInfo->capabilityTable.isIntegratedDevice) {
if (productHelper.isResourceUncachedForCS(allocationType) || AllocationType::tagBuffer == allocationType) {
if (productHelper.isResourceUncachedForCS(allocationType) || AllocationType::tagBuffer == allocationType || AllocationType::hostFunction == allocationType) {
return GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC;
} else if (AllocationType::semaphoreBuffer == allocationType) {
return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
} else if (AllocationType::hostFunction == allocationType) {
return GMM_RESOURCE_USAGE_OCL_BUFFER;
}
}

View File

@@ -773,6 +773,7 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) {
expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
break;
case AllocationType::tagBuffer:
case AllocationType::hostFunction:
expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC;
break;
case AllocationType::semaphoreBuffer:
@@ -875,6 +876,7 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu
expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
break;
case AllocationType::tagBuffer:
case AllocationType::hostFunction:
expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC;
break;
case AllocationType::semaphoreBuffer: