blob: 1333f6c4c4967ba697375c74340f709150ca8763 [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
2 * Copyright (c) 2021 Arm Limited. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef TENSORFLOW_LITE_MICRO_LOCAL_HPP
18#define TENSORFLOW_LITE_MICRO_LOCAL_HPP
19
20/* We include all our TensorFlow Lite Micro headers here */
21
22/**
23 * TensorFlow Lite Micro sources can generate a lot of warnings from the usage
24 * of a single macro (TF_LITE_REMOVE_VIRTUAL_DELETE). Suppress the known ones
25 * here to prevent them from masking warnings that might be generated by our
26 * application sources.
27 */
28#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
29 #pragma clang diagnostic push
30 #pragma clang diagnostic ignored "-Wunused-parameter"
31 #include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
32 #include "tensorflow/lite/micro/micro_interpreter.h"
33 #include "tensorflow/lite/micro/micro_error_reporter.h"
34 #include "tensorflow/lite/micro/all_ops_resolver.h"
35 #pragma clang diagnostic pop
36#elif defined(__GNUC__)
37 #pragma GCC diagnostic push
38 #pragma GCC diagnostic ignored "-Wunused-parameter"
39 #include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
40 #include "tensorflow/lite/micro/micro_interpreter.h"
41 #include "tensorflow/lite/micro/micro_error_reporter.h"
42 #include "tensorflow/lite/micro/all_ops_resolver.h"
43 #pragma GCC diagnostic pop
44#else
45 #include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
46 #include "tensorflow/lite/micro/micro_interpreter.h"
47 #include "tensorflow/lite/micro/micro_error_reporter.h"
48 #include "tensorflow/lite/micro/all_ops_resolver.h"
49#endif
50
51#include "tensorflow/lite/c/common.h"
52#include "tensorflow/lite/micro/kernels/micro_ops.h"
53#include "tensorflow/lite/schema/schema_generated.h"
alexander3c798932021-03-26 21:42:19 +000054
55#if defined (TESTS)
56 #include "tensorflow/lite/micro/test_helpers.h"
57#endif /* defined (TESTS) */
58
59namespace arm {
60namespace app {
61
62 struct QuantParams {
63 float scale = 1.0;
64 int offset = 0;
65 };
66
67 QuantParams GetTensorQuantParams(TfLiteTensor* tensor);
68
69} /* namespace app */
70} /* namespace arm */
71
72/**
73 * @brief Prints the tensor flow version in use to stdout.
74 */
75void PrintTensorFlowVersion();
76
77#endif /* TENSORFLOW_LITE_MICRO_LOCAL_HPP */