diff options
author | Miao Wang | 2017-08-02 22:21:06 -0500 |
---|---|---|
committer | Miao Wang | 2017-08-11 20:35:24 -0500 |
commit | a5a663c6e5b88a6c1789394a2790e91fce1020f7 (patch) | |
tree | bcf60e09e6a7e3a41eb3c50a7ea3965eeb2435d2 /neuralnetworks/1.0/types.hal | |
parent | 7dcc345b6428a33c9d4f954ba98be0fd37d0b5f7 (diff) | |
download | platform-hardware-interfaces-a5a663c6e5b88a6c1789394a2790e91fce1020f7.tar.gz platform-hardware-interfaces-a5a663c6e5b88a6c1789394a2790e91fce1020f7.tar.xz platform-hardware-interfaces-a5a663c6e5b88a6c1789394a2790e91fce1020f7.zip |
Remove the data type from the OperationType enum.
- Now the driver needs to report a list of tuple
{OperationType, OperandType} for capabilities.
- Any time Operation information is passed across HIDL,
it should be passed as the tuple {OperationType, OperandType}
Bug: 63905942
Test: mm
Change-Id: I909b5acf4936f65c242ee0925d3a1ac665f46131
Diffstat (limited to 'neuralnetworks/1.0/types.hal')
-rw-r--r-- | neuralnetworks/1.0/types.hal | 81 |
1 files changed, 44 insertions, 37 deletions
diff --git a/neuralnetworks/1.0/types.hal b/neuralnetworks/1.0/types.hal index ccc17f14..0adebb85 100644 --- a/neuralnetworks/1.0/types.hal +++ b/neuralnetworks/1.0/types.hal | |||
@@ -32,7 +32,7 @@ enum OperandType : uint32_t { | |||
32 | UINT32 = 7, | 32 | UINT32 = 7, |
33 | TENSOR_FLOAT16 = 8, | 33 | TENSOR_FLOAT16 = 8, |
34 | TENSOR_FLOAT32 = 9, | 34 | TENSOR_FLOAT32 = 9, |
35 | TENSOR_SYMMETRICAL_QUANT8 = 10, | 35 | TENSOR_QUANT8_ASYMM = 10, |
36 | }; | 36 | }; |
37 | 37 | ||
38 | // The type of operations. Unlike the operation types found in | 38 | // The type of operations. Unlike the operation types found in |
@@ -41,39 +41,39 @@ enum OperandType : uint32_t { | |||
41 | // TODO: Currently they are the same. Add a conversion when finalizing the model. | 41 | // TODO: Currently they are the same. Add a conversion when finalizing the model. |
42 | // When modifying, be sure to update HAL_NUM_OPERATION_TYPES in HalIntefaces.h. | 42 | // When modifying, be sure to update HAL_NUM_OPERATION_TYPES in HalIntefaces.h. |
43 | enum OperationType : uint32_t { | 43 | enum OperationType : uint32_t { |
44 | AVERAGE_POOL_FLOAT32 = 0, | 44 | AVERAGE_POOL = 0, |
45 | CONCATENATION_FLOAT32 = 1, | 45 | CONCATENATION = 1, |
46 | CONV_FLOAT32 = 2, | 46 | CONV = 2, |
47 | DEPTHWISE_CONV_FLOAT32 = 3, | 47 | DEPTHWISE_CONV = 3, |
48 | MAX_POOL_FLOAT32 = 4, | 48 | MAX_POOL = 4, |
49 | L2_POOL_FLOAT32 = 5, | 49 | L2_POOL = 5, |
50 | DEPTH_TO_SPACE_FLOAT32 = 6, | 50 | DEPTH_TO_SPACE = 6, |
51 | SPACE_TO_DEPTH_FLOAT32 = 7, | 51 | SPACE_TO_DEPTH = 7, |
52 | LOCAL_RESPONSE_NORMALIZATION_FLOAT32 = 8, | 52 | LOCAL_RESPONSE_NORMALIZATION = 8, |
53 | SOFTMAX_FLOAT32 = 9, | 53 | SOFTMAX = 9, |
54 | RESHAPE_FLOAT32 = 10, | 54 | RESHAPE = 10, |
55 | SPLIT_FLOAT32 = 11, | 55 | SPLIT = 11, |
56 | FAKE_QUANT_FLOAT32 = 12, | 56 | FAKE_QUANT = 12, |
57 | ADD_FLOAT32 = 13, | 57 | ADD = 13, |
58 | FULLY_CONNECTED_FLOAT32 = 14, | 58 | FULLY_CONNECTED = 14, |
59 | CAST_FLOAT32 = 15, | 59 | CAST = 15, |
60 | MUL_FLOAT32 = 16, | 60 | MUL = 16, |
61 | L2_NORMALIZATION_FLOAT32 = 17, | 61 | L2_NORMALIZATION = 17, |
62 | LOGISTIC_FLOAT32 = 18, | 62 | LOGISTIC = 18, |
63 | RELU_FLOAT32 = 19, | 63 | RELU = 19, |
64 | RELU6_FLOAT32 = 20, | 64 | RELU6 = 20, |
65 | RELU1_FLOAT32 = 21, | 65 | RELU1 = 21, |
66 | TANH_FLOAT32 = 22, | 66 | TANH = 22, |
67 | DEQUANTIZE_FLOAT32 = 23, | 67 | DEQUANTIZE = 23, |
68 | FLOOR_FLOAT32 = 24, | 68 | FLOOR = 24, |
69 | GATHER_FLOAT32 = 25, | 69 | GATHER = 25, |
70 | RESIZE_BILINEAR_FLOAT32 = 26, | 70 | RESIZE_BILINEAR = 26, |
71 | LSH_PROJECTION_FLOAT32 = 27, | 71 | LSH_PROJECTION = 27, |
72 | LSTM_FLOAT32 = 28, | 72 | LSTM = 28, |
73 | SVDF_FLOAT32 = 29, | 73 | SVDF = 29, |
74 | RNN_FLOAT32 = 30, | 74 | RNN = 30, |
75 | N_GRAM_FLOAT32 = 31, | 75 | N_GRAM = 31, |
76 | LOOKUP_FLOAT32 = 32, | 76 | LOOKUP = 32, |
77 | }; | 77 | }; |
78 | 78 | ||
79 | // Two special values that can be used instead of a regular poolIndex. | 79 | // Two special values that can be used instead of a regular poolIndex. |
@@ -102,9 +102,16 @@ struct PerformanceInfo { | |||
102 | float powerUsage; // in picoJoules | 102 | float powerUsage; // in picoJoules |
103 | }; | 103 | }; |
104 | 104 | ||
105 | struct OperationTuple { | ||
106 | // The type of operation. | ||
107 | OperationType operationType; | ||
108 | // The input data type of operation. | ||
109 | OperandType operandType; | ||
110 | }; | ||
111 | |||
105 | // The capabilities of a driver. | 112 | // The capabilities of a driver. |
106 | struct Capabilities { | 113 | struct Capabilities { |
107 | vec<OperationType> supportedOperationTypes; | 114 | vec<OperationTuple> supportedOperationTuples; |
108 | // TODO Do the same for baseline model IDs | 115 | // TODO Do the same for baseline model IDs |
109 | bool cachesCompilation; | 116 | bool cachesCompilation; |
110 | // TODO revisit the data types and scales. | 117 | // TODO revisit the data types and scales. |
@@ -142,8 +149,8 @@ struct Operand { | |||
142 | 149 | ||
143 | // Describes one operation of the graph. | 150 | // Describes one operation of the graph. |
144 | struct Operation { | 151 | struct Operation { |
145 | // The type of operation. | 152 | // The tuple describing the operation type and input type. |
146 | OperationType type; | 153 | OperationTuple opTuple; |
147 | // Describes the table that contains the indexes of the inputs of the | 154 | // Describes the table that contains the indexes of the inputs of the |
148 | // operation. The offset is the index in the operandIndexes table. | 155 | // operation. The offset is the index in the operandIndexes table. |
149 | vec<uint32_t> inputs; | 156 | vec<uint32_t> inputs; |