diff options
Diffstat (limited to 'onert-micro/luci-interpreter/include/luci_interpreter/test_models/sub/TestDataSubBase.h')
-rw-r--r-- | onert-micro/luci-interpreter/include/luci_interpreter/test_models/sub/TestDataSubBase.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/onert-micro/luci-interpreter/include/luci_interpreter/test_models/sub/TestDataSubBase.h b/onert-micro/luci-interpreter/include/luci_interpreter/test_models/sub/TestDataSubBase.h new file mode 100644 index 000000000..8c0775e7b --- /dev/null +++ b/onert-micro/luci-interpreter/include/luci_interpreter/test_models/sub/TestDataSubBase.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LUCI_INTERPRETER_TEST_MODELS_SUB_KERNEL_BASE_H +#define LUCI_INTERPRETER_TEST_MODELS_SUB_KERNEL_BASE_H + +#include "luci_interpreter/test_models/TestDataBase.h" + +namespace luci_interpreter +{ +namespace test_kernel +{ + +template <typename T> class TestDataSubBase : public TestDataBase<T> +{ +public: + explicit TestDataSubBase(bool) + { + // Do nothing + } + + TestDataSubBase() = delete; + + const unsigned char *get_model_ptr() override final { return _test_kernel_model_circle; } + + const std::vector<T> &get_input_data_by_index(int i) override final + { + switch (i) + { + case 0: + return _input1_data; + case 1: + return _input2_data; + default: + assert(false && "Wrong input index"); + } + } + + const std::vector<T> &get_output_data_by_index(int i) override final + { + assert(i == 0); + return _reference_output_data; + } + +protected: + std::vector<T> _input1_data; + std::vector<T> _input2_data; + std::vector<T> _reference_output_data; + const unsigned char *_test_kernel_model_circle; +}; + +} // namespace test_kernel +} // namespace luci_interpreter + +#endif // LUCI_INTERPRETER_TEST_MODELS_SUB_KERNEL_BASE_H |