Imported Upstream version 1.12.0
[platform/core/ml/nnfw.git] / runtime / contrib / TFLiteSharp / TFLiteNative / include / tflite_nativewrapper.h
1 /*
2  * Copyright (c) 2018 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 _TFLITE_NATIVEWRAPPER_H_
18 #define _TFLITE_NATIVEWRAPPER_H_
19
20 #include "tensorflow/lite/kernels/register.h"
21 #include "tensorflow/lite/model.h"
22 #include "tensorflow/lite/string_util.h"
23 #include "tensorflow/lite/tools/mutable_op_resolver.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /*__cplusplus*/
28
29 typedef enum
30 {
31   /** 32-bit signed integer. */
32   INT32 = 1,
33
34   /** 32-bit single precision floating point. */
35   FLOAT32 = 2,
36
37   /** 8-bit unsigned integer. */
38   UINT8 = 3,
39
40   /** 64-bit signed integer. */
41   INT64 = 4
42 } TFLiteNativeType;
43
44 void tflite_interpreter_setNumThreads(long *interpreterHandle, int numThreads);
45
46 long long tflite_flatbuffermodel_BuildFromFile(char *modelPath);
47
48 long long tflite_builder_interpreterBuilder(long *modelHandle);
49
50 void *tflite_interpreter_run(long *interpreterHandle, void *values, int inputLength, int dataType);
51
52 #ifdef __cplusplus
53 }
54 #endif /*__cplusplus*/
55
56 #endif /*_TFLITE_NATIVEWRAPPER_H_*/