blob: 26883d7fa0f585dbbe2ef2de85b7bd347d67c124 [file] [log] [blame]
Giorgio Arena232c4522022-03-03 10:09:01 +00001/*
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 Lib63b1192022-01-28 18:24:39 +000024#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 Arena232c4522022-03-03 10:09:01 +000027
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
33namespace arm_compute
34{
35namespace experimental
36{
37namespace dynamic_fusion
38{
39class ClStoreBlockBoundaryAwareKernelComponent : public IClKernelComponent
40{
41public:
SiCong Lib63b1192022-01-28 18:24:39 +000042 ClStoreBlockBoundaryAwareKernelComponent(ClKernelBlueprint *blueprint, const Link &src, const Link &dst)
Gunes Bayir8a879832022-03-10 21:21:01 +000043 : IClKernelComponent(blueprint), _src{ src }, _dst{ dst }
Giorgio Arena232c4522022-03-03 10:09:01 +000044 {
45 }
Giorgio Arenabd44caa2022-03-15 13:45:15 +000046 ComponentType get_component_type() const override;
47 std::string get_component_code() const override;
48 CLBuildOptions generate_build_options() const override;
SiCong Lib63b1192022-01-28 18:24:39 +000049 TagLUT get_tag_lut(const SharedVarTable &vtable) const override;
50 void allocate_shared_vars(SharedVarTable &vtable) const override;
Giorgio Arena232c4522022-03-03 10:09:01 +000051
52 virtual std::vector<Link> get_links() const override
53 {
54 return { _src, _dst };
55 }
56
Giorgio Arena232c4522022-03-03 10:09:01 +000057 virtual std::string name() const override
58 {
59 return "";
60 }
61
62private:
63 Link _src{};
64 Link _dst{};
65};
66
Gunes Bayir16c56972022-03-28 21:32:33 +010067class ClStoreIndirectWidthSelectKernelComponent : public IClKernelComponent
68{
69public:
SiCong Lib63b1192022-01-28 18:24:39 +000070 ClStoreIndirectWidthSelectKernelComponent(ClKernelBlueprint *blueprint, const Link &src, const Link &dst)
Gunes Bayir16c56972022-03-28 21:32:33 +010071 : 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 Lib63b1192022-01-28 18:24:39 +000077 virtual TagLUT get_tag_lut(const SharedVarTable &vtable) const override;
78 void allocate_shared_vars(SharedVarTable &vtable) const override;
Gunes Bayir16c56972022-03-28 21:32:33 +010079
80 virtual std::vector<Link> get_links() const override
81 {
82 return { _src, _dst };
83 }
84
Gunes Bayir16c56972022-03-28 21:32:33 +010085 virtual std::string name() const override
86 {
87 return "";
88 }
89
90private:
91 Link _src{};
92 Link _dst{};
93};
94
Giorgio Arena232c4522022-03-03 10:09:01 +000095} // namespace dynamic_fusion
96} // namespace experimental
97} // namespace arm_compute
SiCong Lib63b1192022-01-28 18:24:39 +000098#endif // ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLSTOREKERNELCOMPONENTS_H