STT-tensorflow/tensorflow/lite/experimental/acceleration/compatibility/database.fbs
A. Unique TensorFlower 019cd527de Export GPU allowlist database and flatbuffer java library BUILD targets.
PiperOrigin-RevId: 326493266
Change-Id: Ib87006ee2ee3e3723f422ef7bf20a382a4de34ef
2020-08-13 12:04:23 -07:00

59 lines
2.0 KiB
Plaintext

// Copyright 2020 The TensorFlow Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace tflite.acceleration;
enum Comparison : byte {
EQUAL = 0,
MINIMUM = 1,
}
// Mapping from available device features to compatibility decisions. Basic usage is to:
// 1) Map easily available device data (like Android version,
// Manufacturer, Device) to things like SoC vendor, SoC model.
// 2) Map complete device data to delegate-specific features and support status
// 3) Map delegate-specific features to delegate configuration.
//
// The structure describes a decision tree, with multiple matching branches.
// The branches are applied depth-first.
table DeviceDatabase {
root:[DeviceDecisionTreeNode];
}
table DeviceDecisionTreeNode {
// The variables are strings, as we have multiple clients that want to
// introduce their own fields. Known variables are listed in variables.h.
variable:string (shared);
comparison:Comparison;
items:[DeviceDecisionTreeEdge];
}
table DeviceDecisionTreeEdge {
// Under which variable value does this item match.
value:string (key, shared);
// Which child branches should also be consulted and used to override this
// node.
children:[DeviceDecisionTreeNode];
// What information can be derived about this device.
derived_properties:[DerivedProperty];
}
// Derived variable value to combine with detected variables.
table DerivedProperty {
variable:string (shared);
value:string (shared);
}
root_type DeviceDatabase;