Skip to content

Commit 27feb75

Browse files
committed
[onert-micro/onert-micro] Add kernels for logical operations (And/Or/Not)
This will add kernels for logical operations with corresponding tests. ONE-DCO-1.0-Signed-off-by: Denis Tarasenko [email protected]
1 parent 4550db4 commit 27feb75

21 files changed

+1417
-3
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ONERT_MICRO_EXECUTE_PAL_LOGICAL_COMMON_H
18+
#define ONERT_MICRO_EXECUTE_PAL_LOGICAL_COMMON_H
19+
20+
#include "OMStatus.h"
21+
22+
namespace onert_micro::execute::pal
23+
{
24+
25+
struct LogicalAndFn
26+
{
27+
bool operator()(bool lhs, bool rhs) { return lhs && rhs; }
28+
};
29+
30+
struct LogicalOrFn
31+
{
32+
bool operator()(bool lhs, bool rhs) { return lhs || rhs; }
33+
};
34+
35+
// ------------------------------------------------------------------------------------------------
36+
37+
template <class Fn>
38+
OMStatus LogicalCommon(const int flat_size, const bool *input1_data, const bool *input2_data,
39+
bool *output_data)
40+
{
41+
Fn func;
42+
43+
for (int i = 0; i < flat_size; ++i)
44+
{
45+
output_data[i] = func(input1_data[i], input2_data[i]);
46+
}
47+
48+
return Ok;
49+
}
50+
51+
} // namespace onert_micro::execute::pal
52+
53+
#endif // ONERT_MICRO_EXECUTE_PAL_LOGICAL_COMMON_H
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ONERT_MICRO_EXECUTE_PAL_LOGICAL_NOT_COMMON_H
18+
#define ONERT_MICRO_EXECUTE_PAL_LOGICAL_NOT_COMMON_H
19+
20+
#include "OMStatus.h"
21+
22+
namespace onert_micro::execute::pal
23+
{
24+
25+
OMStatus LogicalNot(const int flat_size, const bool *input_data, bool *output_data)
26+
{
27+
for (int i = 0; i < flat_size; ++i)
28+
{
29+
output_data[i] = !(input_data[i]);
30+
}
31+
32+
return Ok;
33+
}
34+
35+
} // namespace onert_micro::execute::pal
36+
37+
#endif // ONERT_MICRO_EXECUTE_PAL_LOGICAL_NOT_COMMON_H

