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/runtime/ITensorAllocator.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'arm_compute/runtime/ITensorAllocator.h') diff --git a/arm_compute/runtime/ITensorAllocator.h b/arm_compute/runtime/ITensorAllocator.h index e80f7c4fb9..17e581b40e 100644 --- a/arm_compute/runtime/ITensorAllocator.h +++ b/arm_compute/runtime/ITensorAllocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -36,7 +36,7 @@ class ITensorAllocator { public: /** Default constructor. */ - ITensorAllocator(); + ITensorAllocator() = default; /** Allow instances of this class to be copy constructed */ ITensorAllocator(const ITensorAllocator &) = default; /** Allow instances of this class to be copied */ @@ -54,6 +54,14 @@ public: * @param[in] alignment Alignment in bytes that the underlying base pointer should comply with. */ void init(const TensorInfo &input, size_t alignment = 0); + /** Initialize a tensor based with a reference TensorInfo + * + * @note ITensorAllocator won't own the TensorInfo thus these need to out-live + * + * @param[in] input TensorInfo object containing the description of the tensor to initialize. + * @param[in] alignment Alignment in bytes that the underlying base pointer should comply with. + */ + void soft_init(TensorInfo &input, size_t alignment = 0); /** Return a reference to the tensor's metadata * * @return Reference to the tensor's metadata. @@ -93,8 +101,9 @@ protected: virtual void unlock() = 0; private: - TensorInfo _info; /**< Tensor's metadata. */ - size_t _alignment; /**< Tensor's alignment in bytes */ + TensorInfo _info_owned{}; /**< Tensor's metadata. */ + TensorInfo *_info_external{ nullptr }; /**< External Tensor's metadata */ + size_t _alignment{}; /**< Tensor's alignment in bytes */ }; } // namespace arm_compute #endif /*ARM_COMPUTE_ITENSORALLOCATOR_H */ -- cgit v1.2.1