Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 1 | // |
Teresa Charlin | fbf0e5b | 2020-08-17 01:01:06 +0100 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 5 | |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 6 | #include "DebugTestImpl.hpp" |
| 7 | |
Aron Virginas-Tar | 48623a0 | 2019-10-22 10:00:28 +0100 | [diff] [blame] | 8 | #include <QuantizeHelper.hpp> |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 9 | #include <ResolveType.hpp> |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 10 | |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 11 | |
Sadik Armagan | a097d2a | 2021-11-24 15:47:28 +0000 | [diff] [blame] | 12 | #include <armnnTestUtils/TensorCopyUtils.hpp> |
Colm Donelan | 0c47974 | 2021-12-10 12:43:54 +0000 | [diff] [blame] | 13 | #include <armnnTestUtils/WorkloadTestUtils.hpp> |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 14 | |
Sadik Armagan | a097d2a | 2021-11-24 15:47:28 +0000 | [diff] [blame] | 15 | #include <TensorHelpers.hpp> |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 16 | |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 17 | #include <doctest/doctest.h> |
| 18 | |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 19 | namespace |
| 20 | { |
| 21 | |
| 22 | template<typename T, std::size_t Dim> |
| 23 | LayerTestResult<T, Dim> DebugTestImpl( |
| 24 | armnn::IWorkloadFactory& workloadFactory, |
| 25 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 26 | armnn::TensorInfo& inputTensorInfo, |
| 27 | armnn::TensorInfo& outputTensorInfo, |
| 28 | std::vector<float>& inputData, |
| 29 | std::vector<float>& outputExpectedData, |
| 30 | armnn::DebugQueueDescriptor descriptor, |
| 31 | const std::string expectedStringOutput, |
| 32 | const float qScale = 1.0f, |
| 33 | const int32_t qOffset = 0) |
| 34 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 35 | IgnoreUnused(memoryManager); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 36 | if(armnn::IsQuantizedType<T>()) |
| 37 | { |
| 38 | inputTensorInfo.SetQuantizationScale(qScale); |
| 39 | inputTensorInfo.SetQuantizationOffset(qOffset); |
| 40 | |
| 41 | outputTensorInfo.SetQuantizationScale(qScale); |
| 42 | outputTensorInfo.SetQuantizationOffset(qOffset); |
| 43 | } |
| 44 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 45 | std::vector<T> input = armnnUtils::QuantizedVector<T>(inputData, qScale, qOffset); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 46 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 47 | std::vector<T> actualOutput(outputTensorInfo.GetNumElements()); |
| 48 | std::vector<T> expectedOutput = armnnUtils::QuantizedVector<T>(outputExpectedData, qScale, qOffset); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 49 | |
Teresa Charlin | fbf0e5b | 2020-08-17 01:01:06 +0100 | [diff] [blame] | 50 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
| 51 | std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); |
| 52 | std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); |
| 53 | ARMNN_NO_DEPRECATE_WARN_END |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 54 | |
| 55 | armnn::WorkloadInfo info; |
| 56 | AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); |
| 57 | AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); |
| 58 | |
| 59 | std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateDebug(descriptor, info); |
| 60 | |
| 61 | inputHandle->Allocate(); |
| 62 | outputHandle->Allocate(); |
| 63 | |
| 64 | CopyDataToITensorHandle(inputHandle.get(), input.data()); |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 65 | |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 66 | std::ostringstream oss; |
| 67 | std::streambuf* coutStreambuf = std::cout.rdbuf(); |
| 68 | std::cout.rdbuf(oss.rdbuf()); |
| 69 | |
| 70 | ExecuteWorkload(*workload, memoryManager); |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 71 | |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 72 | std::cout.rdbuf(coutStreambuf); |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 73 | |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 74 | CHECK(oss.str() == expectedStringOutput); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 75 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 76 | CopyDataFromITensorHandle(actualOutput.data(), outputHandle.get()); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 77 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 78 | return LayerTestResult<T, Dim>(actualOutput, |
| 79 | expectedOutput, |
| 80 | outputHandle->GetShape(), |
| 81 | outputTensorInfo.GetShape()); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 82 | } |
| 83 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 84 | template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 85 | LayerTestResult<T, 4> Debug4dTest( |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 86 | armnn::IWorkloadFactory& workloadFactory, |
| 87 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 88 | { |
| 89 | armnn::TensorInfo inputTensorInfo; |
| 90 | armnn::TensorInfo outputTensorInfo; |
| 91 | |
| 92 | unsigned int inputShape[] = {1, 2, 2, 3}; |
| 93 | unsigned int outputShape[] = {1, 2, 2, 3}; |
| 94 | |
| 95 | armnn::DebugQueueDescriptor desc; |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 96 | desc.m_Guid = 1; |
| 97 | desc.m_LayerName = "TestOutput"; |
| 98 | desc.m_SlotIndex = 0; |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 99 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 100 | inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType); |
| 101 | outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 102 | |
| 103 | std::vector<float> input = std::vector<float>( |
| 104 | { |
| 105 | 1.0f, 2.0f, 3.0f, |
| 106 | 4.0f, 5.0f, 6.0f, |
| 107 | 7.0f, 8.0f, 9.0f, |
| 108 | 10.0f, 11.0f, 12.0f, |
| 109 | }); |
| 110 | |
| 111 | std::vector<float> outputExpected = std::vector<float>( |
| 112 | { |
| 113 | 1.0f, 2.0f, 3.0f, |
| 114 | 4.0f, 5.0f, 6.0f, |
| 115 | 7.0f, 8.0f, 9.0f, |
| 116 | 10.0f, 11.0f, 12.0f, |
| 117 | }); |
| 118 | |
| 119 | const std::string expectedStringOutput = |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 120 | "{ \"layerGuid\": 1," |
| 121 | " \"layerName\": \"TestOutput\"," |
| 122 | " \"outputSlot\": 0," |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 123 | " \"shape\": [1, 2, 2, 3]," |
| 124 | " \"min\": 1, \"max\": 12," |
| 125 | " \"data\": [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] }\n"; |
| 126 | |
| 127 | return DebugTestImpl<T, 4>(workloadFactory, |
| 128 | memoryManager, |
| 129 | inputTensorInfo, |
| 130 | outputTensorInfo, |
| 131 | input, |
| 132 | outputExpected, |
| 133 | desc, |
| 134 | expectedStringOutput); |
| 135 | } |
| 136 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 137 | template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 138 | LayerTestResult<T, 3> Debug3dTest( |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 139 | armnn::IWorkloadFactory& workloadFactory, |
| 140 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 141 | { |
| 142 | armnn::TensorInfo inputTensorInfo; |
| 143 | armnn::TensorInfo outputTensorInfo; |
| 144 | |
| 145 | unsigned int inputShape[] = {3, 3, 1}; |
| 146 | unsigned int outputShape[] = {3, 3, 1}; |
| 147 | |
| 148 | armnn::DebugQueueDescriptor desc; |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 149 | desc.m_Guid = 1; |
| 150 | desc.m_LayerName = "TestOutput"; |
| 151 | desc.m_SlotIndex = 0; |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 152 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 153 | inputTensorInfo = armnn::TensorInfo(3, inputShape, ArmnnType); |
| 154 | outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 155 | |
| 156 | std::vector<float> input = std::vector<float>( |
| 157 | { |
| 158 | 1.0f, 2.0f, 3.0f, |
| 159 | 4.0f, 5.0f, 6.0f, |
| 160 | 7.0f, 8.0f, 9.0f, |
| 161 | }); |
| 162 | |
| 163 | std::vector<float> outputExpected = std::vector<float>( |
| 164 | { |
| 165 | 1.0f, 2.0f, 3.0f, |
| 166 | 4.0f, 5.0f, 6.0f, |
| 167 | 7.0f, 8.0f, 9.0f, |
| 168 | }); |
| 169 | |
| 170 | const std::string expectedStringOutput = |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 171 | "{ \"layerGuid\": 1," |
| 172 | " \"layerName\": \"TestOutput\"," |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 173 | " \"outputSlot\": 0," |
| 174 | " \"shape\": [3, 3, 1]," |
| 175 | " \"min\": 1, \"max\": 9," |
| 176 | " \"data\": [[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]] }\n"; |
| 177 | |
| 178 | return DebugTestImpl<T, 3>(workloadFactory, |
| 179 | memoryManager, |
| 180 | inputTensorInfo, |
| 181 | outputTensorInfo, |
| 182 | input, |
| 183 | outputExpected, |
| 184 | desc, |
| 185 | expectedStringOutput); |
| 186 | } |
| 187 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 188 | template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 189 | LayerTestResult<T, 2> Debug2dTest( |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 190 | armnn::IWorkloadFactory& workloadFactory, |
| 191 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 192 | { |
| 193 | armnn::TensorInfo inputTensorInfo; |
| 194 | armnn::TensorInfo outputTensorInfo; |
| 195 | |
| 196 | unsigned int inputShape[] = {2, 2}; |
| 197 | unsigned int outputShape[] = {2, 2}; |
| 198 | |
| 199 | armnn::DebugQueueDescriptor desc; |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 200 | desc.m_Guid = 1; |
| 201 | desc.m_LayerName = "TestOutput"; |
| 202 | desc.m_SlotIndex = 0; |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 203 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 204 | inputTensorInfo = armnn::TensorInfo(2, inputShape, ArmnnType); |
| 205 | outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 206 | |
| 207 | std::vector<float> input = std::vector<float>( |
| 208 | { |
| 209 | 1.0f, 2.0f, |
| 210 | 3.0f, 4.0f, |
| 211 | }); |
| 212 | |
| 213 | std::vector<float> outputExpected = std::vector<float>( |
| 214 | { |
| 215 | 1.0f, 2.0f, |
| 216 | 3.0f, 4.0f, |
| 217 | }); |
| 218 | |
| 219 | const std::string expectedStringOutput = |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 220 | "{ \"layerGuid\": 1," |
| 221 | " \"layerName\": \"TestOutput\"," |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 222 | " \"outputSlot\": 0," |
| 223 | " \"shape\": [2, 2]," |
| 224 | " \"min\": 1, \"max\": 4," |
| 225 | " \"data\": [[1, 2], [3, 4]] }\n"; |
| 226 | |
| 227 | return DebugTestImpl<T, 2>(workloadFactory, |
| 228 | memoryManager, |
| 229 | inputTensorInfo, |
| 230 | outputTensorInfo, |
| 231 | input, |
| 232 | outputExpected, |
| 233 | desc, |
| 234 | expectedStringOutput); |
| 235 | } |
| 236 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 237 | template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 238 | LayerTestResult<T, 1> Debug1dTest( |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 239 | armnn::IWorkloadFactory& workloadFactory, |
| 240 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 241 | { |
| 242 | armnn::TensorInfo inputTensorInfo; |
| 243 | armnn::TensorInfo outputTensorInfo; |
| 244 | |
| 245 | unsigned int inputShape[] = {4}; |
| 246 | unsigned int outputShape[] = {4}; |
| 247 | |
| 248 | armnn::DebugQueueDescriptor desc; |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 249 | desc.m_Guid = 1; |
| 250 | desc.m_LayerName = "TestOutput"; |
| 251 | desc.m_SlotIndex = 0; |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 252 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 253 | inputTensorInfo = armnn::TensorInfo(1, inputShape, ArmnnType); |
| 254 | outputTensorInfo = armnn::TensorInfo(1, outputShape, ArmnnType); |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 255 | |
| 256 | std::vector<float> input = std::vector<float>( |
| 257 | { |
| 258 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 259 | }); |
| 260 | |
| 261 | std::vector<float> outputExpected = std::vector<float>( |
| 262 | { |
| 263 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 264 | }); |
| 265 | |
| 266 | const std::string expectedStringOutput = |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 267 | "{ \"layerGuid\": 1," |
| 268 | " \"layerName\": \"TestOutput\"," |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 269 | " \"outputSlot\": 0," |
| 270 | " \"shape\": [4]," |
| 271 | " \"min\": 1, \"max\": 4," |
| 272 | " \"data\": [1, 2, 3, 4] }\n"; |
| 273 | |
| 274 | return DebugTestImpl<T, 1>(workloadFactory, |
| 275 | memoryManager, |
| 276 | inputTensorInfo, |
| 277 | outputTensorInfo, |
| 278 | input, |
| 279 | outputExpected, |
| 280 | desc, |
| 281 | expectedStringOutput); |
| 282 | } |
| 283 | |
| 284 | } // anonymous namespace |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 285 | |
| 286 | LayerTestResult<float, 4> Debug4dFloat32Test( |
| 287 | armnn::IWorkloadFactory& workloadFactory, |
| 288 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 289 | { |
| 290 | return Debug4dTest<armnn::DataType::Float32>(workloadFactory, memoryManager); |
| 291 | } |
| 292 | |
| 293 | LayerTestResult<float, 3> Debug3dFloat32Test( |
| 294 | armnn::IWorkloadFactory& workloadFactory, |
| 295 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 296 | { |
| 297 | return Debug3dTest<armnn::DataType::Float32>(workloadFactory, memoryManager); |
| 298 | } |
| 299 | |
| 300 | LayerTestResult<float, 2> Debug2dFloat32Test( |
| 301 | armnn::IWorkloadFactory& workloadFactory, |
| 302 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 303 | { |
| 304 | return Debug2dTest<armnn::DataType::Float32>(workloadFactory, memoryManager); |
| 305 | } |
| 306 | |
| 307 | LayerTestResult<float, 1> Debug1dFloat32Test( |
| 308 | armnn::IWorkloadFactory& workloadFactory, |
| 309 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 310 | { |
| 311 | return Debug1dTest<armnn::DataType::Float32>(workloadFactory, memoryManager); |
| 312 | } |
| 313 | |
Narumol Prangnawarat | 403a185 | 2020-03-12 14:24:13 +0000 | [diff] [blame] | 314 | LayerTestResult<armnn::BFloat16, 4> Debug4dBFloat16Test( |
| 315 | armnn::IWorkloadFactory& workloadFactory, |
| 316 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 317 | { |
| 318 | return Debug4dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager); |
| 319 | } |
| 320 | |
| 321 | LayerTestResult<armnn::BFloat16, 3> Debug3dBFloat16Test( |
| 322 | armnn::IWorkloadFactory& workloadFactory, |
| 323 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 324 | { |
| 325 | return Debug3dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager); |
| 326 | } |
| 327 | |
| 328 | LayerTestResult<armnn::BFloat16, 2> Debug2dBFloat16Test( |
| 329 | armnn::IWorkloadFactory& workloadFactory, |
| 330 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 331 | { |
| 332 | return Debug2dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager); |
| 333 | } |
| 334 | |
| 335 | LayerTestResult<armnn::BFloat16, 1> Debug1dBFloat16Test( |
| 336 | armnn::IWorkloadFactory& workloadFactory, |
| 337 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 338 | { |
| 339 | return Debug1dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager); |
| 340 | } |
| 341 | |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 342 | LayerTestResult<uint8_t, 4> Debug4dUint8Test( |
| 343 | armnn::IWorkloadFactory& workloadFactory, |
| 344 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 345 | { |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 346 | return Debug4dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager); |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 347 | } |
| 348 | |
| 349 | LayerTestResult<uint8_t, 3> Debug3dUint8Test( |
| 350 | armnn::IWorkloadFactory& workloadFactory, |
| 351 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 352 | { |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 353 | return Debug3dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager); |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | LayerTestResult<uint8_t, 2> Debug2dUint8Test( |
| 357 | armnn::IWorkloadFactory& workloadFactory, |
| 358 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 359 | { |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 360 | return Debug2dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager); |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 361 | } |
| 362 | |
| 363 | LayerTestResult<uint8_t, 1> Debug1dUint8Test( |
| 364 | armnn::IWorkloadFactory& workloadFactory, |
| 365 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 366 | { |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 367 | return Debug1dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager); |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 368 | } |
| 369 | |
| 370 | LayerTestResult<int16_t, 4> Debug4dInt16Test( |
| 371 | armnn::IWorkloadFactory& workloadFactory, |
| 372 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 373 | { |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 374 | return Debug4dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager); |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 375 | } |
| 376 | |
| 377 | LayerTestResult<int16_t, 3> Debug3dInt16Test( |
| 378 | armnn::IWorkloadFactory& workloadFactory, |
| 379 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 380 | { |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 381 | return Debug3dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager); |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 382 | } |
| 383 | |
| 384 | LayerTestResult<int16_t, 2> Debug2dInt16Test( |
| 385 | armnn::IWorkloadFactory& workloadFactory, |
| 386 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 387 | { |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 388 | return Debug2dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager); |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 389 | } |
| 390 | |
| 391 | LayerTestResult<int16_t, 1> Debug1dInt16Test( |
| 392 | armnn::IWorkloadFactory& workloadFactory, |
| 393 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) |
| 394 | { |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 395 | return Debug1dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager); |
Aron Virginas-Tar | 00d306e | 2019-08-28 18:08:46 +0100 | [diff] [blame] | 396 | } |