Enable support for indirect allocation access to Kernels

Change-Id: I3ded8cce3761a38aa4a4d71b4089f79c844311c5
Signed-off-by: Raiyan Latif <raiyan.latif@intel.com>
This commit is contained in:
Raiyan Latif
2020-03-12 16:33:22 -07:00
committed by sys_ocldev
parent c0131430d4
commit 43433244f9
8 changed files with 54 additions and 11 deletions

View File

@@ -64,6 +64,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::executeCommandListImmediate(bo
template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamily<gfxCoreFamily>::close() {
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
commandContainer.removeDuplicatesFromResidencyContainer();
NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::programBatchBufferEnd(commandContainer);
return ZE_RESULT_SUCCESS;

View File

@@ -13,6 +13,7 @@
#include "shared/source/helpers/register_offsets.h"
#include "shared/source/helpers/simd_helper.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/residency_container.h"
#include "shared/source/unified_memory/unified_memory.h"
#include <algorithm>
@@ -43,11 +44,12 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchFunctionWithParams
prepareIndirectParams(pThreadGroupDimensions);
}
auto csr = device->getNEODevice()->getDefaultEngine().commandStreamReceiver;
UnifiedMemoryControls unifiedMemoryControls = function->getUnifiedMemoryControls();
if (function->hasIndirectAllocationsAllowed()) {
device->getDriverHandle()->getSvmAllocsManager()->makeInternalAllocationsResident(*csr, unifiedMemoryControls.generateMask());
UnifiedMemoryControls unifiedMemoryControls = function->getUnifiedMemoryControls();
auto svmAllocsManager = device->getDriverHandle()->getSvmAllocsManager();
auto &residencyContainer = commandContainer.getResidencyContainer();
svmAllocsManager->addInternalAllocationsToResidencyContainer(residencyContainer, unifiedMemoryControls.generateMask());
}
NEO::EncodeDispatchKernel<GfxFamily>::encode(commandContainer,