14 std::shared_ptr<ICustomAllocator> customAllocator,
15 const size_t typeAlignment)
18 m_AllocatorBufferStoragePairVector.emplace_back(std::make_pair<
Allocator, std::vector<BufferStorage>>(
20 std::move(bufferStorageVector)));
25 for (
auto& m_AllocatorBufferStoragePair : m_AllocatorBufferStoragePairVector)
27 auto& allocator = m_AllocatorBufferStoragePair.first;
28 for (
auto&& bufferStorage : m_AllocatorBufferStoragePair.second)
30 bufferStorage.m_Buffer = allocator.m_CustomAllocator->allocate(bufferStorage.m_BufferSize, 0);
32 for (
auto tensorMemory : bufferStorage.m_TensorMemoryVector)
34 tensorMemory->m_Data = allocator.m_CustomAllocator->GetMemoryRegionAtOffset(bufferStorage.m_Buffer,
35 tensorMemory->m_Offset);
43 for (
auto& m_AllocatorBufferStoragePair : m_AllocatorBufferStoragePairVector)
45 auto& allocator = m_AllocatorBufferStoragePair.first;
46 for (
auto&& bufferStorage : m_AllocatorBufferStoragePair.second)
48 allocator.m_CustomAllocator->free(bufferStorage.m_Buffer);