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/gpu/template_writer/GpuKernelVariableTable.cpp | |
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/gpu/template_writer/GpuKernelVariableTable.cpp')
-rw-r--r-- | src/dynamic_fusion/sketch/gpu/template_writer/GpuKernelVariableTable.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/dynamic_fusion/sketch/gpu/template_writer/GpuKernelVariableTable.cpp b/src/dynamic_fusion/sketch/gpu/template_writer/GpuKernelVariableTable.cpp index 0972b4e8e2..775b0a0c8c 100644 --- a/src/dynamic_fusion/sketch/gpu/template_writer/GpuKernelVariableTable.cpp +++ b/src/dynamic_fusion/sketch/gpu/template_writer/GpuKernelVariableTable.cpp @@ -22,8 +22,10 @@ * SOFTWARE. */ #include "GpuKernelVariableTable.h" + #include "arm_compute/core/CL/CLHelpers.h" #include "arm_compute/core/ITensorInfo.h" + #include "src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h" namespace arm_compute @@ -32,14 +34,17 @@ namespace experimental { namespace dynamic_fusion { -void GpuKernelVariableTable::declare_variable(const GpuKernelComponentGroup &comp_group, const ITensorInfo *tensor, GpuKernelArgumentInfo argument_info, const std::string &alias) +void GpuKernelVariableTable::declare_variable(const GpuKernelComponentGroup &comp_group, + const ITensorInfo *tensor, + GpuKernelArgumentInfo argument_info, + const std::string &alias) { ARM_COMPUTE_ERROR_ON_MSG(!tensor->has_valid_id(), "Tensor info with valid id expected"); // Do not re-declare if the variable associated with the tensor has already been declared auto it = _vars.find(tensor->id()); - if(it != _vars.end()) + if (it != _vars.end()) { ARM_COMPUTE_ERROR_ON(!(it->second.kernel_argument_info == argument_info)); return; @@ -47,14 +52,12 @@ void GpuKernelVariableTable::declare_variable(const GpuKernelComponentGroup &com const auto target = comp_group.get_tile_for_tensor(tensor); - if(target != tensor) + if (target != tensor) { // If the tensor uses a shared tile, don't declare another variable. it = _vars.find(target->id()); - ARM_COMPUTE_ERROR_ON_MSG( - it == _vars.end(), - "The variable used for this tensor must have been declared."); + ARM_COMPUTE_ERROR_ON_MSG(it == _vars.end(), "The variable used for this tensor must have been declared."); _vars[tensor->id()] = it->second; } @@ -64,7 +67,7 @@ void GpuKernelVariableTable::declare_variable(const GpuKernelComponentGroup &com std::stringstream ss; ss << alias << "_t" << abs(tensor->id()); const auto uniq_name = ss.str(); - TensorVariable var{ tensor->id(), uniq_name, argument_info }; + TensorVariable var{tensor->id(), uniq_name, argument_info}; _vars.emplace(tensor->id(), var); } @@ -76,12 +79,13 @@ GpuKernelVariableTable::TensorVariable GpuKernelVariableTable::get_variable(cons return var; } -GpuKernelVariableTable::VariableList GpuKernelVariableTable::get_variable_list(const std::vector<const ITensorInfo *> &tensors) const +GpuKernelVariableTable::VariableList +GpuKernelVariableTable::get_variable_list(const std::vector<const ITensorInfo *> &tensors) const { VariableList vars{}; - for(const auto &tensor : tensors) + for (const auto &tensor : tensors) { - if(!tensor->has_valid_id()) + if (!tensor->has_valid_id()) { continue; } @@ -90,23 +94,19 @@ GpuKernelVariableTable::VariableList GpuKernelVariableTable::get_variable_list(c return vars; } -TagVal::TagVal(const GpuKernelVariableTable::TensorVariable &var) - : value{ var.uniq_name } +TagVal::TagVal(const GpuKernelVariableTable::TensorVariable &var) : value{var.uniq_name} { } -TagVal::TagVal(const std::string &val) - : value{ val } +TagVal::TagVal(const std::string &val) : value{val} { } -TagVal::TagVal(const char *val) - : value{ std::string(val) } +TagVal::TagVal(const char *val) : value{std::string(val)} { } -TagVal::TagVal(const DataType &data_type) - : value{ get_cl_type_from_data_type(data_type) } +TagVal::TagVal(const DataType &data_type) : value{get_cl_type_from_data_type(data_type)} { } } // namespace dynamic_fusion |