1 /* Copyright 2020 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 #ifndef TENSORFLOW_LITE_EXPERIMENTAL_ACCELERATION_COMPATIBILITY_VARIABLES_H_ 16 #define TENSORFLOW_LITE_EXPERIMENTAL_ACCELERATION_COMPATIBILITY_VARIABLES_H_ 17 18 // This file lists generally useful compatibility properties. 19 // Properties starting with "tflite." are reserved. 20 // Users of the compatibility library can use arbitrary other property names. 21 22 namespace tflite { 23 namespace acceleration { 24 // System properties, not specific to any single delegate. 25 26 // Android properties. 27 // 28 // Android SDK version number. Android system property ro.build.version.sdk. 29 // E.g., "28". 30 constexpr char kAndroidSdkVersion[] = "tflite.android_sdk_version"; 31 // SoC model. Looked up from database or possibly returned from Android system 32 // property ro.board.platform, normalized. E.g., "sdm450". 33 constexpr char kSoCModel[] = "tflite.soc_model"; 34 // SoC vendor. Looked up from database. E.g., "qualcomm". 35 constexpr char kSoCVendor[] = "tflite.soc_vendor"; 36 // Device manufacturer. Android API android.os.Build.MANUFACTURER, normalized. 37 // E.g., "google". 38 constexpr char kManufacturer[] = "tflite.manufacturer"; 39 // Device model. Android API android.os.Build.MODEL, normalized. 40 // E.g., "pixel_2". 41 constexpr char kDeviceModel[] = "tflite.device_model"; 42 // Device name. Android API android.os.Build.DEVICE, normalized. 43 // E.g., "walleye". 44 constexpr char kDeviceName[] = "tflite.device_name"; 45 46 // GPU-related properties. 47 // 48 // OpenGL ES version. E.g., 3.2. 49 constexpr char kOpenGLESVersion[] = "tflite.opengl_es_version"; 50 // GPU model, result of querying GL_RENDERER, normalized. E.g., 51 // "adreno_(tm)_505". 52 constexpr char kGPUModel[] = "tflite.gpu_model"; 53 // GPU vendor, normalized. E.g., "adreno_(tm)_505". 54 constexpr char kGPUVendor[] = "tflite.gpu_vendor"; 55 // OpenGL driver version, result of querying GL_VERSION. E.g., 56 // "opengl_es_3.2_v@328.0_(git@6fb5a5b,_ife855c4895)_(date:08/21/18)" 57 constexpr char kOpenGLDriverVersion[] = "tflite.opengl_driver_version"; 58 59 // NNAPI-related properties. 60 // 61 // NNAPI accelerator name, returned by ANeuralNetworksDevice_getName. E.g., 62 // "qti-dsp". 63 constexpr char kNNAPIAccelerator[] = "tflite.nnapi_accelerator"; 64 // NNAPI accelerator feature level, returned by 65 // ANeuralNetworksDevice_getFeatureLevel. E.g., 29. Actual variables are named 66 // "tflite.nnapi_feature_level.<accelerator name>", e.g., 67 // "tflite.nnapi_feature_level.qti-dsp". 68 constexpr char kNNAPIFeatureLevelPrefix[] = "tflite.nnapi_feature_level"; 69 70 namespace gpu { 71 // GPU-delegate derived properties. 72 73 // Whether the GPU delegate works in general. 74 // Possible values are ("", "SUPPORTED", "UNSUPPORTED"). An empty value for 75 // this field means that the device is unsupported. 76 constexpr char kStatus[] = "tflite.gpu.status"; 77 78 constexpr char kStatusSupported[] = "SUPPORTED"; 79 constexpr char kStatusUnsupported[] = "UNSUPPORTED"; 80 } // namespace gpu 81 82 } // namespace acceleration 83 } // namespace tflite 84 85 #endif // TENSORFLOW_LITE_EXPERIMENTAL_ACCELERATION_COMPATIBILITY_VARIABLES_H_ 86