blob: fd0f966da1a8521e099db3755a6244f671dcd75a [file] [log] [blame]
Ramy Elgammalf800adf2022-12-14 15:39:29 +00001/*
Gunes Bayir0ee13af2024-02-07 15:34:45 +00002 * Copyright (c) 2023-2024 Arm Limited.
Ramy Elgammalf800adf2022-12-14 15:39:29 +00003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
Gunes Bayir0ee13af2024-02-07 15:34:45 +000024#ifndef ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_CL_CLCOMPONENTRESHAPE_H
25#define ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_CL_CLCOMPONENTRESHAPE_H
Ramy Elgammalf800adf2022-12-14 15:39:29 +000026
27#include "src/dynamic_fusion/sketch/gpu/components/IGpuKernelComponent.h"
28
29namespace arm_compute
30{
31/** Forward declaration */
32class ITensorInfo;
33namespace experimental
34{
35namespace dynamic_fusion
36{
37/** Forward declaration */
38template <typename T>
39class ArgumentPack;
40
41/** Forward declaration */
42class ClTemplateReshape;
43
44class ClComponentReshape final : public IGpuKernelComponent
45{
46public:
47public:
48 /** Validate the component
49 *
50 * @param[in,out] tensors Tensor arguments to the component
51 *
52 * @return Status Validation results
53 *
54 * Tensor argument names:
55 * - ACL_SRC_0: src
56 * - ACL_DST_0: dst
57 *
58 * Tensor argument constness:
59 * - ACL_SRC_0: Const
60 * - ACL_DST_0: Const
61 *
62 * Valid data layouts:
63 * - All
64 *
65 * Valid data type configurations:
66 * - All
67 */
68 static Status validate(const ArgumentPack<ITensorInfo> &tensors);
69
70 /** Constructor
71 *
72 * @param[in] id Component id
73 * @param[in] properties Component properties @ref Properties
74 * @param[in] tensors Tensor arguments to the component
75 */
Felix Thomasmathibalanafd38f02023-09-27 17:46:17 +010076 ClComponentReshape(ComponentId id, const Properties &properties, const ArgumentPack<ITensorInfo> &tensors);
Ramy Elgammalf800adf2022-12-14 15:39:29 +000077
78 /** Destructor */
79 ~ClComponentReshape() override;
80 /** Prevent instances of this class from being copy constructed */
81 ClComponentReshape(const ClComponentReshape &component) = delete;
82 /** Prevent instances of this class from being copied */
83 ClComponentReshape &operator=(const ClComponentReshape &component) = delete;
84 /** Allow instances of this class to be move constructed */
85 ClComponentReshape(ClComponentReshape &&component) = default;
86 /** Allow instances of this class to be moved */
87 ClComponentReshape &operator=(ClComponentReshape &&component) = default;
Gunes Bayir0ee13af2024-02-07 15:34:45 +000088 /** Get writer for the component */
89 const IGpuCkwComponentDriver *ckw_component_driver() const override;
Ramy Elgammalf800adf2022-12-14 15:39:29 +000090 /** Get component type */
91 GpuComponentType type() const override
92 {
93 return GpuComponentType::Complex;
94 }
95
96private:
Ramy Elgammalf800adf2022-12-14 15:39:29 +000097};
98} // namespace dynamic_fusion
99} // namespace experimental
100} // namespace arm_compute
101
Gunes Bayir0ee13af2024-02-07 15:34:45 +0000102#endif // ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_CL_CLCOMPONENTRESHAPE_H