mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 23:33:20 +08:00
Use device index from os context when allocating heaps and command buffers
Related-To: NEO-3691 Change-Id: I64015d606bba289d250920899ad620171e8303b7 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
1448f6a312
commit
7cb6d665a5
@@ -126,7 +126,7 @@ void CommandStreamReceiver::ensureCommandBufferAllocation(LinearStream &commandS
|
||||
auto allocation = this->getInternalAllocationStorage()->obtainReusableAllocation(allocationSize, allocationType).release();
|
||||
if (allocation == nullptr) {
|
||||
const AllocationProperties commandStreamAllocationProperties{true, allocationSize, allocationType,
|
||||
isMultiOsContextCapable(), deviceIndex};
|
||||
isMultiOsContextCapable(), getDeviceIndexForAllocation()};
|
||||
allocation = this->getMemoryManager()->allocateGraphicsMemoryWithProperties(commandStreamAllocationProperties);
|
||||
}
|
||||
DEBUG_BREAK_IF(allocation == nullptr);
|
||||
@@ -297,6 +297,10 @@ IndirectHeap &CommandStreamReceiver::getIndirectHeap(IndirectHeap::Type heapType
|
||||
return *heap;
|
||||
}
|
||||
|
||||
uint32_t CommandStreamReceiver::getDeviceIndexForAllocation() const {
|
||||
return osContext->getDeviceBitfield().any() ? static_cast<uint32_t>(Math::log2(static_cast<uint32_t>(osContext->getDeviceBitfield().to_ulong()))) : 0u;
|
||||
}
|
||||
|
||||
void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType,
|
||||
size_t minRequiredSize, IndirectHeap *&indirectHeap) {
|
||||
size_t reservedSize = 0;
|
||||
@@ -321,7 +325,7 @@ void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType,
|
||||
|
||||
if (!heapMemory) {
|
||||
heapMemory = getMemoryManager()->allocateGraphicsMemoryWithProperties({true, finalHeapSize, allocationType,
|
||||
isMultiOsContextCapable(), deviceIndex});
|
||||
isMultiOsContextCapable(), getDeviceIndexForAllocation()});
|
||||
} else {
|
||||
finalHeapSize = std::max(heapMemory->getUnderlyingBufferSize(), finalHeapSize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user