ONE - On-device Neural Engine
Loading...
Searching...
No Matches
TestDataSinBase.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_SIN_KERNEL_BASE_H
18#define ONERT_MICRO_TEST_MODELS_SIN_KERNEL_BASE_H
19
20#include "test_models/TestDataBase.h"
21#include <cassert>
22
23namespace onert_micro
24{
25namespace test_model
26{
27
28template <typename T> class TestDataSinBase : public TestDataBase<T>
29{
30public:
31 TestDataSinBase() = default;
32
33 const unsigned char *get_model_ptr() override final { return _test_kernel_model_circle; }
34
35 const std::vector<T> &get_input_data_by_index(int i) override final
36 {
37 switch (i)
38 {
39 case 0:
40 return _input_data;
41 default:
42 assert(false && "Wrong input index");
43 }
44 }
45
46 const std::vector<T> &get_output_data_by_index(int i) override final
47 {
48 assert(i == 0);
50 }
51
52protected:
53 std::vector<T> _input_data;
54 std::vector<T> _reference_output_data;
55 const unsigned char *_test_kernel_model_circle;
56};
57
58} // namespace test_model
59} // namespace onert_micro
60
61#endif // ONERT_MICRO_TEST_MODELS_SIN_KERNEL_BASE_H
const unsigned char * _test_kernel_model_circle
const unsigned char * get_model_ptr() override final
const std::vector< T > & get_input_data_by_index(int i) override final
const std::vector< T > & get_output_data_by_index(int i) override final