blob: 1768f5c50363e7501e5e1582e666e395cb8d91ca [file] [log] [blame]
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +00001//
Colm Donelane27983c2023-01-16 16:45:08 +00002// Copyright © 2017,2023 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
Colm Donelane27983c2023-01-16 16:45:08 +000075 auto tmpDir = armnnUtils::Filesystem::CreateDirectory("/ArmNNIntermediateLayerOutputs");
76 std::string full_path = tmpDir + layerName + ".numpy";
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000077
Keith Davis15f9c682022-10-14 15:50:33 +010078 ExecuteWorkload(*workload, memoryManager);
Matteo Martincigh49124022019-01-11 13:25:59 +000079
Keith Davis15f9c682022-10-14 15:50:33 +010080 armnnUtils::Filesystem::FileContents output = armnnUtils::Filesystem::ReadFileContentsIntoString(full_path);
81 CHECK((output == expectedStringOutput));
Colm Donelanb5ea5892023-02-10 15:19:46 +000082
83 // Clean up afterwards.
84 armnnUtils::Filesystem::RemoveDirectoryAndContents(tmpDir);
Keith Davis15f9c682022-10-14 15:50:33 +010085 }
86 else
87 {
88 std::ostringstream oss;
89 std::streambuf* coutStreambuf = std::cout.rdbuf();
90 std::cout.rdbuf(oss.rdbuf());
Matteo Martincigh49124022019-01-11 13:25:59 +000091
Keith Davis15f9c682022-10-14 15:50:33 +010092 ExecuteWorkload(*workload, memoryManager);
93
94 std::cout.rdbuf(coutStreambuf);
95 CHECK(oss.str() == expectedStringOutput);
96 }
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000097
Sadik Armagan483c8112021-06-01 09:24:52 +010098 CopyDataFromITensorHandle(actualOutput.data(), outputHandle.get());
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000099
Sadik Armagan483c8112021-06-01 09:24:52 +0100100 return LayerTestResult<T, Dim>(actualOutput,
101 expectedOutput,
102 outputHandle->GetShape(),
103 outputTensorInfo.GetShape());
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000104}
105
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000106template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100107LayerTestResult<T, 4> Debug4dTest(
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000108 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100109 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
110 bool toFile = false)
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000111{
112 armnn::TensorInfo inputTensorInfo;
113 armnn::TensorInfo outputTensorInfo;
114
115 unsigned int inputShape[] = {1, 2, 2, 3};
116 unsigned int outputShape[] = {1, 2, 2, 3};
117
118 armnn::DebugQueueDescriptor desc;
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000119 desc.m_Guid = 1;
120 desc.m_LayerName = "TestOutput";
121 desc.m_SlotIndex = 0;
Keith Davis15f9c682022-10-14 15:50:33 +0100122 desc.m_LayerOutputToFile = toFile;
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000123
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000124 inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
125 outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000126
127 std::vector<float> input = std::vector<float>(
128 {
129 1.0f, 2.0f, 3.0f,
130 4.0f, 5.0f, 6.0f,
131 7.0f, 8.0f, 9.0f,
132 10.0f, 11.0f, 12.0f,
133 });
134
135 std::vector<float> outputExpected = std::vector<float>(
136 {
137 1.0f, 2.0f, 3.0f,
138 4.0f, 5.0f, 6.0f,
139 7.0f, 8.0f, 9.0f,
140 10.0f, 11.0f, 12.0f,
141 });
142
143 const std::string expectedStringOutput =
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000144 "{ \"layerGuid\": 1,"
145 " \"layerName\": \"TestOutput\","
146 " \"outputSlot\": 0,"
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000147 " \"shape\": [1, 2, 2, 3],"
148 " \"min\": 1, \"max\": 12,"
149 " \"data\": [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] }\n";
150
151 return DebugTestImpl<T, 4>(workloadFactory,
152 memoryManager,
153 inputTensorInfo,
154 outputTensorInfo,
155 input,
156 outputExpected,
157 desc,
Keith Davis15f9c682022-10-14 15:50:33 +0100158 expectedStringOutput,
159 desc.m_LayerName,
160 toFile);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000161}
162
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000163template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100164LayerTestResult<T, 3> Debug3dTest(
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000165 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100166 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
167 bool toFile = false)
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000168{
169 armnn::TensorInfo inputTensorInfo;
170 armnn::TensorInfo outputTensorInfo;
171
172 unsigned int inputShape[] = {3, 3, 1};
173 unsigned int outputShape[] = {3, 3, 1};
174
175 armnn::DebugQueueDescriptor desc;
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000176 desc.m_Guid = 1;
177 desc.m_LayerName = "TestOutput";
178 desc.m_SlotIndex = 0;
Keith Davis15f9c682022-10-14 15:50:33 +0100179 desc.m_LayerOutputToFile = toFile;
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000180
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000181 inputTensorInfo = armnn::TensorInfo(3, inputShape, ArmnnType);
182 outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000183
184 std::vector<float> input = std::vector<float>(
185 {
186 1.0f, 2.0f, 3.0f,
187 4.0f, 5.0f, 6.0f,
188 7.0f, 8.0f, 9.0f,
189 });
190
191 std::vector<float> outputExpected = std::vector<float>(
192 {
193 1.0f, 2.0f, 3.0f,
194 4.0f, 5.0f, 6.0f,
195 7.0f, 8.0f, 9.0f,
196 });
197
198 const std::string expectedStringOutput =
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000199 "{ \"layerGuid\": 1,"
200 " \"layerName\": \"TestOutput\","
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000201 " \"outputSlot\": 0,"
202 " \"shape\": [3, 3, 1],"
203 " \"min\": 1, \"max\": 9,"
204 " \"data\": [[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]] }\n";
205
206 return DebugTestImpl<T, 3>(workloadFactory,
207 memoryManager,
208 inputTensorInfo,
209 outputTensorInfo,
210 input,
211 outputExpected,
212 desc,
Keith Davis15f9c682022-10-14 15:50:33 +0100213 expectedStringOutput,
214 desc.m_LayerName,
215 toFile);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000216}
217
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000218template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100219LayerTestResult<T, 2> Debug2dTest(
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000220 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100221 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
222 bool toFile = false)
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000223{
224 armnn::TensorInfo inputTensorInfo;
225 armnn::TensorInfo outputTensorInfo;
226
227 unsigned int inputShape[] = {2, 2};
228 unsigned int outputShape[] = {2, 2};
229
230 armnn::DebugQueueDescriptor desc;
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000231 desc.m_Guid = 1;
232 desc.m_LayerName = "TestOutput";
233 desc.m_SlotIndex = 0;
Keith Davis15f9c682022-10-14 15:50:33 +0100234 desc.m_LayerOutputToFile = toFile;
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000235
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000236 inputTensorInfo = armnn::TensorInfo(2, inputShape, ArmnnType);
237 outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000238
239 std::vector<float> input = std::vector<float>(
240 {
241 1.0f, 2.0f,
242 3.0f, 4.0f,
243 });
244
245 std::vector<float> outputExpected = std::vector<float>(
246 {
247 1.0f, 2.0f,
248 3.0f, 4.0f,
249 });
250
251 const std::string expectedStringOutput =
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000252 "{ \"layerGuid\": 1,"
253 " \"layerName\": \"TestOutput\","
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000254 " \"outputSlot\": 0,"
255 " \"shape\": [2, 2],"
256 " \"min\": 1, \"max\": 4,"
257 " \"data\": [[1, 2], [3, 4]] }\n";
258
259 return DebugTestImpl<T, 2>(workloadFactory,
260 memoryManager,
261 inputTensorInfo,
262 outputTensorInfo,
263 input,
264 outputExpected,
265 desc,
Keith Davis15f9c682022-10-14 15:50:33 +0100266 expectedStringOutput,
267 desc.m_LayerName,
268 toFile);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000269}
270
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000271template <armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100272LayerTestResult<T, 1> Debug1dTest(
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000273 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100274 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
275 bool toFile = false)
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000276{
277 armnn::TensorInfo inputTensorInfo;
278 armnn::TensorInfo outputTensorInfo;
279
280 unsigned int inputShape[] = {4};
281 unsigned int outputShape[] = {4};
282
283 armnn::DebugQueueDescriptor desc;
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000284 desc.m_Guid = 1;
285 desc.m_LayerName = "TestOutput";
286 desc.m_SlotIndex = 0;
Keith Davis15f9c682022-10-14 15:50:33 +0100287 desc.m_LayerOutputToFile = toFile;
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000288
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +0000289 inputTensorInfo = armnn::TensorInfo(1, inputShape, ArmnnType);
290 outputTensorInfo = armnn::TensorInfo(1, outputShape, ArmnnType);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000291
292 std::vector<float> input = std::vector<float>(
293 {
294 1.0f, 2.0f, 3.0f, 4.0f,
295 });
296
297 std::vector<float> outputExpected = std::vector<float>(
298 {
299 1.0f, 2.0f, 3.0f, 4.0f,
300 });
301
302 const std::string expectedStringOutput =
Nattapat Chaimanowong964e9552019-03-26 11:03:26 +0000303 "{ \"layerGuid\": 1,"
304 " \"layerName\": \"TestOutput\","
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000305 " \"outputSlot\": 0,"
306 " \"shape\": [4],"
307 " \"min\": 1, \"max\": 4,"
308 " \"data\": [1, 2, 3, 4] }\n";
309
310 return DebugTestImpl<T, 1>(workloadFactory,
311 memoryManager,
312 inputTensorInfo,
313 outputTensorInfo,
314 input,
315 outputExpected,
316 desc,
Keith Davis15f9c682022-10-14 15:50:33 +0100317 expectedStringOutput,
318 desc.m_LayerName,
319 toFile);
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +0000320}
321
322} // anonymous namespace
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100323
324LayerTestResult<float, 4> Debug4dFloat32Test(
325 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100326 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
327 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100328{
Keith Davis15f9c682022-10-14 15:50:33 +0100329 return Debug4dTest<armnn::DataType::Float32>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100330}
331
332LayerTestResult<float, 3> Debug3dFloat32Test(
333 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100334 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
335 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100336{
Keith Davis15f9c682022-10-14 15:50:33 +0100337 return Debug3dTest<armnn::DataType::Float32>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100338}
339
340LayerTestResult<float, 2> Debug2dFloat32Test(
341 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100342 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
343 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100344{
Keith Davis15f9c682022-10-14 15:50:33 +0100345 return Debug2dTest<armnn::DataType::Float32>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100346}
347
348LayerTestResult<float, 1> Debug1dFloat32Test(
349 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100350 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
351 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100352{
Keith Davis15f9c682022-10-14 15:50:33 +0100353 return Debug1dTest<armnn::DataType::Float32>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100354}
355
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000356LayerTestResult<armnn::BFloat16, 4> Debug4dBFloat16Test(
357 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100358 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
359 bool toFile = false)
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000360{
Keith Davis15f9c682022-10-14 15:50:33 +0100361 return Debug4dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager, toFile);
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000362}
363
364LayerTestResult<armnn::BFloat16, 3> Debug3dBFloat16Test(
365 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100366 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
367 bool toFile = false)
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000368{
Keith Davis15f9c682022-10-14 15:50:33 +0100369 return Debug3dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager, toFile);
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000370}
371
372LayerTestResult<armnn::BFloat16, 2> Debug2dBFloat16Test(
373 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100374 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
375 bool toFile = false)
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000376{
Keith Davis15f9c682022-10-14 15:50:33 +0100377 return Debug2dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager, toFile);
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000378}
379
380LayerTestResult<armnn::BFloat16, 1> Debug1dBFloat16Test(
381 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100382 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
383 bool toFile = false)
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000384{
Keith Davis15f9c682022-10-14 15:50:33 +0100385 return Debug1dTest<armnn::DataType::BFloat16>(workloadFactory, memoryManager, toFile);
Narumol Prangnawarat403a1852020-03-12 14:24:13 +0000386}
387
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100388LayerTestResult<uint8_t, 4> Debug4dUint8Test(
389 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100390 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
391 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100392{
Keith Davis15f9c682022-10-14 15:50:33 +0100393 return Debug4dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100394}
395
396LayerTestResult<uint8_t, 3> Debug3dUint8Test(
397 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100398 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
399 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100400{
Keith Davis15f9c682022-10-14 15:50:33 +0100401 return Debug3dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100402}
403
404LayerTestResult<uint8_t, 2> Debug2dUint8Test(
405 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100406 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
407 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100408{
Keith Davis15f9c682022-10-14 15:50:33 +0100409 return Debug2dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100410}
411
412LayerTestResult<uint8_t, 1> Debug1dUint8Test(
413 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100414 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
415 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100416{
Keith Davis15f9c682022-10-14 15:50:33 +0100417 return Debug1dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100418}
419
420LayerTestResult<int16_t, 4> Debug4dInt16Test(
421 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100422 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
423 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100424{
Keith Davis15f9c682022-10-14 15:50:33 +0100425 return Debug4dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100426}
427
428LayerTestResult<int16_t, 3> Debug3dInt16Test(
429 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100430 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
431 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100432{
Keith Davis15f9c682022-10-14 15:50:33 +0100433 return Debug3dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100434}
435
436LayerTestResult<int16_t, 2> Debug2dInt16Test(
437 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100438 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
439 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100440{
Keith Davis15f9c682022-10-14 15:50:33 +0100441 return Debug2dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100442}
443
444LayerTestResult<int16_t, 1> Debug1dInt16Test(
445 armnn::IWorkloadFactory& workloadFactory,
Keith Davis15f9c682022-10-14 15:50:33 +0100446 const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
447 bool toFile = false)
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100448{
Keith Davis15f9c682022-10-14 15:50:33 +0100449 return Debug1dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, toFile);
Aron Virginas-Tar00d306e2019-08-28 18:08:46 +0100450}