diff options
author | Sang-Hoon Park <sang-hoon.park@arm.com> | 2021-05-18 10:46:00 +0100 |
---|---|---|
committer | Pablo Marquez Tello <pablo.tello@arm.com> | 2021-05-27 16:33:44 +0000 |
commit | b3be45759bdd0749ae3a16fe470820f0d9830ea9 (patch) | |
tree | 10bb8c1c0a049a23c00781c64e993f1b197c0d05 /src/core | |
parent | bc91297c865808ed2c321febc405179f63195ff8 (diff) | |
download | ComputeLibrary-b3be45759bdd0749ae3a16fe470820f0d9830ea9.tar.gz |
Implement memory injection in CpuDirectGemmConv2d
The following operators are now stateless by implementing
memory injection.
- CpuDirectGemmConv2d
- CpuGemmAssemblyDispatch
A test case is added to test if CpuDirectGemmConv2d can
run on different group of tensors with a single configure.
Resolves: COMPMID-4506
Change-Id: I48f44ed41236ca7e18da2de07bdbacc9007a3c5e
Signed-off-by: Sang-Hoon Park <sang-hoon.park@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5718
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez Tello <pablo.tello@arm.com>
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 */ |