Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2022 Arm Limited. |
| 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 | */ |
SiCong Li | b63b119 | 2022-01-28 18:24:39 +0000 | [diff] [blame^] | 24 | #ifndef ENABLE_EXPERIMENTAL_DYNAMIC_FUSION |
| 25 | #error "This experimental feature must be enabled with -DENABLE_EXPERIMENTAL_DYNAMIC_FUSION" |
| 26 | #endif /* ENABLE_EXPERIMENTAL_DYNAMIC_FUSION */ |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 27 | |
| 28 | #ifndef ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLSTOREKERNELCOMPONENTS_H |
| 29 | #define ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLSTOREKERNELCOMPONENTS_H |
| 30 | |
| 31 | #include "src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/Common.h" |
| 32 | |
| 33 | namespace arm_compute |
| 34 | { |
| 35 | namespace experimental |
| 36 | { |
| 37 | namespace dynamic_fusion |
| 38 | { |
| 39 | class ClStoreBlockBoundaryAwareKernelComponent : public IClKernelComponent |
| 40 | { |
| 41 | public: |
SiCong Li | b63b119 | 2022-01-28 18:24:39 +0000 | [diff] [blame^] | 42 | ClStoreBlockBoundaryAwareKernelComponent(ClKernelBlueprint *blueprint, const Link &src, const Link &dst) |
Gunes Bayir | 8a87983 | 2022-03-10 21:21:01 +0000 | [diff] [blame] | 43 | : IClKernelComponent(blueprint), _src{ src }, _dst{ dst } |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 44 | { |
| 45 | } |
Giorgio Arena | bd44caa | 2022-03-15 13:45:15 +0000 | [diff] [blame] | 46 | ComponentType get_component_type() const override; |
| 47 | std::string get_component_code() const override; |
| 48 | CLBuildOptions generate_build_options() const override; |
SiCong Li | b63b119 | 2022-01-28 18:24:39 +0000 | [diff] [blame^] | 49 | TagLUT get_tag_lut(const SharedVarTable &vtable) const override; |
| 50 | void allocate_shared_vars(SharedVarTable &vtable) const override; |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 51 | |
| 52 | virtual std::vector<Link> get_links() const override |
| 53 | { |
| 54 | return { _src, _dst }; |
| 55 | } |
| 56 | |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 57 | virtual std::string name() const override |
| 58 | { |
| 59 | return ""; |
| 60 | } |
| 61 | |
| 62 | private: |
| 63 | Link _src{}; |
| 64 | Link _dst{}; |
| 65 | }; |
| 66 | |
Gunes Bayir | 16c5697 | 2022-03-28 21:32:33 +0100 | [diff] [blame] | 67 | class ClStoreIndirectWidthSelectKernelComponent : public IClKernelComponent |
| 68 | { |
| 69 | public: |
SiCong Li | b63b119 | 2022-01-28 18:24:39 +0000 | [diff] [blame^] | 70 | ClStoreIndirectWidthSelectKernelComponent(ClKernelBlueprint *blueprint, const Link &src, const Link &dst) |
Gunes Bayir | 16c5697 | 2022-03-28 21:32:33 +0100 | [diff] [blame] | 71 | : IClKernelComponent(blueprint), _src{ src }, _dst{ dst } |
| 72 | { |
| 73 | } |
| 74 | ComponentType get_component_type() const override; |
| 75 | std::string get_component_code() const override; |
| 76 | CLBuildOptions generate_build_options() const override; |
SiCong Li | b63b119 | 2022-01-28 18:24:39 +0000 | [diff] [blame^] | 77 | virtual TagLUT get_tag_lut(const SharedVarTable &vtable) const override; |
| 78 | void allocate_shared_vars(SharedVarTable &vtable) const override; |
Gunes Bayir | 16c5697 | 2022-03-28 21:32:33 +0100 | [diff] [blame] | 79 | |
| 80 | virtual std::vector<Link> get_links() const override |
| 81 | { |
| 82 | return { _src, _dst }; |
| 83 | } |
| 84 | |
Gunes Bayir | 16c5697 | 2022-03-28 21:32:33 +0100 | [diff] [blame] | 85 | virtual std::string name() const override |
| 86 | { |
| 87 | return ""; |
| 88 | } |
| 89 | |
| 90 | private: |
| 91 | Link _src{}; |
| 92 | Link _dst{}; |
| 93 | }; |
| 94 | |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 95 | } // namespace dynamic_fusion |
| 96 | } // namespace experimental |
| 97 | } // namespace arm_compute |
SiCong Li | b63b119 | 2022-01-28 18:24:39 +0000 | [diff] [blame^] | 98 | #endif // ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLSTOREKERNELCOMPONENTS_H |