mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Create MAP_ALLOCATION as non-svm allocation when host ptr tracking is disabled.
Change-Id: I57c64706e798efa4b23e34b582be5a490d592e87 Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
@@ -336,8 +336,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &
|
||||
if (allocationData.flags.shareable) {
|
||||
return allocateShareableMemory(allocationData);
|
||||
}
|
||||
if (allocationData.type == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR &&
|
||||
(!peekExecutionEnvironment().isFullRangeSvm() || !isHostPointerTrackingEnabled())) {
|
||||
if (useNonSvmHostPtrAlloc(allocationData.type)) {
|
||||
auto allocation = allocateGraphicsMemoryForNonSvmHostPtr(allocationData);
|
||||
if (allocation) {
|
||||
allocation->setFlushL3Required(allocationData.flags.flushL3);
|
||||
@@ -483,6 +482,7 @@ void *MemoryManager::getReservedMemory(size_t size, size_t alignment) {
|
||||
}
|
||||
|
||||
bool MemoryManager::isHostPointerTrackingEnabled() {
|
||||
|
||||
if (DebugManager.flags.EnableHostPtrTracking.get() != -1) {
|
||||
return !!DebugManager.flags.EnableHostPtrTracking.get();
|
||||
}
|
||||
|
||||
@@ -193,6 +193,10 @@ class MemoryManager {
|
||||
return allocationType == GraphicsAllocation::AllocationType::KERNEL_ISA ||
|
||||
allocationType == GraphicsAllocation::AllocationType::INTERNAL_HEAP;
|
||||
}
|
||||
bool useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType allocationType) {
|
||||
return ((allocationType == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR || allocationType == GraphicsAllocation::AllocationType::MAP_ALLOCATION) &&
|
||||
(!peekExecutionEnvironment().isFullRangeSvm() || !isHostPointerTrackingEnabled()));
|
||||
}
|
||||
StorageInfo createStorageInfoFromProperties(const AllocationProperties &properties);
|
||||
|
||||
virtual GraphicsAllocation *createGraphicsAllocation(OsHandleStorage &handleStorage, const AllocationData &allocationData) = 0;
|
||||
|
||||
Reference in New Issue
Block a user