telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // See LICENSE file in the project root for full license information. |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include "HalInterfaces.h" |
| 9 | #include "NeuralNetworks.h" |
| 10 | #include <armnn/ArmNN.hpp> |
| 11 | #include <CpuExecutor.h> |
| 12 | |
| 13 | #include <vector> |
| 14 | #include <string> |
| 15 | |
| 16 | namespace armnn_driver |
| 17 | { |
| 18 | |
| 19 | extern const armnn::PermutationVector g_DontPermute; |
| 20 | |
| 21 | class UnsupportedOperand: public std::runtime_error |
| 22 | { |
| 23 | public: |
| 24 | UnsupportedOperand(const OperandType type) |
| 25 | : std::runtime_error("Operand type is unsupported") |
| 26 | , m_type(type) |
| 27 | {} |
| 28 | |
| 29 | OperandType m_type; |
| 30 | }; |
| 31 | |
| 32 | /// Swizzles tensor data in @a input according to the dimension mappings. |
| 33 | void SwizzleAndroidNn4dTensorToArmNn(const armnn::TensorInfo& tensor, const void* input, void* output, |
| 34 | const armnn::PermutationVector& mappings); |
| 35 | |
| 36 | /// Returns a pointer to a specific location in a pool |
| 37 | void* GetMemoryFromPool(DataLocation location, |
| 38 | const std::vector<android::nn::RunTimePoolInfo>& memPools); |
| 39 | |
| 40 | /// Can throw UnsupportedOperand |
| 41 | armnn::TensorInfo GetTensorInfoForOperand(const Operand& operand); |
| 42 | |
| 43 | std::string GetOperandSummary(const Operand& operand); |
| 44 | std::string GetModelSummary(const Model& model); |
| 45 | |
| 46 | void DumpTensor(const std::string& dumpDir, |
| 47 | const std::string& requestName, |
| 48 | const std::string& tensorName, |
| 49 | const armnn::ConstTensor& tensor); |
| 50 | |
surmeh01 | 7666005 | 2018-03-29 16:33:54 +0100 | [diff] [blame^] | 51 | void ExportNetworkGraphToDotFile(const armnn::IOptimizedNetwork& optimizedNetwork, |
| 52 | const std::string& dumpDir, |
| 53 | const Model& model); |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 54 | } |