diff options
author | SiCong Li <sicong.li@arm.com> | 2023-06-28 09:49:45 +0100 |
---|---|---|
committer | SiCong Li <sicong.li@arm.com> | 2023-07-25 15:48:50 +0000 |
commit | 23882a9014eb3972bca958206866c8e0d0b829cc (patch) | |
tree | 9139b91699099160e26a64abd8cf182bd7447278 /src/dynamic_fusion/sketch/gpu/GpuWorkloadSketchImpl.h | |
parent | 0a59e69fd922b02d9e3b5b043ee7f891061df7be (diff) | |
download | ComputeLibrary-23882a9014eb3972bca958206866c8e0d0b829cc.tar.gz |
Add GpuKernelArgumentBinding for runtime argument setting
* Add flexible runtime argument setting that accept argument bindings
exported from ckw.
* Introduce internal build flag ACL_INTERNAL_TEST_CKW_IN_DF. If set to
true, ckw will be tested in dynamic fusion validation tests. Otherwise
it will not be tested and the dynamic fusion will keep using
ClTemplateWriter instead.
* Fix CKW sampler for elementwise binary to deal with tile sizes > 1
in both dimensions
Resolves: COMPMID-6282
Partially resolves: COMPMID-6260
Signed-off-by: SiCong Li <sicong.li@arm.com>
Change-Id: I0ab225a4484eb2119643d900a4e72806558626ee
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9917
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Jakub Sujak <jakub.sujak@arm.com>
Reviewed-by: Anitha Raj <Anitha.Raj@arm.com>
Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/dynamic_fusion/sketch/gpu/GpuWorkloadSketchImpl.h')
-rw-r--r-- | src/dynamic_fusion/sketch/gpu/GpuWorkloadSketchImpl.h | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/src/dynamic_fusion/sketch/gpu/GpuWorkloadSketchImpl.h b/src/dynamic_fusion/sketch/gpu/GpuWorkloadSketchImpl.h index 44c99e844b..d3033898e9 100644 --- a/src/dynamic_fusion/sketch/gpu/GpuWorkloadSketchImpl.h +++ b/src/dynamic_fusion/sketch/gpu/GpuWorkloadSketchImpl.h @@ -26,13 +26,10 @@ #include "arm_compute/dynamic_fusion/sketch/MemoryDescriptor.h" #include "arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.h" -#include "src/dynamic_fusion/sketch/gpu/GpuWorkloadContextImpl.h" #include "src/dynamic_fusion/sketch/gpu/GpuComponentServices.h" #include "src/dynamic_fusion/sketch/gpu/GpuKernelComponentGraph.h" #include "src/dynamic_fusion/sketch/gpu/GpuOperatorGroup.h" - -#include <memory> -#include <vector> +#include "src/dynamic_fusion/sketch/gpu/GpuWorkloadContextImpl.h" namespace arm_compute { @@ -52,9 +49,8 @@ public: Context *context) : _context{ context }, _comp_services{}, - _component_graph{ &_comp_services }, - _operator_group{}, - _managed_tensor_info_list{ std::vector<std::unique_ptr<TensorInfo>>() } + _component_graph{ _context, &_comp_services }, + _operator_group{} { } /** Prevent instances of this class from being copy constructed */ @@ -90,10 +86,6 @@ public: { return _operator_group; } - ITensorInfo::Id allocate_new_tensor_id() - { - return ++_next_id; - } /** Generate @ref GpuWorkloadSourceCode from the workload sketch * @note The sketch must be valid. Any error encountered during the building of the code will be thrown. * @@ -110,37 +102,29 @@ public: */ ITensorInfo *create_virtual_tensor() { - auto uptr = std::make_unique<TensorInfo>(); - _context->implementation().register_virtual_tensor(*uptr); - _managed_tensor_info_list.emplace_back(std::move(uptr)); - return _managed_tensor_info_list.back().get(); + return _context->implementation().create_virtual_tensor(); } /** Create an auxiliary (see @ref MemoryType) tensor info and save it * - * @return ITensorInfo* The created auxiliary tensor info object pointer - */ - - /** Create an auxiliary (see @ref MemoryType) tensor info and save it - * * @param[in] tensor_info @ref ITensorInfo to copy from * * @return ITensorInfo* The created auxiliary tensor info object pointer */ ITensorInfo *create_auxiliary_tensor(const ITensorInfo &tensor_info) { - auto uptr = std::make_unique<TensorInfo>(tensor_info); - _context->implementation().register_aux_tensor(*uptr, AuxMemoryInfo{ uptr->total_size() }); - _managed_tensor_info_list.emplace_back(std::move(uptr)); - return _managed_tensor_info_list.back().get(); + return _context->implementation().create_auxiliary_tensor(tensor_info); + } + + ITensorInfo *get_tensor_info(ITensorInfo::Id id) + { + return _context->implementation().get_tensor_info(id); } private: - Context *_context; - GpuComponentServices _comp_services; - GpuKernelComponentGraph _component_graph; - GpuOperatorGroup _operator_group; - ITensorInfo::Id _next_id{ ITensorInfo::invalid_tensor_id }; - std::vector<std::unique_ptr<TensorInfo>> _managed_tensor_info_list; + Context *_context; + GpuComponentServices _comp_services; + GpuKernelComponentGraph _component_graph; + GpuOperatorGroup _operator_group; }; } // namespace dynamic_fusion } // namespace experimental |