diff options
author | telsoa01 <telmo.soares@arm.com> | 2018-03-09 13:51:08 +0000 |
---|---|---|
committer | telsoa01 <telmo.soares@arm.com> | 2018-03-09 14:05:45 +0000 |
commit | 5307bc10ac488261e84ac76b2dede6039ea3fe96 (patch) | |
tree | 09de3cc29026ca9722179f6beb25b9a66efcf88e /Utils.hpp | |
download | android-nn-driver-5307bc10ac488261e84ac76b2dede6039ea3fe96.tar.gz |
Release 18.02
Change-Id: I41a89c149534a7c354a58e2c66a32cba572fc0c1
Diffstat (limited to 'Utils.hpp')
-rw-r--r-- | Utils.hpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Utils.hpp b/Utils.hpp new file mode 100644 index 00000000..49b8b8d8 --- /dev/null +++ b/Utils.hpp @@ -0,0 +1,51 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +#pragma once + +#include "HalInterfaces.h" +#include "NeuralNetworks.h" +#include <armnn/ArmNN.hpp> +#include <CpuExecutor.h> + +#include <vector> +#include <string> + +namespace armnn_driver +{ + +extern const armnn::PermutationVector g_DontPermute; + +class UnsupportedOperand: public std::runtime_error +{ +public: + UnsupportedOperand(const OperandType type) + : std::runtime_error("Operand type is unsupported") + , m_type(type) + {} + + OperandType m_type; +}; + +/// Swizzles tensor data in @a input according to the dimension mappings. +void SwizzleAndroidNn4dTensorToArmNn(const armnn::TensorInfo& tensor, const void* input, void* output, + const armnn::PermutationVector& mappings); + +/// Returns a pointer to a specific location in a pool +void* GetMemoryFromPool(DataLocation location, + const std::vector<android::nn::RunTimePoolInfo>& memPools); + +/// Can throw UnsupportedOperand +armnn::TensorInfo GetTensorInfoForOperand(const Operand& operand); + +std::string GetOperandSummary(const Operand& operand); +std::string GetModelSummary(const Model& model); + +void DumpTensor(const std::string& dumpDir, + const std::string& requestName, + const std::string& tensorName, + const armnn::ConstTensor& tensor); + +} |