aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/experimental
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2021-08-20 17:26:45 +0100
committerSiCong Li <sicong.li@arm.com>2021-08-24 09:00:23 +0000
commit87a74effff65f6fa1b0e565818e02c3b414ae1cf (patch)
tree0c5d63bbbcc285232959a5a4134f282a980ab4bf /arm_compute/core/experimental
parent511771fbe0a74e6d9dfd37ba9b4926a8315ec7aa (diff)
downloadComputeLibrary-87a74effff65f6fa1b0e565818e02c3b414ae1cf.tar.gz
Re-use auxiliary memory withing CpuWinogradConv2d operators
Input/Output transformation operations are independent and done in different time-steps of the algorithm, this memory can be re-used between this transformation stages. Moreover, reduce the allocation when extracting workspace sizes for Winograd trasformations. There is a mix return of sizes in bytes and elements, thus ensure the correct is in place. storage_size() member functions return elements while working_space() function bytes. Resolves: COMPMID-4781 Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Change-Id: I705445ba7ca818cead48369db3cacd49684c7192 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6145 Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'arm_compute/core/experimental')
-rw-r--r--arm_compute/core/experimental/Types.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arm_compute/core/experimental/Types.h b/arm_compute/core/experimental/Types.h
index 1983344075..a478513b1b 100644
--- a/arm_compute/core/experimental/Types.h
+++ b/arm_compute/core/experimental/Types.h
@@ -104,6 +104,20 @@ struct MemoryInfo
alignment(alignment)
{
}
+
+ bool merge(int slot, size_t new_size, size_t new_alignment = 0) noexcept
+ {
+ if(slot != this->slot)
+ {
+ return false;
+ }
+
+ size = std::max(size, new_size);
+ alignment = std::max(alignment, new_alignment);
+
+ return true;
+ }
+
int slot{ ACL_UNKNOWN };
MemoryLifetime lifetime{ MemoryLifetime::Temporary };
size_t size{ 0 };