diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-04-22 21:13:21 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-05-18 14:48:39 +0000 |
commit | 856f66e6c61b77d03f754cd0fa8439891f0e4aca (patch) | |
tree | f9379cd0853ac407109e54c3d53b385ceee066c2 /arm_compute/runtime/ITensorAllocator.h | |
parent | 37f4b2ef1ea225a90ccb563fcb2c08f8fb0fb5d5 (diff) | |
download | ComputeLibrary-856f66e6c61b77d03f754cd0fa8439891f0e4aca.tar.gz |
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 <georgios.pinitas@arm.com>
Change-Id: I7055435d831b05b749b26302082e4ac45f26dfb0
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5498
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/runtime/ITensorAllocator.h')
-rw-r--r-- | arm_compute/runtime/ITensorAllocator.h | 17 |
1 files changed, 13 insertions, 4 deletions
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 */ |