diff options
author | Slava Shklyaev <slavash@google.com> | 2020-08-13 13:16:03 +0100 |
---|---|---|
committer | Slava Shklyaev <slavash@google.com> | 2020-11-02 10:07:07 +0000 |
commit | cbcaa00003cf5a4597460dbb5f8cb9f992e939e7 (patch) | |
tree | fcfc08ec92b731594fc96c586e1207bccce2624d /nn/common/operations/Conv2D.cpp | |
parent | e4a030ef549d8d2c279436628c961eb3f70df7d6 (diff) | |
download | ml-cbcaa00003cf5a4597460dbb5f8cb9f992e939e7.tar.gz |
Migrate NNAPI runtime to canonical types
This change replaces most uses of HAL types in the codebase with
equivalent canonical types. Later changes will introduce more
refactorings.
Also removes unused files nn/runtime/test/Bridge.{h,cpp}.
Bug: 160669906
Fix: 155923931
Test: NeuralNetworksTest_static (all 7 passes)
Test: NeuralNetworksTest_operations
Test: NeuralNetworksTest_utils
Test: NeuralNetworksTest_logtag
Test: nnCache_test
Test: BlobCache_test
Change-Id: I63fa286e926a096948f1b1b172d1d562c4f52f29
Merged-In: I63fa286e926a096948f1b1b172d1d562c4f52f29
(cherry picked from commit 069993366ce59913ff162ed144749bb8794d990c)
Diffstat (limited to 'nn/common/operations/Conv2D.cpp')
-rw-r--r-- | nn/common/operations/Conv2D.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/nn/common/operations/Conv2D.cpp b/nn/common/operations/Conv2D.cpp index f34e9080c..5b7d8d0de 100644 --- a/nn/common/operations/Conv2D.cpp +++ b/nn/common/operations/Conv2D.cpp @@ -26,7 +26,6 @@ #include <vector> #include "CpuOperationUtils.h" -#include "HalInterfaces.h" #include "OperationResolver.h" #include "Operations.h" #include "OperationsUtils.h" @@ -49,8 +48,6 @@ constexpr uint32_t kOutputTensor = 0; namespace { -using namespace hal; - // If possible we will use this static buffer for the tensor. constexpr size_t kStaticBufferSize = 1605632; char static_scratch_buffer[kStaticBufferSize]; @@ -566,7 +563,9 @@ bool validate(const IOperationValidationContext* context) { OperandType::INT32}; if (filterType == OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL) { - NN_RET_CHECK_EQ(context->getInputExtraParams(kFilterTensor).channelQuant().channelDim, + NN_RET_CHECK_EQ(std::get<Operand::SymmPerChannelQuantParams>( + context->getInputExtraParams(kFilterTensor)) + .channelDim, 0) << "Unsupported filter tensor channel dimension for operation " << kOperationName; @@ -727,7 +726,9 @@ bool execute(IOperationExecutionContext* context) { context->getInputShape(kInputTensor), context->getInputBuffer<int8_t>(kFilterTensor), context->getInputShape(kFilterTensor), - context->getInputExtraParams(kFilterTensor).channelQuant().scales.data(), + std::get<Operand::SymmPerChannelQuantParams>( + context->getInputExtraParams(kFilterTensor)) + .scales.data(), context->getInputBuffer<int32_t>(kBiasTensor), context->getInputShape(kBiasTensor), param.padding_left, param.padding_right, param.padding_top, param.padding_bottom, @@ -758,7 +759,9 @@ bool execute(IOperationExecutionContext* context) { context->getInputShape(kInputTensor), context->getInputBuffer<int8_t>(kFilterTensor), context->getInputShape(kFilterTensor), - context->getInputExtraParams(kFilterTensor).channelQuant().scales.data(), + std::get<Operand::SymmPerChannelQuantParams>( + context->getInputExtraParams(kFilterTensor)) + .scales.data(), context->getInputBuffer<int32_t>(kBiasTensor), context->getInputShape(kBiasTensor), param.padding_left, param.padding_right, param.padding_top, param.padding_bottom, |