From 0499dff9293a86d3d53f72fed0a38b2823563674 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 31 Jul 2020 22:21:38 +0100 Subject: COMPMID-3392: Collapse TensorMaps into a single TensorPack Collapse InputTensorMap and OutputTensorMap to a single TensorPack mechanism. Signed-off-by: Georgios Pinitas Change-Id: Ie2fdfc6b07d84ad589169ec99ca64fcf45a00bec Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/c/VisualCompute/ComputeLibrary/+/253783 Tested-by: bsgcomp Reviewed-by: Michalis Spyrou Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3641 Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins Reviewed-by: SiCong Li Reviewed-by: Sheri Zhang --- arm_compute/core/CL/ICLKernel.h | 7 +++---- arm_compute/core/CL/kernels/CLActivationLayerKernel.h | 3 +-- arm_compute/core/CL/kernels/CLBatchConcatenateLayerKernel.h | 3 +-- arm_compute/core/CL/kernels/CLDepthConcatenateLayerKernel.h | 3 +-- arm_compute/core/CL/kernels/CLElementWiseUnaryLayerKernel.h | 3 +-- arm_compute/core/CL/kernels/CLElementwiseOperationKernel.h | 3 +-- arm_compute/core/CL/kernels/CLFillBorderKernel.h | 2 +- arm_compute/core/CL/kernels/CLHeightConcatenateLayerKernel.h | 3 +-- arm_compute/core/CL/kernels/CLPixelWiseMultiplicationKernel.h | 4 ++-- arm_compute/core/CL/kernels/CLReshapeLayerKernel.h | 3 +-- arm_compute/core/CL/kernels/CLStridedSliceKernel.h | 3 +-- arm_compute/core/CL/kernels/CLWidthConcatenate2TensorsKernel.h | 3 +-- arm_compute/core/CL/kernels/CLWidthConcatenate4TensorsKernel.h | 3 +-- arm_compute/core/CL/kernels/CLWidthConcatenateLayerKernel.h | 3 +-- 14 files changed, 17 insertions(+), 29 deletions(-) (limited to 'arm_compute/core/CL') diff --git a/arm_compute/core/CL/ICLKernel.h b/arm_compute/core/CL/ICLKernel.h index 6e606ff857..d4990a1dee 100644 --- a/arm_compute/core/CL/ICLKernel.h +++ b/arm_compute/core/CL/ICLKernel.h @@ -225,14 +225,13 @@ public: * * @note The queue is *not* flushed by this method, and therefore the kernel will not have been executed by the time this method returns. * - * @param[in] inputs A vector containing the input tensors. - * @param[in] outputs A vector containing the output tensors. + * @param[in] tensors A vector containing the tensors to operato on. * @param[in] window Region on which to execute the kernel. (Must be a valid region of the window returned by window()). * @param[in,out] queue Command queue on which to enqueue the kernel. */ - virtual void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, const Window &window, cl::CommandQueue &queue) + virtual void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) { - ARM_COMPUTE_UNUSED(inputs, outputs, window, queue); + ARM_COMPUTE_UNUSED(tensors, window, queue); } /** Add the passed parameters to the object's kernel's arguments starting from the index idx. * diff --git a/arm_compute/core/CL/kernels/CLActivationLayerKernel.h b/arm_compute/core/CL/kernels/CLActivationLayerKernel.h index cf62ca600b..81d4ccb065 100644 --- a/arm_compute/core/CL/kernels/CLActivationLayerKernel.h +++ b/arm_compute/core/CL/kernels/CLActivationLayerKernel.h @@ -68,8 +68,7 @@ public: static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ActivationLayerInfo &act_info); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; private: bool _run_in_place; diff --git a/arm_compute/core/CL/kernels/CLBatchConcatenateLayerKernel.h b/arm_compute/core/CL/kernels/CLBatchConcatenateLayerKernel.h index 890fecf0c9..bb8968ca83 100644 --- a/arm_compute/core/CL/kernels/CLBatchConcatenateLayerKernel.h +++ b/arm_compute/core/CL/kernels/CLBatchConcatenateLayerKernel.h @@ -73,8 +73,7 @@ public: static Status validate(const ITensorInfo *input, unsigned int batch_offset, const ITensorInfo *output); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; private: unsigned int _batch_offset; diff --git a/arm_compute/core/CL/kernels/CLDepthConcatenateLayerKernel.h b/arm_compute/core/CL/kernels/CLDepthConcatenateLayerKernel.h index ad365d655b..d8493bc5d8 100644 --- a/arm_compute/core/CL/kernels/CLDepthConcatenateLayerKernel.h +++ b/arm_compute/core/CL/kernels/CLDepthConcatenateLayerKernel.h @@ -71,8 +71,7 @@ public: static Status validate(const ITensorInfo *input, unsigned int depth_offset, const ITensorInfo *output); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; private: unsigned int _depth_offset; diff --git a/arm_compute/core/CL/kernels/CLElementWiseUnaryLayerKernel.h b/arm_compute/core/CL/kernels/CLElementWiseUnaryLayerKernel.h index f8f158c5bc..82cd953b68 100644 --- a/arm_compute/core/CL/kernels/CLElementWiseUnaryLayerKernel.h +++ b/arm_compute/core/CL/kernels/CLElementWiseUnaryLayerKernel.h @@ -60,8 +60,7 @@ public: static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ElementWiseUnary &op); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; }; } // namespace arm_compute #endif /* ARM_COMPUTE_CLELEMENTWISEUNARYLAYERKERNEL_H */ diff --git a/arm_compute/core/CL/kernels/CLElementwiseOperationKernel.h b/arm_compute/core/CL/kernels/CLElementwiseOperationKernel.h index 76bc879638..b459292161 100644 --- a/arm_compute/core/CL/kernels/CLElementwiseOperationKernel.h +++ b/arm_compute/core/CL/kernels/CLElementwiseOperationKernel.h @@ -54,8 +54,7 @@ public: ~CLElementwiseOperationKernel() = default; // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, const Window &window, cl::CommandQueue &queue) override; - + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; BorderSize border_size() const override; protected: diff --git a/arm_compute/core/CL/kernels/CLFillBorderKernel.h b/arm_compute/core/CL/kernels/CLFillBorderKernel.h index 8cad68dc1a..5323af4c0e 100644 --- a/arm_compute/core/CL/kernels/CLFillBorderKernel.h +++ b/arm_compute/core/CL/kernels/CLFillBorderKernel.h @@ -85,7 +85,7 @@ public: void set_constant_border(unsigned int idx, const PixelValue &constant_border_value); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; void run(const Window &window, cl::CommandQueue &queue) override; bool is_parallelisable() const override; diff --git a/arm_compute/core/CL/kernels/CLHeightConcatenateLayerKernel.h b/arm_compute/core/CL/kernels/CLHeightConcatenateLayerKernel.h index 0563fad414..4fa2b40881 100644 --- a/arm_compute/core/CL/kernels/CLHeightConcatenateLayerKernel.h +++ b/arm_compute/core/CL/kernels/CLHeightConcatenateLayerKernel.h @@ -68,8 +68,7 @@ public: static Status validate(const ITensorInfo *input, unsigned int height_offset, const ITensorInfo *output); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; private: unsigned int _height_offset; diff --git a/arm_compute/core/CL/kernels/CLPixelWiseMultiplicationKernel.h b/arm_compute/core/CL/kernels/CLPixelWiseMultiplicationKernel.h index 86159fc915..6b5bd11bde 100644 --- a/arm_compute/core/CL/kernels/CLPixelWiseMultiplicationKernel.h +++ b/arm_compute/core/CL/kernels/CLPixelWiseMultiplicationKernel.h @@ -132,7 +132,7 @@ public: ConvertPolicy overflow_policy, RoundingPolicy rounding_policy, const ActivationLayerInfo &act_info = ActivationLayerInfo()); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; BorderSize border_size() const override; private: @@ -184,7 +184,7 @@ public: static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info = ActivationLayerInfo()); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; BorderSize border_size() const override; private: diff --git a/arm_compute/core/CL/kernels/CLReshapeLayerKernel.h b/arm_compute/core/CL/kernels/CLReshapeLayerKernel.h index 11c06d1cab..6e3f255c52 100644 --- a/arm_compute/core/CL/kernels/CLReshapeLayerKernel.h +++ b/arm_compute/core/CL/kernels/CLReshapeLayerKernel.h @@ -53,8 +53,7 @@ public: static Status validate(const ITensorInfo *input, const ITensorInfo *output); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; }; } // namespace arm_compute #endif /*ARM_COMPUTE_CLRESHAPELAYERKERNEL_H */ diff --git a/arm_compute/core/CL/kernels/CLStridedSliceKernel.h b/arm_compute/core/CL/kernels/CLStridedSliceKernel.h index 28a665b113..74311b71fa 100644 --- a/arm_compute/core/CL/kernels/CLStridedSliceKernel.h +++ b/arm_compute/core/CL/kernels/CLStridedSliceKernel.h @@ -73,8 +73,7 @@ public: int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; }; } // namespace arm_compute #endif /*ARM_COMPUTE_CL_STRIDED_SLICE_KERNEL_H */ diff --git a/arm_compute/core/CL/kernels/CLWidthConcatenate2TensorsKernel.h b/arm_compute/core/CL/kernels/CLWidthConcatenate2TensorsKernel.h index aaedaa90ee..a379b5f0b8 100644 --- a/arm_compute/core/CL/kernels/CLWidthConcatenate2TensorsKernel.h +++ b/arm_compute/core/CL/kernels/CLWidthConcatenate2TensorsKernel.h @@ -67,8 +67,7 @@ public: static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; }; } // namespace arm_compute #endif /* ARM_COMPUTE_CLWIDTHCONCATENATE_2TENSORS_KERNEL_H */ diff --git a/arm_compute/core/CL/kernels/CLWidthConcatenate4TensorsKernel.h b/arm_compute/core/CL/kernels/CLWidthConcatenate4TensorsKernel.h index b1d6e890a0..6b0e8ee21d 100644 --- a/arm_compute/core/CL/kernels/CLWidthConcatenate4TensorsKernel.h +++ b/arm_compute/core/CL/kernels/CLWidthConcatenate4TensorsKernel.h @@ -71,8 +71,7 @@ public: static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *input3, const ITensorInfo *input4, const ITensorInfo *output); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; }; } // namespace arm_compute #endif /* ARM_COMPUTE_CLWIDTHCONCATENATE_4TENSORS_KERNEL_H */ diff --git a/arm_compute/core/CL/kernels/CLWidthConcatenateLayerKernel.h b/arm_compute/core/CL/kernels/CLWidthConcatenateLayerKernel.h index cb8777d5fd..32e90af404 100644 --- a/arm_compute/core/CL/kernels/CLWidthConcatenateLayerKernel.h +++ b/arm_compute/core/CL/kernels/CLWidthConcatenateLayerKernel.h @@ -68,8 +68,7 @@ public: static Status validate(const ITensorInfo *input, unsigned int width_offset, const ITensorInfo *output); // Inherited methods overridden: - void run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, - const Window &window, cl::CommandQueue &queue) override; + void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; private: unsigned int _width_offset; -- cgit v1.2.1