Ramy Elgammal | f800adf | 2022-12-14 15:39:29 +0000 | [diff] [blame] | 1 | /* |
Gunes Bayir | 0ee13af | 2024-02-07 15:34:45 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2023-2024 Arm Limited. |
Ramy Elgammal | f800adf | 2022-12-14 15:39:29 +0000 | [diff] [blame] | 3 | * |
| 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 Bayir | 0ee13af | 2024-02-07 15:34:45 +0000 | [diff] [blame^] | 24 | #ifndef ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_CL_CLCOMPONENTRESHAPE_H |
| 25 | #define ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_CL_CLCOMPONENTRESHAPE_H |
Ramy Elgammal | f800adf | 2022-12-14 15:39:29 +0000 | [diff] [blame] | 26 | |
| 27 | #include "src/dynamic_fusion/sketch/gpu/components/IGpuKernelComponent.h" |
| 28 | |
| 29 | namespace arm_compute |
| 30 | { |
| 31 | /** Forward declaration */ |
| 32 | class ITensorInfo; |
| 33 | namespace experimental |
| 34 | { |
| 35 | namespace dynamic_fusion |
| 36 | { |
| 37 | /** Forward declaration */ |
| 38 | template <typename T> |
| 39 | class ArgumentPack; |
| 40 | |
| 41 | /** Forward declaration */ |
| 42 | class ClTemplateReshape; |
| 43 | |
| 44 | class ClComponentReshape final : public IGpuKernelComponent |
| 45 | { |
| 46 | public: |
| 47 | public: |
| 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 Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 76 | ClComponentReshape(ComponentId id, const Properties &properties, const ArgumentPack<ITensorInfo> &tensors); |
Ramy Elgammal | f800adf | 2022-12-14 15:39:29 +0000 | [diff] [blame] | 77 | |
| 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 Bayir | 0ee13af | 2024-02-07 15:34:45 +0000 | [diff] [blame^] | 88 | /** Get writer for the component */ |
| 89 | const IGpuCkwComponentDriver *ckw_component_driver() const override; |
Ramy Elgammal | f800adf | 2022-12-14 15:39:29 +0000 | [diff] [blame] | 90 | /** Get component type */ |
| 91 | GpuComponentType type() const override |
| 92 | { |
| 93 | return GpuComponentType::Complex; |
| 94 | } |
| 95 | |
| 96 | private: |
Ramy Elgammal | f800adf | 2022-12-14 15:39:29 +0000 | [diff] [blame] | 97 | }; |
| 98 | } // namespace dynamic_fusion |
| 99 | } // namespace experimental |
| 100 | } // namespace arm_compute |
| 101 | |
Gunes Bayir | 0ee13af | 2024-02-07 15:34:45 +0000 | [diff] [blame^] | 102 | #endif // ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_CL_CLCOMPONENTRESHAPE_H |