onert-micro/onert-micro/include/pal/mcu/KernelsToBuild.lst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ REGISTER_KERNEL(LESS, Less)
4545
REGISTER_KERNEL(L2_NORMALIZATION, L2Normalize)
4646
REGISTER_KERNEL(L2_POOL_2D, L2Pool2D)
4747
REGISTER_KERNEL(LESS_EQUAL, LessEqual)
48-
#/*REGISTER_KERNEL(LOGICAL_AND, LogicalAnd)*/
49-
#/*REGISTER_KERNEL(LOGICAL_NOT, LogicalNot)*/
50-
#/*REGISTER_KERNEL(LOGICAL_OR, LogicalOr)*/
48+
REGISTER_KERNEL(LOGICAL_AND, LogicalAnd)
49+
REGISTER_KERNEL(LOGICAL_NOT, LogicalNot)
50+
REGISTER_KERNEL(LOGICAL_OR, LogicalOr)
5151
REGISTER_KERNEL(LEAKY_RELU, LeakyRelu)
5252
REGISTER_KERNEL(LOG_SOFTMAX, LogSoftmax)
5353
REGISTER_KERNEL(MUL, Mul)
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*
2+
* Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ONERT_MICRO_TEST_MODELS_BOOL_LOGICAL_AND_KERNEL_H
18+
#define ONERT_MICRO_TEST_MODELS_BOOL_LOGICAL_AND_KERNEL_H
19+
20+
#include "TestDataLogicalAndBase.h"
21+
22+
// clang-format off
23+
24+
namespace onert_micro::test_model
25+
{
26+
namespace logical_and_bool
27+
{
28+
29+
/*
30+
* LogicalAnd Kernel:
31+
*
32+
* Input(1, 4, 4, 3) Input(1, 4, 4, 3)
33+
* | |
34+
* -----LogicalAnd-----
35+
* |
36+
* Output(1, 4, 4, 3)
37+
*/
38+
39+
const unsigned char test_kernel_model_circle[] = {
40+
0x18, 0x00, 0x00, 0x00, 0x43, 0x49, 0x52, 0x30, 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00,
41+
0x0c, 0x00, 0x08, 0x00, 0x10, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
42+
0x30, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
43+
0x1c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
44+
0x88, 0xff, 0xff, 0xff, 0x8c, 0xff, 0xff, 0xff, 0x90, 0xff, 0xff, 0xff, 0x94, 0xff, 0xff, 0xff,
45+
0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x18, 0x00, 0x14, 0x00,
46+
0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
47+
0x1c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
48+
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
49+
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0c, 0x00,
50+
0x07, 0x00, 0x08, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x10, 0x00, 0x00, 0x00,
51+
0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
52+
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
53+
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
54+
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00,
55+
0x38, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x9c, 0xff, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00,
56+
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
57+
0x6f, 0x66, 0x6d, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
58+
0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xcc, 0xff, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00,
59+
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
60+
0x69, 0x66, 0x6d, 0x32, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
61+
0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x14, 0x00,
62+
0x10, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
63+
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
64+
0x69, 0x66, 0x6d, 0x31, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
65+
0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
66+
0x10, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
67+
0x0c, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x11, 0x00, 0x00, 0x00,
68+
0x4f, 0x4e, 0x45, 0x2d, 0x74, 0x66, 0x6c, 0x69, 0x74, 0x65, 0x32, 0x63, 0x69, 0x72, 0x63, 0x6c,
69+
0x65, 0x00, 0x00, 0x00
70+
};
71+
72+
const std::vector<bool> input1_data = {
73+
true, false, true, true, true, false, true, true, true, true, true, true, true, true, true, true,
74+
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
75+
true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false
76+
};
77+
78+
const std::vector<bool> input2_data = {
79+
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
80+
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
81+
true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, false
82+
};
83+
84+
const std::vector<bool> reference_output_data = {
85+
true, false, true, true, true, false, true, true, true, true, true, true, true, true, true, true,
86+
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
87+
true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false
88+
};
89+
90+
} // namespace logical_and_bool
91+
92+
// ------------------------------------------------------------------------------------------------
93+
94+
class TestDataBoolLogicalAnd : public TestDataLogicalAndBase<bool>
95+
{
96+
public:
97+
TestDataBoolLogicalAnd()
98+
{
99+
_input1_data = logical_and_bool::input1_data;
100+
_input2_data = logical_and_bool::input2_data;
101+
_reference_output_data = logical_and_bool::reference_output_data;
102+
_test_kernel_model_circle = logical_and_bool::test_kernel_model_circle;
103+
}
104+
105+
~TestDataBoolLogicalAnd() override = default;
106+
};
107+
108+
} // namespace onert_micro::test_model
109+
110+
#endif // ONERT_MICRO_TEST_MODELS_BOOL_LOGICAL_AND_KERNEL_H
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ONERT_MICRO_TEST_MODELS_NEG_LOGICAL_AND_KERNEL_H
18+
#define ONERT_MICRO_TEST_MODELS_NEG_LOGICAL_AND_KERNEL_H
19+
20+
#include "TestDataLogicalAndBase.h"
21+
22+
// clang-format off
23+
24+
namespace onert_micro::test_model
25+
{
26+
namespace neg_logical_and_inputs_type_mismatch
27+
{
28+
29+
/*
30+
* LogicalAnd Kernel with inputs type mismatch:
31+
*
32+
* Input(1, 4, 4, 3)-Bool Input(1, 4, 4, 3)-Float32
33+
* | |
34+
* -------LogicalAnd--------
35+
* |
36+
* Output(1, 4, 4, 3)
37+
*/
38+
39+
const unsigned char test_kernel_model_circle[] = {
40+
0x18, 0x00, 0x00, 0x00, 0x43, 0x49, 0x52, 0x30, 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00,
41+
0x0c, 0x00, 0x08, 0x00, 0x10, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
42+
0x30, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x9c, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
43+
0x1c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
44+
0x88, 0xff, 0xff, 0xff, 0x8c, 0xff, 0xff, 0xff, 0x90, 0xff, 0xff, 0xff, 0x94, 0xff, 0xff, 0xff,
45+
0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x18, 0x00, 0x14, 0x00,
46+
0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
47+
0x1c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
48+
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
49+
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0c, 0x00,
50+
0x07, 0x00, 0x08, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x10, 0x00, 0x00, 0x00,
51+
0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
52+
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
53+
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
54+
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00,
55+
0x44, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x94, 0xff, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00,
56+
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
57+
0x6f, 0x66, 0x6d, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
58+
0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00,
59+
0x08, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
60+
0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x66, 0x6d, 0x32, 0x00, 0x00, 0x00, 0x00,
61+
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
62+
0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00,
63+
0x0c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
64+
0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x66, 0x6d, 0x31, 0x00, 0x00, 0x00, 0x00,
65+
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
66+
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00,
67+
0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00,
68+
0x00, 0x00, 0x00, 0x56, 0x11, 0x00, 0x00, 0x00, 0x4f, 0x4e, 0x45, 0x2d, 0x74, 0x66, 0x6c, 0x69,
69+
0x74, 0x65, 0x32, 0x63, 0x69, 0x72, 0x63, 0x6c, 0x65, 0x00, 0x00, 0x00
70+
};
71+
72+
} // namespace neg_logical_and_inputs_type_mismatch
73+
74+
// ------------------------------------------------------------------------------------------------
75+
76+
class NegTestDataLogicalAndInputsTypeMismatch : public NegTestDataBase
77+
{
78+
public:
79+
NegTestDataLogicalAndInputsTypeMismatch()
80+
{
81+
_test_kernel_model_circle = neg_logical_and_inputs_type_mismatch::test_kernel_model_circle;
82+
}
83+
84+
~NegTestDataLogicalAndInputsTypeMismatch() override = default;
85+
86+
const unsigned char *get_model_ptr() override final { return _test_kernel_model_circle; }
87+
88+
protected:
89+
const unsigned char *_test_kernel_model_circle;
90+
};
91+
92+
} // namespace onert_micro::test_model
93+
94+
#endif // ONERT_MICRO_TEST_MODELS_NEG_LOGICAL_AND_KERNEL_H
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ONERT_MICRO_TEST_MODELS_LOGICAL_AND_KERNEL_BASE_H
18+
#define ONERT_MICRO_TEST_MODELS_LOGICAL_AND_KERNEL_BASE_H
19+
20+
#include "test_models/TestDataBase.h"
21+
22+
namespace onert_micro::test_model
23+
{
24+
25+
template <typename T> class TestDataLogicalAndBase : public TestDataBase<T>
26+
{
27+
public:
28+
TestDataLogicalAndBase() = default;
29+
~TestDataLogicalAndBase() override = default;
30+
31+
// clang-format off
32+
33+
const unsigned char *get_model_ptr() override final
34+
{
35+
return _test_kernel_model_circle;
36+
}
37+
38+
// clang-format on
39+
40+
const std::vector<T> &get_input_data_by_index(int i) override final
41+
{
42+
switch (i)
43+
{
44+
case 0:
45+
return _input1_data;
46+
case 1:
47+
return _input2_data;
48+
default:
49+
assert(false && "Wrong input index");
50+
}
51+
}
52+
53+
const std::vector<T> &get_output_data_by_index(int i) override final
54+
{
55+
assert(i == 0);
56+
return _reference_output_data;
57+
}
58+
59+
protected:
60+
std::vector<T> _input1_data;
61+
std::vector<T> _input2_data;
62+
std::vector<T> _reference_output_data;
63+
const unsigned char *_test_kernel_model_circle;
64+
};
65+
66+
} // namespace onert_micro::test_model
67+
68+
#endif // ONERT_MICRO_TEST_MODELS_LOGICAL_AND_KERNEL_BASE_H

0 commit comments

Comments
 (0)