mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
AIDL interface changes for NNAPI feature level 6.
- Add BATCH_MATMUL operation
- Support TENSOR_INT32 for RESHAPE operation.
Also update "current" version snapshot and use
android.hardware.neuralnetworks-V2-ndk since AIDL v1 has been frozen.
Cherrypicked from Iabe45c57e2306d61055f711eda03b80b9cbe906d
Bug: 206089870
Test: mm
Change-Id: Iabe45c57e2306d61055f711eda03b80b9cbe906d
Merged-In: Iabe45c57e2306d61055f711eda03b80b9cbe906d
(cherry picked from commit aaeda0e84f)
This commit is contained in:
@@ -396,6 +396,7 @@
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.neuralnetworks</name>
|
||||
<version>1-2</version>
|
||||
<interface>
|
||||
<name>IDevice</name>
|
||||
<regex-instance>.*</regex-instance>
|
||||
|
||||
@@ -66,7 +66,7 @@ cc_test {
|
||||
"VtsHalNeuralNetworksV1_0_utils",
|
||||
"VtsHalNeuralNetworksV1_2_utils",
|
||||
"VtsHalNeuralNetworksV1_3_utils",
|
||||
"android.hardware.neuralnetworks-V1-ndk_platform",
|
||||
"android.hardware.neuralnetworks-V2-ndk_platform",
|
||||
"android.hardware.neuralnetworks@1.0",
|
||||
"android.hardware.neuralnetworks@1.1",
|
||||
"android.hardware.neuralnetworks@1.2",
|
||||
|
||||
@@ -136,4 +136,5 @@ enum OperationType {
|
||||
HARD_SWISH = 99,
|
||||
FILL = 100,
|
||||
RANK = 101,
|
||||
BATCH_MATMUL = 102,
|
||||
}
|
||||
|
||||
@@ -1445,6 +1445,7 @@ enum OperationType {
|
||||
* * {@link OperandType::TENSOR_FLOAT32}
|
||||
* * {@link OperandType::TENSOR_QUANT8_ASYMM}
|
||||
* * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3)
|
||||
* * {@link OperandType::TENSOR_INT32} (since NNAPI feature level 6)
|
||||
*
|
||||
* Supported tensor rank: up to 4.
|
||||
*
|
||||
@@ -5128,4 +5129,40 @@ enum OperationType {
|
||||
* of the input tensor.
|
||||
*/
|
||||
RANK = 101,
|
||||
|
||||
/**
|
||||
* Performs multiplication of two tensors in batches.
|
||||
*
|
||||
* Multiplies all slices of two input tensors and arranges the individual
|
||||
* results in a single output tensor of the same batch size. Each pair of
|
||||
* slices in the same batch have identical {@link OperandType}. Each
|
||||
* slice can optionally be adjointed (transpose and conjugate) before
|
||||
* multiplication.
|
||||
*
|
||||
* The two input tensors and the output tensor must be 2-D or higher and
|
||||
* have the same batch size.
|
||||
*
|
||||
* Supported tensor {@link OperandType}:
|
||||
* * {@link OperandType::TENSOR_FLOAT16}
|
||||
* * {@link OperandType::TENSOR_FLOAT32}
|
||||
* * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}
|
||||
* * {@link OperandType::TENSOR_INT32}
|
||||
*
|
||||
* Supported tensor rank: at least 2 and up to 4
|
||||
*
|
||||
* Inputs:
|
||||
* * 0: A tensor with 2-D or higher shape [..., r_x, c_x].
|
||||
* * 1: A tensor with 2-D or higher shape [..., r_y, c_y]. It has the same
|
||||
* {@link OperandType} and batch size as input0.
|
||||
* * 2: An optional {@link OperandType::BOOL} scalar adj_x, default
|
||||
* to false. Set to true to adjoint the slices of input0.
|
||||
* * 3: An optional {@link OperandType::BOOL} scalar adj_y, default
|
||||
* to false. Set to true to adjoint the slices of input1.
|
||||
*
|
||||
* Outputs:
|
||||
* * 0: A tensor with 2-D or higher shape [..., r_o, c_o], where
|
||||
* r_o = c_x if adj_x else r_x
|
||||
* c_o = r_y if adj_y else c_y
|
||||
*/
|
||||
BATCH_MATMUL = 102,
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ cc_library_static {
|
||||
"neuralnetworks_utils_hal_common",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.neuralnetworks-V1-ndk_platform",
|
||||
"android.hardware.neuralnetworks-V2-ndk_platform",
|
||||
"libbinder_ndk",
|
||||
"libhidlbase",
|
||||
"libnativewindow",
|
||||
@@ -54,7 +54,7 @@ cc_test {
|
||||
static_libs: [
|
||||
"android.hardware.common-V2-ndk_platform",
|
||||
"android.hardware.graphics.common-V2-ndk_platform",
|
||||
"android.hardware.neuralnetworks-V1-ndk_platform",
|
||||
"android.hardware.neuralnetworks-V2-ndk_platform",
|
||||
"libaidlcommonsupport",
|
||||
"libgmock",
|
||||
"libneuralnetworks_common",
|
||||
|
||||
@@ -51,7 +51,7 @@ cc_test {
|
||||
static_libs: [
|
||||
"android.hardware.common-V2-ndk_platform",
|
||||
"android.hardware.graphics.common-V2-ndk_platform",
|
||||
"android.hardware.neuralnetworks-V1-ndk_platform",
|
||||
"android.hardware.neuralnetworks-V2-ndk_platform",
|
||||
"android.hidl.allocator@1.0",
|
||||
"android.hidl.memory@1.0",
|
||||
"libaidlcommonsupport",
|
||||
|
||||
@@ -35,7 +35,7 @@ cc_library_static {
|
||||
"neuralnetworks_types",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.neuralnetworks-V1-ndk_platform",
|
||||
"android.hardware.neuralnetworks-V2-ndk_platform",
|
||||
"libhidlbase",
|
||||
"libnativewindow",
|
||||
"libbinder_ndk",
|
||||
|
||||
@@ -39,7 +39,7 @@ cc_library_static {
|
||||
"neuralnetworks_utils_hal_common",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.neuralnetworks-V1-ndk_platform",
|
||||
"android.hardware.neuralnetworks-V2-ndk_platform",
|
||||
"android.hardware.neuralnetworks@1.0",
|
||||
"android.hardware.neuralnetworks@1.1",
|
||||
"android.hardware.neuralnetworks@1.2",
|
||||
|
||||
Reference in New Issue
Block a user