blob: e2fa8dbf5a1abec21308c7a8b8353b44198558d4 [file] [log] [blame]
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +00001//
Teresa Charlinfbf0e5b2020-08-17 01:01:06 +01002// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +00003// SPDX-License-Identifier: MIT
4//
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +00005
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +01006#include "DebugTestImpl.hpp"
7
Colm Donelanc42a9872022-02-02 16:35:09 +00008#include <armnnUtils/QuantizeHelper.hpp>
Keith Davis15f9c682022-10-14 15:50:33 +01009#include <armnnUtils/Filesystem.hpp>
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +010010#include <ResolveType.hpp>
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000011
Sadik Armagana097d2a2021-11-24 15:47:28 +000012#include <armnnTestUtils/TensorCopyUtils.hpp>
Colm Donelan0c479742021-12-10 12:43:54 +000013#include <armnnTestUtils/WorkloadTestUtils.hpp>
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000014
Colm Donelanc42a9872022-02-02 16:35:09 +000015#include <armnnTestUtils/TensorHelpers.hpp>
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000016
Sadik Armagan1625efc2021-06-10 18:24:34 +010017#include <doctest/doctest.h>
Keith Davis15f9c682022-10-14 15:50:33 +010018#include <armnnUtils/Filesystem.hpp>
Sadik Armagan1625efc2021-06-10 18:24:34 +010019
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000020namespace
21{
22
23template<typename T, std::size_t Dim>
24LayerTestResult<T, Dim> DebugTestImpl(
25 armnn::IWorkloadFactory& workloadFactory,
26 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
27 armnn::TensorInfo& inputTensorInfo,
28 armnn::TensorInfo& outputTensorInfo,
29 std::vector<float>& inputData,
30 std::vector<float>& outputExpectedData,
31 armnn::DebugQueueDescriptor descriptor,
32 const std::string expectedStringOutput,
Keith Davis15f9c682022-10-14 15:50:33 +010033 const std::string& layerName,
34 bool toFile,
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000035 const float qScale = 1.0f,
36 const int32_t qOffset = 0)
37{
Jan Eilers8eb25602020-03-09 12:13:48 +000038 IgnoreUnused(memoryManager);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000039 if(armnn::IsQuantizedType<T>())
40 {
41 inputTensorInfo.SetQuantizationScale(qScale);
42 inputTensorInfo.SetQuantizationOffset(qOffset);
43
44 outputTensorInfo.SetQuantizationScale(qScale);
45 outputTensorInfo.SetQuantizationOffset(qOffset);
46 }
47
Sadik Armagan483c8112021-06-01 09:24:52 +010048 std::vector<T> input = armnnUtils::QuantizedVector<T>(inputData, qScale, qOffset);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000049
Sadik Armagan483c8112021-06-01 09:24:52 +010050 std::vector<T> actualOutput(outputTensorInfo.GetNumElements());
51 std::vector<T> expectedOutput = armnnUtils::QuantizedVector<T>(outputExpectedData, qScale, qOffset);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000052
Teresa Charlinfbf0e5b2020-08-17 01:01:06 +010053 ARMNN_NO_DEPRECATE_WARN_BEGIN
54 std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo);
55 std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo);
56 ARMNN_NO_DEPRECATE_WARN_END
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000057
58 armnn::WorkloadInfo info;
59 AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get());
60 AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get());
61
Teresa Charlin611c7fb2022-01-07 09:47:29 +000062 std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateWorkload(armnn::LayerType::Debug,
63 descriptor,
64 info);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000065
66 inputHandle->Allocate();
67 outputHandle->Allocate();
68
69 CopyDataToITensorHandle(inputHandle.get(), input.data());
Matteo Martincigh49124022019-01-11 13:25:59 +000070
Keith Davis15f9c682022-10-14 15:50:33 +010071 if (toFile)
72 {
Keith Davisf63b4572022-10-19 14:53:05 +010073 // Given that this is dependent on an ExNet switch, we need to explicitly set the directory that the
74 // files are stored in as this happens within the ExNet flow
Keith Davis15f9c682022-10-14 15:50:33 +010075 fs::path tmpDir = fs::temp_directory_path();
Keith Davisf63b4572022-10-19 14:53:05 +010076 armnnUtils::Filesystem::CreateDirectory("/ArmNNIntermediateLayerOutputs");
Keith Davis15f9c682022-10-14 15:50:33 +010077 std::string full_path = tmpDir.generic_string() + "/ArmNNIntermediateLayerOutputs/" + layerName + ".numpy";
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000078
Keith Davis15f9c682022-10-14 15:50:33 +010079 ExecuteWorkload(*workload, memoryManager);
Matteo Martincigh49124022019-01-11 13:25:59 +000080
Keith Davis15f9c682022-10-14 15:50:33 +010081 armnnUtils::Filesystem::FileContents output = armnnUtils::Filesystem::ReadFileContentsIntoString(full_path);
82 CHECK((output == expectedStringOutput));
83 }
84 else
85 {
86 std::ostringstream oss;
87 std::streambuf* coutStreambuf = std::cout.rdbuf();
88 std::cout.rdbuf(oss.rdbuf());
Matteo Martincigh49124022019-01-11 13:25:59 +000089
Keith Davis15f9c682022-10-14 15:50:33 +010090 ExecuteWorkload(*workload, memoryManager);
91
92 std::cout.rdbuf(coutStreambuf);
93 CHECK(oss.str() == expectedStringOutput);
94 }
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000095
Sadik Armagan483c8112021-06-01 09:24:52 +010096 CopyDataFromITensorHandle(actualOutput.data(), outputHandle.get());
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000097
Sadik Armagan483c8112021-06-01 09:24:52 +010098 return LayerTestResult<T, Dim>(actualOutput,
99 expectedOutput,
100 outputHandle->GetShape(),
101 outputTensorInfo.GetShape());
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000102}
103
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000104template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100105LayerTestResult<T, 4> Debug4dTest(
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000106 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100107 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
108 bool toFile = false)
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000109{
110 armnn::TensorInfo inputTensorInfo;
111 armnn::TensorInfo outputTensorInfo;
112
113 unsigned int inputShape[] = {1, 2, 2, 3};
114 unsigned int outputShape[] = {1, 2, 2, 3};
115
116 armnn::DebugQueueDescriptor desc;
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000117 desc.m_Guid = 1;
118 desc.m_LayerName = "TestOutput";
119 desc.m_SlotIndex = 0;
Keith Davis15f9c682022-10-14 15:50:33 +0100120 desc.m_LayerOutputToFile = toFile;
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000121
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000122 inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
123 outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000124
125 std::vector<float> input = std::vector<float>(
126 {
127 1.0f, 2.0f, 3.0f,
128 4.0f, 5.0f, 6.0f,
129 7.0f, 8.0f, 9.0f,
130 10.0f, 11.0f, 12.0f,
131 });
132
133 std::vector<float> outputExpected = std::vector<float>(
134 {
135 1.0f, 2.0f, 3.0f,
136 4.0f, 5.0f, 6.0f,
137 7.0f, 8.0f, 9.0f,
138 10.0f, 11.0f, 12.0f,
139 });
140
141 const std::string expectedStringOutput =
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000142 "{ \"layerGuid\": 1,"
143 " \"layerName\": \"TestOutput\","
144 " \"outputSlot\": 0,"
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000145 " \"shape\": [1, 2, 2, 3],"
146 " \"min\": 1, \"max\": 12,"
147 " \"data\": [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] }\n";
148
149 return DebugTestImpl<T, 4>(workloadFactory,
150 memoryManager,
151 inputTensorInfo,
152 outputTensorInfo,
153 input,
154 outputExpected,
155 desc,
Keith Davis15f9c682022-10-14 15:50:33 +0100156 expectedStringOutput,
157 desc.m_LayerName,
158 toFile);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000159}
160
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000161template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100162LayerTestResult<T, 3> Debug3dTest(
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000163 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100164 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
165 bool toFile = false)
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000166{
167 armnn::TensorInfo inputTensorInfo;
168 armnn::TensorInfo outputTensorInfo;
169
170 unsigned int inputShape[] = {3, 3, 1};
171 unsigned int outputShape[] = {3, 3, 1};
172
173 armnn::DebugQueueDescriptor desc;
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000174 desc.m_Guid = 1;
175 desc.m_LayerName = "TestOutput";
176 desc.m_SlotIndex = 0;
Keith Davis15f9c682022-10-14 15:50:33 +0100177 desc.m_LayerOutputToFile = toFile;
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000178
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000179 inputTensorInfo = armnn::TensorInfo(3, inputShape, ArmnnType);
180 outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000181
182 std::vector<float> input = std::vector<float>(
183 {
184 1.0f, 2.0f, 3.0f,
185 4.0f, 5.0f, 6.0f,
186 7.0f, 8.0f, 9.0f,
187 });
188
189 std::vector<float> outputExpected = std::vector<float>(
190 {
191 1.0f, 2.0f, 3.0f,
192 4.0f, 5.0f, 6.0f,
193 7.0f, 8.0f, 9.0f,
194 });
195
196 const std::string expectedStringOutput =
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000197 "{ \"layerGuid\": 1,"
198 " \"layerName\": \"TestOutput\","
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000199 " \"outputSlot\": 0,"
200 " \"shape\": [3, 3, 1],"
201 " \"min\": 1, \"max\": 9,"
202 " \"data\": [[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]] }\n";
203
204 return DebugTestImpl<T, 3>(workloadFactory,
205 memoryManager,
206 inputTensorInfo,
207 outputTensorInfo,
208 input,
209 outputExpected,
210 desc,
Keith Davis15f9c682022-10-14 15:50:33 +0100211 expectedStringOutput,
212 desc.m_LayerName,
213 toFile);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000214}
215
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000216template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100217LayerTestResult<T, 2> Debug2dTest(
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000218 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100219 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
220 bool toFile = false)
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000221{
222 armnn::TensorInfo inputTensorInfo;
223 armnn::TensorInfo outputTensorInfo;
224
225 unsigned int inputShape[] = {2, 2};
226 unsigned int outputShape[] = {2, 2};
227
228 armnn::DebugQueueDescriptor desc;
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000229 desc.m_Guid = 1;
230 desc.m_LayerName = "TestOutput";
231 desc.m_SlotIndex = 0;
Keith Davis15f9c682022-10-14 15:50:33 +0100232 desc.m_LayerOutputToFile = toFile;
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000233
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000234 inputTensorInfo = armnn::TensorInfo(2, inputShape, ArmnnType);
235 outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000236
237 std::vector<float> input = std::vector<float>(
238 {
239 1.0f, 2.0f,
240 3.0f, 4.0f,
241 });
242
243 std::vector<float> outputExpected = std::vector<float>(
244 {
245 1.0f, 2.0f,
246 3.0f, 4.0f,
247 });
248
249 const std::string expectedStringOutput =
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000250 "{ \"layerGuid\": 1,"
251 " \"layerName\": \"TestOutput\","
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000252 " \"outputSlot\": 0,"
253 " \"shape\": [2, 2],"
254 " \"min\": 1, \"max\": 4,"
255 " \"data\": [[1, 2], [3, 4]] }\n";
256
257 return DebugTestImpl<T, 2>(workloadFactory,
258 memoryManager,
259 inputTensorInfo,
260 outputTensorInfo,
261 input,
262 outputExpected,
263 desc,
Keith Davis15f9c682022-10-14 15:50:33 +0100264 expectedStringOutput,
265 desc.m_LayerName,
266 toFile);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000267}
268
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000269template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100270LayerTestResult<T, 1> Debug1dTest(
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000271 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100272 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
273 bool toFile = false)
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000274{
275 armnn::TensorInfo inputTensorInfo;
276 armnn::TensorInfo outputTensorInfo;
277
278 unsigned int inputShape[] = {4};
279 unsigned int outputShape[] = {4};
280
281 armnn::DebugQueueDescriptor desc;
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000282 desc.m_Guid = 1;
283 desc.m_LayerName = "TestOutput";
284 desc.m_SlotIndex = 0;
Keith Davis15f9c682022-10-14 15:50:33 +0100285 desc.m_LayerOutputToFile = toFile;
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000286
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000287 inputTensorInfo = armnn::TensorInfo(1, inputShape, ArmnnType);
288 outputTensorInfo = armnn::TensorInfo(1, outputShape, ArmnnType);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000289
290 std::vector<float> input = std::vector<float>(
291 {
292 1.0f, 2.0f, 3.0f, 4.0f,
293 });
294
295 std::vector<float> outputExpected = std::vector<float>(
296 {
297 1.0f, 2.0f, 3.0f, 4.0f,
298 });
299
300 const std::string expectedStringOutput =
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000301 "{ \"layerGuid\": 1,"
302 " \"layerName\": \"TestOutput\","
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000303 " \"outputSlot\": 0,"
304 " \"shape\": [4],"
305 " \"min\": 1, \"max\": 4,"
306 " \"data\": [1, 2, 3, 4] }\n";
307
308 return DebugTestImpl<T, 1>(workloadFactory,
309 memoryManager,
310 inputTensorInfo,
311 outputTensorInfo,
312 input,
313 outputExpected,
314 desc,
Keith Davis15f9c682022-10-14 15:50:33 +0100315 expectedStringOutput,
316 desc.m_LayerName,
317 toFile);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000318}
319
320} // anonymous namespace
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100321
322LayerTestResult<float, 4> Debug4dFloat32Test(
323 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100324 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
325 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100326{
Keith Davis15f9c682022-10-14 15:50:33 +0100327 return Debug4dTest<armnn::DataType::Float32>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100328}
329
330LayerTestResult<float, 3> Debug3dFloat32Test(
331 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100332 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
333 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100334{
Keith Davis15f9c682022-10-14 15:50:33 +0100335 return Debug3dTest<armnn::DataType::Float32>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100336}
337
338LayerTestResult<float, 2> Debug2dFloat32Test(
339 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100340 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
341 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100342{
Keith Davis15f9c682022-10-14 15:50:33 +0100343 return Debug2dTest<armnn::DataType::Float32>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100344}
345
346LayerTestResult<float, 1> Debug1dFloat32Test(
347 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100348 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
349 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100350{
Keith Davis15f9c682022-10-14 15:50:33 +0100351 return Debug1dTest<armnn::DataType::Float32>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100352}
353
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000354LayerTestResult<armnn::BFloat16, 4> Debug4dBFloat16Test(
355 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100356 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
357 bool toFile = false)
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000358{
Keith Davis15f9c682022-10-14 15:50:33 +0100359 return Debug4dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager, toFile);
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000360}
361
362LayerTestResult<armnn::BFloat16, 3> Debug3dBFloat16Test(
363 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100364 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
365 bool toFile = false)
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000366{
Keith Davis15f9c682022-10-14 15:50:33 +0100367 return Debug3dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager, toFile);
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000368}
369
370LayerTestResult<armnn::BFloat16, 2> Debug2dBFloat16Test(
371 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100372 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
373 bool toFile = false)
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000374{
Keith Davis15f9c682022-10-14 15:50:33 +0100375 return Debug2dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager, toFile);
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000376}
377
378LayerTestResult<armnn::BFloat16, 1> Debug1dBFloat16Test(
379 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100380 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
381 bool toFile = false)
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000382{
Keith Davis15f9c682022-10-14 15:50:33 +0100383 return Debug1dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager, toFile);
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000384}
385
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100386LayerTestResult<uint8_t, 4> Debug4dUint8Test(
387 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100388 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
389 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100390{
Keith Davis15f9c682022-10-14 15:50:33 +0100391 return Debug4dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100392}
393
394LayerTestResult<uint8_t, 3> Debug3dUint8Test(
395 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100396 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
397 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100398{
Keith Davis15f9c682022-10-14 15:50:33 +0100399 return Debug3dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100400}
401
402LayerTestResult<uint8_t, 2> Debug2dUint8Test(
403 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100404 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
405 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100406{
Keith Davis15f9c682022-10-14 15:50:33 +0100407 return Debug2dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100408}
409
410LayerTestResult<uint8_t, 1> Debug1dUint8Test(
411 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100412 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
413 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100414{
Keith Davis15f9c682022-10-14 15:50:33 +0100415 return Debug1dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100416}
417
418LayerTestResult<int16_t, 4> Debug4dInt16Test(
419 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100420 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
421 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100422{
Keith Davis15f9c682022-10-14 15:50:33 +0100423 return Debug4dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100424}
425
426LayerTestResult<int16_t, 3> Debug3dInt16Test(
427 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100428 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
429 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100430{
Keith Davis15f9c682022-10-14 15:50:33 +0100431 return Debug3dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100432}
433
434LayerTestResult<int16_t, 2> Debug2dInt16Test(
435 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100436 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
437 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100438{
Keith Davis15f9c682022-10-14 15:50:33 +0100439 return Debug2dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100440}
441
442LayerTestResult<int16_t, 1> Debug1dInt16Test(
443 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100444 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
445 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100446{
Keith Davis15f9c682022-10-14 15:50:33 +0100447 return Debug1dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100448}