blob: e6b56be02c795806cff0e5cdace0ba82e3958d1e [file] [log] [blame]
telsoa015307bc12018-03-09 13:51:08 +00001//
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
16namespace armnn_driver
17{
18
19extern const armnn::PermutationVector g_DontPermute;
20
21class UnsupportedOperand: public std::runtime_error
22{
23public:
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.
33void 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
37void* GetMemoryFromPool(DataLocation location,
38 const std::vector<android::nn::RunTimePoolInfo>& memPools);
39
40/// Can throw UnsupportedOperand
41armnn::TensorInfo GetTensorInfoForOperand(const Operand& operand);
42
43std::string GetOperandSummary(const Operand& operand);
44std::string GetModelSummary(const Model& model);
45
46void DumpTensor(const std::string& dumpDir,
47 const std::string& requestName,
48 const std::string& tensorName,
49 const armnn::ConstTensor& tensor);
50
surmeh0176660052018-03-29 16:33:54 +010051void ExportNetworkGraphToDotFile(const armnn::IOptimizedNetwork& optimizedNetwork,
52 const std::string& dumpDir,
53 const Model& model);
telsoa015307bc12018-03-09 13:51:08 +000054}