ONE - On-device Neural Engine
Loading...
Searching...
No Matches
TestDataAddBase.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 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_ADD_KERNEL_BASE_H
18#define ONERT_MICRO_TEST_MODELS_ADD_KERNEL_BASE_H
19
20#include "test_models/TestDataBase.h"
21
22namespace onert_micro
23{
24namespace test_model
25{
26
27template <typename T> class TestDataAddBase : public TestDataBase<T>
28{
29public:
30 explicit TestDataAddBase(bool)
31 {
32 // Do nothing
33 }
34
35 TestDataAddBase() = delete;
36
37 const unsigned char *get_model_ptr() override final { return _test_add_kernel_model_circle; }
38
39 const std::vector<T> &get_input_data_by_index(int i) override final
40 {
41 switch (i)
42 {
43 case 0:
44 return _input1_data;
45 case 1:
46 return _input2_data;
47 default:
48 assert(false && "Wrong input index");
49 }
50 }
51
52 const std::vector<T> &get_output_data_by_index(int i) override final
53 {
54 assert(i == 0);
56 }
57
58protected:
59 std::vector<T> _input1_data;
60 std::vector<T> _input2_data;
61 std::vector<T> _reference_output_data;
62 const unsigned char *_test_add_kernel_model_circle;
63};
64
65} // namespace test_model
66} // namespace onert_micro
67
68#endif // ONERT_MICRO_TEST_MODELS_ADD_KERNEL_BASE_H
const unsigned char * get_model_ptr() override final
const std::vector< T > & get_output_data_by_index(int i) override final
const std::vector< T > & get_input_data_by_index(int i) override final
const unsigned char * _test_add_kernel_model_circle