b099ba9ba1fbaddbc33e28f29ba33cf37d9a557e
[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   /** 32-bit signed integer. */
31   INT32 = 1,
32
33   /** 32-bit single precision floating point. */
34   FLOAT32 = 2,
35
36   /** 8-bit unsigned integer. */
37   UINT8 = 3,
38
39   /** 64-bit signed integer. */
40   INT64 = 4
41 } TFLiteNativeType;
42
43 void tflite_interpreter_setNumThreads(long *interpreterHandle, int numThreads);
44
45 long long tflite_flatbuffermodel_BuildFromFile(char *modelPath);
46
47 long long tflite_builder_interpreterBuilder(long *modelHandle);
48
49 void *tflite_interpreter_run(long *interpreterHandle, void *values, int inputLength, int dataType);
50
51 #ifdef __cplusplus
52 }
53 #endif /*__cplusplus*/
54
55 #endif /*_TFLITE_NATIVEWRAPPER_H_*/