Elffuss BraidHub

kikocis/kleidiai public

main · 1.3 KiBRawPermalink
1//
2// SPDX-FileCopyrightText: Copyright 2025-2026 Arm Limited and/or its affiliates <open-source-office@arm.com>
3//
4// SPDX-License-Identifier: Apache-2.0
5//
6
7#pragma once
8
9#include <cstddef>
10
11#include "test/common/buffer.hpp"
12#include "test/common/data_type.hpp"
13#include "test/common/span.hpp"
14
15namespace kai::test {
16
17/// Performs binary elementwise operator.
18///
19/// @param[in] lhs_height The height of the LHS data.
20/// @param[in] lhs_width The width of the LHS data.
21/// @param[in] lhs_data The LHS data buffer.
22/// @param[in] rhs_height The height of the RHS data.
23/// @param[in] rhs_width The width of the RHS data.
24/// @param[in] rhs_data The RHS data buffer.
25///
26/// @return The result data.
27using BinaryElementwiseFn = Buffer (*)(
28 size_t lhs_height, size_t lhs_width, Span<const std::byte> lhs_data, size_t rhs_height, size_t rhs_width,
29 Span<const std::byte> rhs_data);
30
31/// Creates an add operator for the specified data type.
32///
33/// @param[in] dtype The data type.
34///
35/// @return The function pointer.
36[[nodiscard]] BinaryElementwiseFn make_add_2d(DataType dtype);
37
38/// Creates a multiply operator for the specified data type.
39///
40/// @param[in] dtype The data type.
41///
42/// @return The function pointer.
43[[nodiscard]] BinaryElementwiseFn make_multiply_2d(DataType dtype);
44
45} // namespace kai::test