mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
[2/n] Unified Shared Memory
- Add kernel flags specifying indirect usage of device allocations. - make device usm allocation resident when kernel requires this Related-To: NEO-3148 Change-Id: I689347a0ea9b0f84c83f7883ca2381be63c61af9 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
0894601edc
commit
8e969684f1
@@ -34,6 +34,7 @@
|
||||
#include "runtime/mem_obj/pipe.h"
|
||||
#include "runtime/memory_manager/memory_manager.h"
|
||||
#include "runtime/memory_manager/surface.h"
|
||||
#include "runtime/memory_manager/svm_memory_manager.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
#include "runtime/platform/platform.h"
|
||||
#include "runtime/program/kernel_info.h"
|
||||
@@ -940,6 +941,12 @@ void Kernel::clearKernelExecInfo() {
|
||||
svmAllocationsRequireCacheFlush = false;
|
||||
}
|
||||
|
||||
void Kernel::setUnifiedMemoryProperty(cl_kernel_exec_info infoType, bool infoValue) {
|
||||
if (infoType == CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL) {
|
||||
this->unifiedMemoryControls.indirectDeviceAllocationsAllowed = infoValue;
|
||||
}
|
||||
}
|
||||
|
||||
inline void Kernel::makeArgsResident(CommandStreamReceiver &commandStreamReceiver) {
|
||||
|
||||
auto numArgs = kernelInfo.kernelArgInfo.size();
|
||||
@@ -989,6 +996,10 @@ void Kernel::makeResident(CommandStreamReceiver &commandStreamReceiver) {
|
||||
}
|
||||
|
||||
gtpinNotifyMakeResident(this, &commandStreamReceiver);
|
||||
|
||||
if (unifiedMemoryControls.indirectDeviceAllocationsAllowed) {
|
||||
this->getContext().getSVMAllocsManager()->makeInternalAllocationsResident(commandStreamReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
void Kernel::getResidency(std::vector<Surface *> &dst) {
|
||||
|
||||
Reference in New Issue
Block a user