blob: c0de4ac9b8aaf9df4e43f22f42ac60615cec072c [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 */
24#if defined(ENABLE_EXPERIMENTAL_DYNAMIC_FUSION)
25
26#ifndef ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLELEMENTWISEADDKERNELCOMPONENT_H
27#define ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLELEMENTWISEADDKERNELCOMPONENT_H
28
29#include "src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/Common.h"
30
31namespace arm_compute
32{
33namespace experimental
34{
35namespace dynamic_fusion
36{
37class ClElementwiseAddKernelComponent : public IClKernelComponent
38{
39public:
40 ClElementwiseAddKernelComponent(const Link &lhs, const Link &rhs, const Link &dst)
41 : _lhs{ lhs }, _rhs{ rhs }, _dst{ dst }
42 {
43 }
44 ComponentType get_component_type() const override;
45 std::set<std::string> get_headers_list() const override;
46 std::string get_component_code() const override;
47
48 virtual std::vector<Link> get_links() const override
49 {
50 return { _lhs, _rhs, _dst };
51 }
52
53 virtual TagLUT allocate_vars(SharedVarTable &vtable) const override;
54
55 virtual std::string name() const override
56 {
57 return "eltwise_add_" + std::to_string(id());
58 }
59
60private:
61 Link _lhs{};
62 Link _rhs{};
63 Link _dst{};
64};
65
66} // namespace dynamic_fusion
67} // namespace experimental
68} // namespace arm_compute
69#endif // ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_COMPONENTS_CLELEMENTWISEADDKERNELCOMPONENT_H
70
71#endif // defined(ENABLE_EXPERIMENTAL_DYNAMIC_FUSION)