diff options
author | Mike Kelly <mike.kelly@arm.com> | 2019-06-11 16:35:25 +0100 |
---|---|---|
committer | Mike Kelly <mike.kelly@arm.com> | 2019-06-11 16:35:25 +0100 |
commit | b5fdf38f0c6596958fab2b84882f2792a31e585a (patch) | |
tree | d6b578b51c1923c759653d8a04efa90923ad4dd8 /Utils.hpp | |
parent | b92f8901fc34749337ea7a9ad7a2717fc9490de5 (diff) | |
download | android-nn-driver-b5fdf38f0c6596958fab2b84882f2792a31e585a.tar.gz |
IVGCVSW-3181 Add HAL 1.2 support to android-nn-driver
* Updated Android.mk to build HAL 1.2 driver
* Added 1.2 HalPolicy and ArmnnDriver
* Added 1.2 ArmnnPreparedModel
* Updated converters and utilities to accept new HAL 1.2 operands and operand types.
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: I62856deab24e106f72cccce09468db4971756fa6
Diffstat (limited to 'Utils.hpp')
-rw-r--r-- | Utils.hpp | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -4,7 +4,6 @@ // #pragma once - #include <armnn/ArmNN.hpp> #include <CpuExecutor.h> @@ -21,20 +20,25 @@ namespace V1_0 = ::android::hardware::neuralnetworks::V1_0; +#ifdef ARMNN_ANDROID_NN_V1_2 // Using ::android::hardware::neuralnetworks::V1_2 +namespace V1_2 = ::android::hardware::neuralnetworks::V1_2; +#endif + namespace armnn_driver { extern const armnn::PermutationVector g_DontPermute; +template <typename OperandType> class UnsupportedOperand: public std::runtime_error { public: - UnsupportedOperand(const V1_0::OperandType type) + UnsupportedOperand(const OperandType type) : std::runtime_error("Operand type is unsupported") , m_type(type) {} - V1_0::OperandType m_type; + OperandType m_type; }; /// Swizzles tensor data in @a input according to the dimension mappings. @@ -48,8 +52,16 @@ void* GetMemoryFromPool(DataLocation location, /// Can throw UnsupportedOperand armnn::TensorInfo GetTensorInfoForOperand(const V1_0::Operand& operand); +#ifdef ARMNN_ANDROID_NN_V1_2 // Using ::android::hardware::neuralnetworks::V1_2 +armnn::TensorInfo GetTensorInfoForOperand(const V1_2::Operand& operand); +#endif + std::string GetOperandSummary(const V1_0::Operand& operand); +#ifdef ARMNN_ANDROID_NN_V1_2 // Using ::android::hardware::neuralnetworks::V1_2 +std::string GetOperandSummary(const V1_2::Operand& operand); +#endif + template <typename HalModel> std::string GetModelSummary(const HalModel& model) { |