Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include "LayerTestResult.hpp" |
| 9 | |
| 10 | #include <backendsCommon/IBackendInternal.hpp> |
| 11 | #include <backendsCommon/WorkloadFactory.hpp> |
| 12 | |
| 13 | // |
| 14 | // Sigmoid |
| 15 | // |
| 16 | |
| 17 | LayerTestResult<float, 4> SimpleSigmoidTest( |
| 18 | armnn::IWorkloadFactory& workloadFactory, |
| 19 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 20 | |
| 21 | LayerTestResult<uint8_t, 4> SimpleSigmoidUint8Test( |
| 22 | armnn::IWorkloadFactory& workloadFactory, |
| 23 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 24 | |
| 25 | LayerTestResult<int16_t, 4> SimpleSigmoidInt16Test( |
| 26 | armnn::IWorkloadFactory& workloadFactory, |
| 27 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 28 | |
| 29 | // |
| 30 | // TanH |
| 31 | // |
| 32 | |
| 33 | LayerTestResult<float, 4> TanhTest( |
| 34 | armnn::IWorkloadFactory& workloadFactory, |
| 35 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 36 | |
| 37 | LayerTestResult<uint8_t, 4> TanhUint8Test( |
| 38 | armnn::IWorkloadFactory& workloadFactory, |
| 39 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 40 | |
| 41 | LayerTestResult<int16_t, 4> TanhInt16Test( |
| 42 | armnn::IWorkloadFactory& workloadFactory, |
| 43 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 44 | |
| 45 | // |
| 46 | // Linear |
| 47 | // |
| 48 | |
| 49 | LayerTestResult<float, 4> ConstantLinearActivationTest( |
| 50 | armnn::IWorkloadFactory& workloadFactory, |
| 51 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 52 | |
| 53 | LayerTestResult<uint8_t, 4> ConstantLinearActivationUint8Test( |
| 54 | armnn::IWorkloadFactory& workloadFactory, |
| 55 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 56 | |
| 57 | LayerTestResult<int16_t, 4> ConstantLinearActivationInt16Test( |
| 58 | armnn::IWorkloadFactory& workloadFactory, |
| 59 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 60 | |
| 61 | // |
| 62 | // ReLu |
| 63 | // |
| 64 | |
| 65 | LayerTestResult<float, 4> ReLuTest( |
| 66 | armnn::IWorkloadFactory& workloadFactory, |
| 67 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 68 | |
| 69 | LayerTestResult<uint8_t, 4> ReLuUint8Test( |
| 70 | armnn::IWorkloadFactory& workloadFactory, |
| 71 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 72 | |
| 73 | LayerTestResult<int16_t, 4> ReLuInt16Test( |
| 74 | armnn::IWorkloadFactory& workloadFactory, |
| 75 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 76 | |
| 77 | // |
| 78 | // BoundedReLu |
| 79 | // |
| 80 | |
| 81 | LayerTestResult<uint8_t, 4> BoundedReLuUint8Test( |
| 82 | armnn::IWorkloadFactory& workloadFactory, |
| 83 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 84 | float upperBound); |
| 85 | |
| 86 | LayerTestResult<uint8_t, 4> BoundedReLuUint8Test( |
| 87 | armnn::IWorkloadFactory& workloadFactory, |
| 88 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 89 | float upperBound, |
| 90 | float lowerBound); |
| 91 | |
| 92 | LayerTestResult<int16_t, 4> BoundedReLuInt16Test( |
| 93 | armnn::IWorkloadFactory& workloadFactory, |
| 94 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 95 | |
| 96 | LayerTestResult<float, 4> BoundedReLuUpperAndLowerBoundTest( |
| 97 | armnn::IWorkloadFactory& workloadFactory, |
| 98 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 99 | |
| 100 | LayerTestResult<uint8_t, 4> BoundedReLuUint8UpperAndLowerBoundTest( |
| 101 | armnn::IWorkloadFactory& workloadFactor, |
| 102 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManagery); |
| 103 | |
| 104 | LayerTestResult<float, 4> BoundedReLuUpperBoundOnlyTest( |
| 105 | armnn::IWorkloadFactory& workloadFactory, |
| 106 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 107 | |
| 108 | LayerTestResult<uint8_t, 4> BoundedReLuUint8UpperBoundOnlyTest( |
| 109 | armnn::IWorkloadFactory& workloadFactory, |
| 110 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 111 | |
| 112 | LayerTestResult<float, 4> CompareBoundedReLuTest( |
| 113 | armnn::IWorkloadFactory& workloadFactory, |
| 114 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 115 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 116 | float upperBound, |
| 117 | float lowerBound); |
| 118 | |
| 119 | // |
| 120 | // SoftReLu |
| 121 | // |
| 122 | |
| 123 | LayerTestResult<float, 4> SoftReLuTest( |
| 124 | armnn::IWorkloadFactory& workloadFactory, |
| 125 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 126 | |
| 127 | LayerTestResult<uint8_t, 4> SoftReLuUint8Test( |
| 128 | armnn::IWorkloadFactory& workloadFactory, |
| 129 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 130 | |
| 131 | LayerTestResult<int16_t, 4> SoftReLuInt16Test( |
| 132 | armnn::IWorkloadFactory& workloadFactory, |
| 133 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 134 | |
| 135 | // |
| 136 | // LeakyReLu |
| 137 | // |
| 138 | |
| 139 | LayerTestResult<float, 4> LeakyReLuTest( |
| 140 | armnn::IWorkloadFactory& workloadFactory, |
| 141 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 142 | |
| 143 | LayerTestResult<uint8_t, 4> LeakyReLuUint8Test( |
| 144 | armnn::IWorkloadFactory& workloadFactory, |
| 145 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 146 | |
| 147 | LayerTestResult<int16_t, 4> LeakyReLuInt16Test( |
| 148 | armnn::IWorkloadFactory& workloadFactory, |
| 149 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 150 | |
| 151 | // |
| 152 | // Abs |
| 153 | // |
| 154 | |
| 155 | LayerTestResult<float, 4> AbsTest( |
| 156 | armnn::IWorkloadFactory& workloadFactory, |
| 157 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 158 | |
| 159 | LayerTestResult<uint8_t, 4> AbsUint8Test( |
| 160 | armnn::IWorkloadFactory& workloadFactory, |
| 161 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 162 | |
| 163 | LayerTestResult<int16_t, 4> AbsInt16Test( |
| 164 | armnn::IWorkloadFactory& workloadFactory, |
| 165 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 166 | |
| 167 | // |
| 168 | // Sqrt |
| 169 | // |
| 170 | |
| 171 | LayerTestResult<float, 4> SqrtTest( |
| 172 | armnn::IWorkloadFactory& workloadFactory, |
| 173 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 174 | |
| 175 | LayerTestResult<uint8_t, 4> SqrtUint8Test( |
| 176 | armnn::IWorkloadFactory& workloadFactory, |
| 177 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 178 | |
| 179 | LayerTestResult<int16_t, 4> SqrtInt16Test( |
| 180 | armnn::IWorkloadFactory& workloadFactory, |
| 181 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 182 | |
| 183 | // |
| 184 | // Square |
| 185 | // |
| 186 | |
| 187 | LayerTestResult<float, 4> SquareTest( |
| 188 | armnn::IWorkloadFactory& workloadFactory, |
| 189 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 190 | |
| 191 | LayerTestResult<uint8_t, 4> SquareUint8Test( |
| 192 | armnn::IWorkloadFactory& workloadFactory, |
| 193 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 194 | |
| 195 | LayerTestResult<int16_t, 4> SquareInt16Test( |
| 196 | armnn::IWorkloadFactory& workloadFactory, |
| 197 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager); |
| 198 | |
| 199 | // |
| 200 | // Other |
| 201 | // |
| 202 | |
| 203 | LayerTestResult<float, 4> CompareActivationTest( |
| 204 | armnn::IWorkloadFactory& workloadFactory, |
| 205 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 206 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 207 | armnn::ActivationFunction f, |
| 208 | unsigned int batchSize); |
| 209 | |
| 210 | LayerTestResult<uint8_t, 4> CompareActivationUint8Test( |
| 211 | armnn::IWorkloadFactory& workloadFactory, |
| 212 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 213 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 214 | armnn::ActivationFunction f); |
| 215 | |
| 216 | LayerTestResult<int16_t, 4> CompareActivationInt16Test( |
| 217 | armnn::IWorkloadFactory& workloadFactory, |
| 218 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 219 | armnn::IWorkloadFactory& refWorkloadFactory, |
| 220 | armnn::ActivationFunction f); |