blob: 600c7f1c05a4b2c6799a956a7c7929a8bccb634b [file] [log] [blame]
Dana Zlotnikd5c496d2021-11-28 14:46:12 +02001/*
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 */
alerah014cbcb842022-02-28 06:38:08 +020024
25#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS)
26
Dana Zlotnikd5c496d2021-11-28 14:46:12 +020027#include "arm_compute/core/Helpers.h"
Felix Thomasmathibalanafd38f02023-09-27 17:46:17 +010028
Dana Zlotnikd5c496d2021-11-28 14:46:12 +020029#include "src/cpu/kernels/elementwise_binary/generic/sve/impl.h"
30namespace arm_compute
31{
32namespace cpu
33{
34template <ArithmeticOperation op>
35void sve_fp16_elementwise_binary(const ITensor *in1, const ITensor *in2, ITensor *out, const Window &window)
36{
Michalis Spyroue417ff12022-06-28 19:46:42 +010037 return elementwise_arithmetic_op<float16_t>(in1, in2, out, op, window);
Dana Zlotnikd5c496d2021-11-28 14:46:12 +020038}
39
Felix Thomasmathibalanafd38f02023-09-27 17:46:17 +010040template void sve_fp16_elementwise_binary<ArithmeticOperation::ADD>(const ITensor *in1,
41 const ITensor *in2,
42 ITensor *out,
43 const Window &window);
44template void sve_fp16_elementwise_binary<ArithmeticOperation::SUB>(const ITensor *in1,
45 const ITensor *in2,
46 ITensor *out,
47 const Window &window);
48template void sve_fp16_elementwise_binary<ArithmeticOperation::DIV>(const ITensor *in1,
49 const ITensor *in2,
50 ITensor *out,
51 const Window &window);
52template void sve_fp16_elementwise_binary<ArithmeticOperation::MIN>(const ITensor *in1,
53 const ITensor *in2,
54 ITensor *out,
55 const Window &window);
56template void sve_fp16_elementwise_binary<ArithmeticOperation::MAX>(const ITensor *in1,
57 const ITensor *in2,
58 ITensor *out,
59 const Window &window);
60template void sve_fp16_elementwise_binary<ArithmeticOperation::SQUARED_DIFF>(const ITensor *in1,
61 const ITensor *in2,
62 ITensor *out,
63 const Window &window);
64template void sve_fp16_elementwise_binary<ArithmeticOperation::POWER>(const ITensor *in1,
65 const ITensor *in2,
66 ITensor *out,
67 const Window &window);
68template void sve_fp16_elementwise_binary<ArithmeticOperation::PRELU>(const ITensor *in1,
69 const ITensor *in2,
70 ITensor *out,
71 const Window &window);
Dana Zlotnikd5c496d2021-11-28 14:46:12 +020072
73template <ComparisonOperation op>
74void sve_fp16_comparison_elementwise_binary(const ITensor *in1, const ITensor *in2, ITensor *out, const Window &window)
75{
Michalis Spyroue417ff12022-06-28 19:46:42 +010076 return elementwise_comparison_op<float16_t>(in1, in2, out, op, window);
Dana Zlotnikd5c496d2021-11-28 14:46:12 +020077}
78
Felix Thomasmathibalanafd38f02023-09-27 17:46:17 +010079template void sve_fp16_comparison_elementwise_binary<ComparisonOperation::Equal>(const ITensor *in1,
80 const ITensor *in2,
81 ITensor *out,
82 const Window &window);
83template void sve_fp16_comparison_elementwise_binary<ComparisonOperation::NotEqual>(const ITensor *in1,
84 const ITensor *in2,
85 ITensor *out,
86 const Window &window);
87template void sve_fp16_comparison_elementwise_binary<ComparisonOperation::Greater>(const ITensor *in1,
88 const ITensor *in2,
89 ITensor *out,
90 const Window &window);
91template void sve_fp16_comparison_elementwise_binary<ComparisonOperation::GreaterEqual>(const ITensor *in1,
92 const ITensor *in2,
93 ITensor *out,
94 const Window &window);
95template void sve_fp16_comparison_elementwise_binary<ComparisonOperation::Less>(const ITensor *in1,
96 const ITensor *in2,
97 ITensor *out,
98 const Window &window);
99template void sve_fp16_comparison_elementwise_binary<ComparisonOperation::LessEqual>(const ITensor *in1,
100 const ITensor *in2,
101 ITensor *out,
102 const Window &window);
Dana Zlotnikd5c496d2021-11-28 14:46:12 +0200103
104} // namespace cpu
105} // namespace arm_compute
alerah014cbcb842022-02-28 06:38:08 +0200106
Felix Thomasmathibalanafd38f02023-09-27 17:46:17 +0100107#endif /* defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS) */