• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 #ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_DATA_TYPE_H_
17 #define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_DATA_TYPE_H_
18 
19 #include <stddef.h>
20 #include <string>
21 
22 namespace tflite {
23 namespace gpu {
24 
25 enum class DataType {
26   UNKNOWN = 0,
27   FLOAT16 = 1,
28   FLOAT32 = 2,
29   FLOAT64 = 3,
30   UINT8 = 4,
31   INT8 = 5,
32   UINT16 = 6,
33   INT16 = 7,
34   UINT32 = 8,
35   INT32 = 9,
36   UINT64 = 10,
37   INT64 = 11,
38 };
39 
40 size_t SizeOf(DataType type);
41 
42 std::string ToString(DataType t);
43 
44 std::string ToCLDataType(DataType data_type, int vec_size = 1);
45 
46 std::string ToMetalDataType(DataType data_type, int vec_size = 1);
47 
48 }  // namespace gpu
49 }  // namespace tflite
50 
51 #endif  // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_DATA_TYPE_H_
52