GTPinFree to check for buffer in shared memory

Related-To: NEO-5667

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2021-04-28 16:11:12 +00:00
committed by Compute-Runtime-Automation
parent 52308244a6
commit 2f4f5a22ae
2 changed files with 42 additions and 1 deletions

View File

@@ -53,7 +53,8 @@ GTPIN_DI_STATUS GTPIN_DRIVER_CALLCONV gtpinFreeBuffer(context_handle_t context,
if ((pContext == nullptr) || (resource == nullptr)) {
return GTPIN_DI_ERROR_INVALID_ARGUMENT;
}
if (pContext->getMemoryManager()->isLocalMemorySupported(pContext->getDevice(0)->getRootDeviceIndex())) {
GTPinHwHelper &gtpinHelper = GTPinHwHelper::get(pContext->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily);
if (gtpinHelper.canUseSharedAllocation(pContext->getDevice(0)->getHardwareInfo())) {
auto allocData = reinterpret_cast<SvmAllocationData *>(resource);
clMemFreeINTEL(pContext, allocData->cpuAllocation->getUnderlyingBuffer());
} else {