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 | 4e9f568 | 2022-05-10 10:15:59 +0100 | [diff] [blame] | 24 | #ifdef ENABLE_EXPERIMENTAL_DYNAMIC_FUSION |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 25 | |
Michalis Spyrou | b1fcefd | 2022-06-15 19:02:28 +0100 | [diff] [blame] | 26 | #ifndef ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLFLOORKERNELCOMPONENT_H |
| 27 | #define ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLFLOORKERNELCOMPONENT_H |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 28 | |
| 29 | #include "src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/Common.h" |
| 30 | |
| 31 | namespace arm_compute |
| 32 | { |
| 33 | namespace experimental |
| 34 | { |
| 35 | namespace dynamic_fusion |
| 36 | { |
Michalis Spyrou | b1fcefd | 2022-06-15 19:02:28 +0100 | [diff] [blame] | 37 | class ClFloorKernelComponent : public IClKernelComponent |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 38 | { |
| 39 | public: |
Mohammed Suhail Munshi | f67903b | 2022-07-04 13:36:14 +0100 | [diff] [blame] | 40 | /** Construct a new Cl Floor Kernel Component object |
| 41 | * |
| 42 | * @param blueprint Blueprint to which this component is added |
| 43 | * @param src Link to SRC tensor |
| 44 | * @param dst Link to DST tensor |
| 45 | * |
| 46 | * Support Level |
| 47 | * Data Type: F16, F32 |
| 48 | * Tensor Shape: Any shape of arbitrary dimension >= 1 and <= 4 |
| 49 | * Value Range: All |
| 50 | */ |
Michalis Spyrou | b1fcefd | 2022-06-15 19:02:28 +0100 | [diff] [blame] | 51 | ClFloorKernelComponent(ClKernelBlueprint *blueprint, const Link &src, const Link &dst) |
| 52 | : IClKernelComponent(blueprint), _src{ src }, _dst{ dst } |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 53 | { |
| 54 | } |
Gunes Bayir | 8a87983 | 2022-03-10 21:21:01 +0000 | [diff] [blame] | 55 | |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 56 | ComponentType get_component_type() const override; |
| 57 | std::set<std::string> get_headers_list() const override; |
| 58 | std::string get_component_code() const override; |
Gunes Bayir | 8a87983 | 2022-03-10 21:21:01 +0000 | [diff] [blame] | 59 | Window get_window() const override; |
Giorgio Arena | bd44caa | 2022-03-15 13:45:15 +0000 | [diff] [blame] | 60 | CLBuildOptions generate_build_options() const override; |
SiCong Li | 0a486cf | 2022-04-07 17:41:51 +0100 | [diff] [blame] | 61 | std::string generate_config_id() const override; |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 62 | |
| 63 | virtual std::vector<Link> get_links() const override |
| 64 | { |
Michalis Spyrou | b1fcefd | 2022-06-15 19:02:28 +0100 | [diff] [blame] | 65 | return { _src, _dst }; |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 66 | } |
| 67 | |
SiCong Li | b63b119 | 2022-01-28 18:24:39 +0000 | [diff] [blame] | 68 | virtual TagLUT get_tag_lut(const SharedVarTable &vtable) const override; |
| 69 | virtual void allocate_shared_vars(SharedVarTable &vtable) const override; |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 70 | |
| 71 | virtual std::string name() const override |
| 72 | { |
Michalis Spyrou | b1fcefd | 2022-06-15 19:02:28 +0100 | [diff] [blame] | 73 | return "floor_" + std::to_string(id()); |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | private: |
Michalis Spyrou | b1fcefd | 2022-06-15 19:02:28 +0100 | [diff] [blame] | 77 | Link _src{}; |
Giorgio Arena | 232c452 | 2022-03-03 10:09:01 +0000 | [diff] [blame] | 78 | Link _dst{}; |
| 79 | }; |
| 80 | |
| 81 | } // namespace dynamic_fusion |
| 82 | } // namespace experimental |
| 83 | } // namespace arm_compute |
Michalis Spyrou | b1fcefd | 2022-06-15 19:02:28 +0100 | [diff] [blame] | 84 | #endif // ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLFLOORKERNELCOMPONENT_H |
Mohammed Suhail Munshi | f67903b | 2022-07-04 13:36:14 +0100 | [diff] [blame] | 85 | #endif /* ENABLE_EXPERIMENTAL_DYNAMIC_FUSION */ |