1/*
2 * Copyright (C) 2021 The Android Open Source Project
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
17syntax = "proto2";
18
19package android.neuralnetworks;
20
21enum DataClass {
22    DATA_CLASS_UNKNOWN = 0;
23    DATA_CLASS_OTHER = 1;
24    DATA_CLASS_FLOAT32 = 2;
25    DATA_CLASS_FLOAT16 = 3;
26    DATA_CLASS_QUANT = 4;
27    DATA_CLASS_MIXED = 5;
28}
29
30enum Mode {
31    MODE_UNKNOWN = 0;
32
33    // Async execution.
34    MODE_ASYNC = 1;
35
36    // Sync execution.
37    MODE_SYNC = 2;
38
39    // Burst execution.
40    MODE_BURST = 3;
41
42    // Async with dependencies.
43    MODE_ASYNC_WITH_DEPS = 4;
44}
45
46// Mirrors the types in packages/modules/NeuralNetworks/runtime/include/NeuralNetworksTypes.h.
47enum ResultCode {
48    RESULT_CODE_NO_ERROR = 0;
49    RESULT_CODE_OUT_OF_MEMORY = 1;
50    RESULT_CODE_INCOMPLETE = 2;
51    RESULT_CODE_UNEXPECTED_NULL = 3;
52    RESULT_CODE_BAD_DATA = 4;
53    RESULT_CODE_OP_FAILED = 5;
54    RESULT_CODE_BAD_STATE = 6;
55    RESULT_CODE_UNMAPPABLE = 7;
56    RESULT_CODE_OUTPUT_INSUFFICIENT_SIZE = 8;
57    RESULT_CODE_UNAVAILABLE_DEVICE = 9;
58    RESULT_CODE_MISSED_DEADLINE_TRANSIENT = 10;
59    RESULT_CODE_MISSED_DEADLINE_PERSISTENT = 11;
60    RESULT_CODE_RESOURCE_EXHAUSTED_TRANSIENT = 12;
61    RESULT_CODE_RESOURCE_EXHAUSTED_PERSISTENT = 13;
62    RESULT_CODE_DEAD_OBJECT = 14;
63  }
64