Refactor: use stack vector for root device indices

Stack vector will not cause dynamic allocations in most circumstances
ie. number of root device indices not more than 16

Related-To: NEO-6837

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2022-04-07 13:09:40 +00:00
committed by Compute-Runtime-Automation
parent f7e04b32aa
commit 8d1ad5a4f3
46 changed files with 194 additions and 133 deletions

View File

@@ -122,7 +122,7 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
return OsAgnosticMemoryManager::reserveCpuAddressRange(size, rootDeviceIndex);
}
void *createMultiGraphicsAllocationInSystemMemoryPool(std::vector<uint32_t> &rootDeviceIndices,
void *createMultiGraphicsAllocationInSystemMemoryPool(RootDeviceIndicesContainer &rootDeviceIndices,
AllocationProperties &properties,
MultiGraphicsAllocation &multiGraphicsAllocation) override {
if (isMockEventPoolCreateMemoryManager) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -21,14 +21,14 @@ class MockTagAllocator : public TagAllocator<TagType> {
MockTagAllocator(uint32_t rootDeviceIndex, MemoryManager *memoryManager, size_t tagCount,
size_t tagAlignment, size_t tagSize, bool doNotReleaseNodes, DeviceBitfield deviceBitfield)
: BaseClass(std::vector<uint32_t>{rootDeviceIndex}, memoryManager, tagCount, tagAlignment, tagSize, doNotReleaseNodes, deviceBitfield) {
: BaseClass(RootDeviceIndicesContainer({rootDeviceIndex}), memoryManager, tagCount, tagAlignment, tagSize, doNotReleaseNodes, deviceBitfield) {
}
MockTagAllocator(uint32_t rootDeviceIndex, MemoryManager *memoryManager, size_t tagCount = 10)
: MockTagAllocator(rootDeviceIndex, memoryManager, tagCount, MemoryConstants::cacheLineSize, sizeof(TagType), false, mockDeviceBitfield) {
}
MockTagAllocator(const std::vector<uint32_t> &rootDeviceIndices, MemoryManager *memoryManager, size_t tagCount = 10)
MockTagAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memoryManager, size_t tagCount = 10)
: BaseClass(rootDeviceIndices, memoryManager, tagCount, MemoryConstants::cacheLineSize, sizeof(TagType), false, mockDeviceBitfield) {}
void returnTag(TagNodeBase *node) override {