mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Use createHostUnifiedMemoryAllocation in clHostMemAllocINTEL
Unlock multi device setup for host allocation Related-To: NEO-5422 Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
92f067b9aa
commit
3385500396
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
* Copyright (C) 2017-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -123,7 +123,7 @@ void *SVMAllocsManager::createHostUnifiedMemoryAllocation(size_t size,
|
||||
const UnifiedMemoryProperties &memoryProperties) {
|
||||
size_t alignedSize = alignUp<size_t>(size, MemoryConstants::pageSize64k);
|
||||
|
||||
GraphicsAllocation::AllocationType allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
|
||||
GraphicsAllocation::AllocationType allocationType = getGraphicsAllocationType(memoryProperties);
|
||||
|
||||
std::vector<uint32_t> rootDeviceIndicesVector(memoryProperties.rootDeviceIndices.begin(), memoryProperties.rootDeviceIndices.end());
|
||||
|
||||
@ -138,6 +138,8 @@ void *SVMAllocsManager::createHostUnifiedMemoryAllocation(size_t size,
|
||||
deviceBitfield.count() > 1,
|
||||
deviceBitfield};
|
||||
unifiedMemoryProperties.flags.shareable = memoryProperties.allocationFlags.flags.shareable;
|
||||
unifiedMemoryProperties.flags.isUSMHostAllocation = true;
|
||||
unifiedMemoryProperties.flags.isUSMDeviceAllocation = false;
|
||||
|
||||
auto maxRootDeviceIndex = *std::max_element(rootDeviceIndicesVector.begin(), rootDeviceIndicesVector.end(), std::less<uint32_t const>());
|
||||
SvmAllocationData allocData(maxRootDeviceIndex);
|
||||
|
Reference in New Issue
Block a user