diff options
author | Felix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com> | 2023-09-27 17:46:17 +0100 |
---|---|---|
committer | felixjohnny.thomasmathibalan <felixjohnny.thomasmathibalan@arm.com> | 2023-09-28 12:08:05 +0000 |
commit | afd38f0c617d6f89b2b4532c6c44f116617e2b6f (patch) | |
tree | 03bc7d5a762099989b16a656fa8d397b490ed70e /src/dynamic_fusion/sketch/ArgumentPack.h | |
parent | bdcb4c148ee2fdeaaddf4cf1e57bbb0de02bb894 (diff) | |
download | ComputeLibrary-afd38f0c617d6f89b2b4532c6c44f116617e2b6f.tar.gz |
Apply clang-format on repository
Code is formatted as per a revised clang format configuration
file(not part of this delivery). Version 14.0.6 is used.
Exclusion List:
- files with .cl extension
- files that are not strictly C/C++ (e.g. Android.bp, Sconscript ...)
And the following directories
- compute_kernel_writer/validation/
- tests/
- include/
- src/core/NEON/kernels/convolution/
- src/core/NEON/kernels/arm_gemm/
- src/core/NEON/kernels/arm_conv/
- data/
There will be a follow up for formatting of .cl files and the
files under tests/ and compute_kernel_writer/validation/.
Signed-off-by: Felix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com>
Change-Id: Ib7eb1fcf4e7537b9feaefcfc15098a804a3fde0a
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10391
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Diffstat (limited to 'src/dynamic_fusion/sketch/ArgumentPack.h')
-rw-r--r-- | src/dynamic_fusion/sketch/ArgumentPack.h | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/src/dynamic_fusion/sketch/ArgumentPack.h b/src/dynamic_fusion/sketch/ArgumentPack.h index f118d7d851..3bf380b1ec 100644 --- a/src/dynamic_fusion/sketch/ArgumentPack.h +++ b/src/dynamic_fusion/sketch/ArgumentPack.h @@ -25,6 +25,7 @@ #define SRC_DYNAMIC_FUSION_SKETCH_ARGUMENTPACK #include "arm_compute/core/experimental/Types.h" + #include <unordered_map> #include <vector> @@ -52,26 +53,21 @@ public: */ struct PackElement { - PackElement() = default; - PackElement(const PackElement &elem) = default; + PackElement() = default; + PackElement(const PackElement &elem) = default; PackElement &operator=(const PackElement &elem) = default; PackElement(PackElement &&elem) = default; - PackElement &operator=(PackElement &&elem) = default; - PackElement(Id id, T *tensor) - : id(id), tensor(tensor), ctensor(nullptr) + PackElement &operator=(PackElement &&elem) = default; + PackElement(Id id, T *tensor) : id(id), tensor(tensor), ctensor(nullptr) { } - PackElement(Id id, const T *ctensor) - : id(id), tensor(nullptr), ctensor(ctensor) + PackElement(Id id, const T *ctensor) : id(id), tensor(nullptr), ctensor(ctensor) { } - Id id{ ACL_UNKNOWN }; /**< Argument id within the pack */ - T *tensor{ nullptr }; /**< Non-const pointer to tensor-related object */ - const T *ctensor - { - nullptr - }; /**< Const pointer to tensor-related object */ + Id id{ACL_UNKNOWN}; /**< Argument id within the pack */ + T *tensor{nullptr}; /**< Non-const pointer to tensor-related object */ + const T *ctensor{nullptr}; /**< Const pointer to tensor-related object */ }; public: @@ -88,10 +84,9 @@ public: /** Allow instances of this class to be moved */ ArgumentPack<T> &operator=(ArgumentPack<T> &&other) = default; /** Initializer list Constructor */ - ArgumentPack(const std::initializer_list<PackElement> &l) - : _pack{} + ArgumentPack(const std::initializer_list<PackElement> &l) : _pack{} { - for(const auto &e : l) + for (const auto &e : l) { _pack[e.id] = e; } @@ -134,7 +129,7 @@ public: const T *get_const_tensor(Id id) const { auto it = _pack.find(id); - if(it != _pack.end()) + if (it != _pack.end()) { return it->second.ctensor != nullptr ? it->second.ctensor : it->second.tensor; } @@ -171,10 +166,10 @@ public: std::vector<T *> get_src_tensors() { std::vector<T *> src_tensors{}; - for(int id = static_cast<int>(TensorType::ACL_SRC); id <= static_cast<int>(TensorType::ACL_SRC_END); ++id) + for (int id = static_cast<int>(TensorType::ACL_SRC); id <= static_cast<int>(TensorType::ACL_SRC_END); ++id) { auto tensor = get_tensor(static_cast<TensorType>(id)); - if(tensor != nullptr) + if (tensor != nullptr) { src_tensors.push_back(tensor); } @@ -188,10 +183,10 @@ public: std::vector<const T *> get_const_src_tensors() const { std::vector<const T *> src_tensors{}; - for(int id = static_cast<int>(TensorType::ACL_SRC); id <= static_cast<int>(TensorType::ACL_SRC_END); ++id) + for (int id = static_cast<int>(TensorType::ACL_SRC); id <= static_cast<int>(TensorType::ACL_SRC_END); ++id) { auto tensor = get_const_tensor(static_cast<TensorType>(id)); - if(tensor != nullptr) + if (tensor != nullptr) { src_tensors.push_back(tensor); } @@ -205,10 +200,10 @@ public: std::vector<T *> get_dst_tensors() { std::vector<T *> dst_tensors{}; - for(int id = static_cast<int>(TensorType::ACL_DST); id <= static_cast<int>(TensorType::ACL_DST_END); ++id) + for (int id = static_cast<int>(TensorType::ACL_DST); id <= static_cast<int>(TensorType::ACL_DST_END); ++id) { auto tensor = get_tensor(static_cast<TensorType>(id)); - if(tensor != nullptr) + if (tensor != nullptr) { dst_tensors.push_back(tensor); } @@ -222,10 +217,10 @@ public: std::vector<const T *> get_const_dst_tensors() const { std::vector<const T *> dst_tensors{}; - for(int id = static_cast<int>(TensorType::ACL_DST); id <= static_cast<int>(TensorType::ACL_DST_END); ++id) + for (int id = static_cast<int>(TensorType::ACL_DST); id <= static_cast<int>(TensorType::ACL_DST_END); ++id) { auto tensor = get_const_tensor(static_cast<TensorType>(id)); - if(tensor != nullptr) + if (tensor != nullptr) { dst_tensors.push_back(tensor); } |