From 856f66e6c61b77d03f754cd0fa8439891f0e4aca Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 22 Apr 2021 21:13:21 +0100 Subject: Port CLGEMM to memory injecting interface Moves the following kernels: - CLGEMMMatrixMultiplyKernel - CLGEMMMatrixMultiplyNativeKernel - CLGEMMMatrixMultipluReshapedKernel - CLGEMMMatrixMultiplyReshapedOnlyRHSKernel Moves the following functions - CLGEMM Introduces facilities to easy handling of auxiliary temporary buffers under then new run interface. Such are: - CLAuxTensorHandler: That allows wrapping of workspace buffers memory to CLBuffer objects - Ability to inject TensorInfo to allocator without transferring ownership. This reduce the copy overhead if needed. Resolves: COMPMID-4188 Signed-off-by: Georgios Pinitas Change-Id: I7055435d831b05b749b26302082e4ac45f26dfb0 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5498 Tested-by: Arm Jenkins Reviewed-by: Michalis Spyrou Comments-Addressed: Arm Jenkins --- arm_compute/core/experimental/Types.h | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'arm_compute/core/experimental') diff --git a/arm_compute/core/experimental/Types.h b/arm_compute/core/experimental/Types.h index 7ddb930421..92ece460dc 100644 --- a/arm_compute/core/experimental/Types.h +++ b/arm_compute/core/experimental/Types.h @@ -47,6 +47,7 @@ enum TensorType : int32_t ACL_DST_0 = 30, ACL_DST_1 = 31, ACL_DST_2 = 32, + ACL_BIAS = ACL_SRC_2, ACL_INT = 50, ACL_INT_0 = 50, ACL_INT_1 = 51, @@ -54,21 +55,40 @@ enum TensorType : int32_t ACL_INT_3 = 53, ACL_INT_4 = 54, ACL_SRC_VEC = 256, + ACL_DST_VEC = 512, + ACL_INT_VEC = 1024 }; namespace experimental { +enum class MemoryLifetime +{ + Temporary = 0, + Persistent = 1, + Prepare = 2, +}; struct MemoryInfo { - MemoryInfo(TensorType type, size_t size, size_t alignment) noexcept - : type(type), + MemoryInfo() = default; + + MemoryInfo(int slot, size_t size, size_t alignment = 0) noexcept + : slot(slot), + size(size), + alignment(alignment) + { + } + + MemoryInfo(int slot, MemoryLifetime lifetime, size_t size, size_t alignment = 0) noexcept + : slot(slot), + lifetime(lifetime), size(size), alignment(alignment) { } - TensorType type; - size_t size; - size_t alignment; + int slot{ ACL_UNKNOWN }; + MemoryLifetime lifetime{ MemoryLifetime::Temporary }; + size_t size{ 0 }; + size_t alignment{ 64 }; }; using MemoryRequirements = std::vector; -- cgit v1.2.1