diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/helpers/MemoryHelpers.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/helpers/MemoryHelpers.h b/src/core/helpers/MemoryHelpers.h index 6756a90c25..dfa8e60758 100644 --- a/src/core/helpers/MemoryHelpers.h +++ b/src/core/helpers/MemoryHelpers.h @@ -56,12 +56,13 @@ WorkspaceData<TensorType> manage_workspace(const experimental::MemoryRequirement continue; } - const auto aux_info = TensorInfo{ TensorShape(req.size), 1, DataType::U8 }; + const auto alignment = req.alignment; + const auto aux_info = TensorInfo{ TensorShape(req.size + alignment), 1, DataType::U8 }; workspace_memory.emplace_back(req.slot, std::make_unique<TensorType>()); auto aux_tensor = workspace_memory.back().second.get(); ARM_COMPUTE_ERROR_ON_NULLPTR(aux_tensor); - aux_tensor->allocator()->init(aux_info); + aux_tensor->allocator()->init(aux_info, alignment); if(req.lifetime == experimental::MemoryLifetime::Temporary) { @@ -82,5 +83,14 @@ WorkspaceData<TensorType> manage_workspace(const experimental::MemoryRequirement return workspace_memory; } + +template <typename TensorType> +WorkspaceData<TensorType> manage_workspace(const experimental::MemoryRequirements &mem_reqs, + MemoryGroup &mgroup, + ITensorPack &run_pack) +{ + ITensorPack dummy_prep_pack{}; + return manage_workspace<TensorType>(mem_reqs, mgroup, run_pack, dummy_prep_pack); +} } // namespace arm_compute #endif /* SRC_COMMON_MEMORY_HELPERS_H */ |