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/core/ITensorPack.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/core/ITensorPack.h')
-rw-r--r-- | arm_compute/core/ITensorPack.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/arm_compute/core/ITensorPack.h b/arm_compute/core/ITensorPack.h index 8aea880bb6..2f41d4d51e 100644 --- a/arm_compute/core/ITensorPack.h +++ b/arm_compute/core/ITensorPack.h @@ -24,9 +24,11 @@ #ifndef ARM_COMPUTE_ITENSORPACK_H #define ARM_COMPUTE_ITENSORPACK_H +#include "arm_compute/core/experimental/Types.h" + #include <cstddef> #include <cstdint> -#include <map> +#include <unordered_map> namespace arm_compute { @@ -36,19 +38,20 @@ class ITensor; /** Tensor packing service */ class ITensorPack { -private: +public: struct PackElement { PackElement() = default; - PackElement(ITensor *tensor) - : tensor(tensor), ctensor(nullptr) + PackElement(int id, ITensor *tensor) + : id(id), tensor(tensor), ctensor(nullptr) { } - PackElement(const ITensor *ctensor) - : tensor(nullptr), ctensor(ctensor) + PackElement(int id, const ITensor *ctensor) + : id(id), tensor(nullptr), ctensor(ctensor) { } + int id{ -1 }; ITensor *tensor{ nullptr }; const ITensor *ctensor{ nullptr }; }; @@ -56,6 +59,8 @@ private: public: /** Default Constructor */ ITensorPack() = default; + /** Initializer list Constructor */ + ITensorPack(std::initializer_list<PackElement> l); /** Add tensor to the pack * * @param[in] id ID/type of the tensor to add @@ -102,7 +107,7 @@ public: bool empty() const; private: - std::map<unsigned int, PackElement> _pack{}; /**< Container with the packed tensors */ + std::unordered_map<int, PackElement> _pack{}; /**< Container with the packed tensors */ }; } // namespace arm_compute #endif /*ARM_COMPUTE_ITENSORPACK_H */ |