xref: /aosp_15_r20/external/armnn/src/backends/backendsCommon/test/layerTests/StridedSliceTestImpl.cpp (revision 89c4ff92f2867872bb9e2354d150bf0c8c502810)
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "StridedSliceTestImpl.hpp"
7 
8 #include <armnnUtils/QuantizeHelper.hpp>
9 #include <ResolveType.hpp>
10 
11 
12 #include <armnnTestUtils/TensorCopyUtils.hpp>
13 #include <armnnTestUtils/WorkloadTestUtils.hpp>
14 
15 #include <armnnTestUtils/TensorHelpers.hpp>
16 
17 namespace
18 {
19 
20 template<typename T, std::size_t InDim, std::size_t OutDim>
StridedSliceTestImpl(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory,armnn::TensorInfo & inputTensorInfo,armnn::TensorInfo & outputTensorInfo,std::vector<float> & inputData,std::vector<float> & outputExpectedData,armnn::StridedSliceQueueDescriptor descriptor,const float qScale=1.0f,const int32_t qOffset=0)21 LayerTestResult<T, OutDim> StridedSliceTestImpl(
22     armnn::IWorkloadFactory& workloadFactory,
23     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
24     const armnn::ITensorHandleFactory& tensorHandleFactory,
25     armnn::TensorInfo& inputTensorInfo,
26     armnn::TensorInfo& outputTensorInfo,
27     std::vector<float>& inputData,
28     std::vector<float>& outputExpectedData,
29     armnn::StridedSliceQueueDescriptor descriptor,
30     const float qScale = 1.0f,
31     const int32_t qOffset = 0)
32 {
33     IgnoreUnused(memoryManager);
34     if(armnn::IsQuantizedType<T>())
35     {
36         inputTensorInfo.SetQuantizationScale(qScale);
37         inputTensorInfo.SetQuantizationOffset(qOffset);
38 
39         outputTensorInfo.SetQuantizationScale(qScale);
40         outputTensorInfo.SetQuantizationOffset(qOffset);
41     }
42 
43     std::vector<T> input = armnnUtils::QuantizedVector<T>(inputData, qScale, qOffset);
44     std::vector<T> expectedOutput = armnnUtils::QuantizedVector<T>(outputExpectedData, qScale, qOffset);
45     std::vector<T> actualOutput(outputTensorInfo.GetNumElements());
46 
47     std::unique_ptr<armnn::ITensorHandle> inputHandle =
48         tensorHandleFactory.CreateTensorHandle(inputTensorInfo);
49 
50     std::unique_ptr<armnn::ITensorHandle> outputHandle =
51         tensorHandleFactory.CreateTensorHandle(outputTensorInfo);
52 
53     armnn::WorkloadInfo info;
54     AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get());
55     AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get());
56 
57     std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateWorkload(armnn::LayerType::StridedSlice,
58                                                                                 descriptor,
59                                                                                 info);
60 
61     inputHandle->Allocate();
62     outputHandle->Allocate();
63 
64     CopyDataToITensorHandle(inputHandle.get(), input.data());
65 
66     ExecuteWorkload(*workload, memoryManager);
67 
68     CopyDataFromITensorHandle(actualOutput.data(), outputHandle.get());
69 
70     return LayerTestResult<T, OutDim>(actualOutput,
71                                       expectedOutput,
72                                       outputHandle->GetShape(),
73                                       outputTensorInfo.GetShape());
74 }
75 
76 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSlice4dTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)77 LayerTestResult<T, 4> StridedSlice4dTest(
78     armnn::IWorkloadFactory& workloadFactory,
79     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
80     const armnn::ITensorHandleFactory& tensorHandleFactory)
81 {
82     armnn::TensorInfo inputTensorInfo;
83     armnn::TensorInfo outputTensorInfo;
84 
85     unsigned int inputShape[]  = {3, 2, 3, 1};
86     unsigned int outputShape[] = {1, 2, 3, 1};
87 
88     armnn::StridedSliceQueueDescriptor desc;
89     desc.m_Parameters.m_Begin  = {1, 0, 0, 0};
90     desc.m_Parameters.m_End    = {2, 2, 3, 1};
91     desc.m_Parameters.m_Stride = {1, 1, 1, 1};
92 
93     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
94     outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType);
95 
96     std::vector<float> input = std::vector<float>(
97     {
98         1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f,
99 
100         3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f,
101 
102         5.0f, 5.0f, 5.0f, 6.0f, 6.0f, 6.0f
103     });
104 
105     std::vector<float> outputExpected = std::vector<float>(
106     {
107         3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f
108     });
109 
110     return StridedSliceTestImpl<T, 4, 4>(
111         workloadFactory, memoryManager, tensorHandleFactory,
112         inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
113 }
114 
115 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSlice4dReverseTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)116 LayerTestResult<T, 4> StridedSlice4dReverseTest(
117     armnn::IWorkloadFactory& workloadFactory,
118     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
119     const armnn::ITensorHandleFactory& tensorHandleFactory)
120 {
121     armnn::TensorInfo inputTensorInfo;
122     armnn::TensorInfo outputTensorInfo;
123 
124     unsigned int inputShape[]  = {3, 2, 3, 1};
125     unsigned int outputShape[] = {1, 2, 3, 1};
126 
127     armnn::StridedSliceQueueDescriptor desc;
128     desc.m_Parameters.m_Begin  = {1, -1, 0, 0};
129     desc.m_Parameters.m_End    = {2, -3, 3, 1};
130     desc.m_Parameters.m_Stride = {1, -1, 1, 1};
131 
132     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
133     outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType);
134 
135     std::vector<float> input = std::vector<float>(
136     {
137         1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f,
138 
139         3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f,
140 
141         5.0f, 5.0f, 5.0f, 6.0f, 6.0f, 6.0f
142     });
143 
144     std::vector<float> outputExpected = std::vector<float>(
145     {
146         4.0f, 4.0f, 4.0f, 3.0f, 3.0f, 3.0f
147     });
148 
149     return StridedSliceTestImpl<T, 4, 4>(
150         workloadFactory, memoryManager, tensorHandleFactory,
151         inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
152 }
153 
154 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceSimpleStrideTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)155 LayerTestResult<T, 4> StridedSliceSimpleStrideTest(
156     armnn::IWorkloadFactory& workloadFactory,
157     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
158     const armnn::ITensorHandleFactory& tensorHandleFactory)
159 {
160     armnn::TensorInfo inputTensorInfo;
161     armnn::TensorInfo outputTensorInfo;
162 
163     unsigned int inputShape[]  = {3, 2, 3, 1};
164     unsigned int outputShape[] = {2, 1, 2, 1};
165 
166     armnn::StridedSliceQueueDescriptor desc;
167     desc.m_Parameters.m_Begin  = {0, 0, 0, 0};
168     desc.m_Parameters.m_End    = {3, 2, 3, 1};
169     desc.m_Parameters.m_Stride = {2, 2, 2, 1};
170 
171     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
172     outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType);
173 
174     std::vector<float> input = std::vector<float>(
175     {
176         1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f,
177 
178         3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f,
179 
180         5.0f, 5.0f, 5.0f, 6.0f, 6.0f, 6.0f
181     });
182 
183     std::vector<float> outputExpected = std::vector<float>(
184     {
185         1.0f, 1.0f,
186 
187         5.0f, 5.0f
188     });
189 
190     return StridedSliceTestImpl<T, 4, 4>(
191         workloadFactory, memoryManager, tensorHandleFactory,
192         inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
193 }
194 
195 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceSimpleRangeMaskTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)196 LayerTestResult<T, 4> StridedSliceSimpleRangeMaskTest(
197     armnn::IWorkloadFactory& workloadFactory,
198     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
199     const armnn::ITensorHandleFactory& tensorHandleFactory)
200 {
201     armnn::TensorInfo inputTensorInfo;
202     armnn::TensorInfo outputTensorInfo;
203 
204     unsigned int inputShape[]  = {3, 2, 3, 1};
205     unsigned int outputShape[] = {3, 2, 3, 1};
206 
207     armnn::StridedSliceQueueDescriptor desc;
208     desc.m_Parameters.m_Begin     = {1, 1, 1, 1};
209     desc.m_Parameters.m_End       = {1, 1, 1, 1};
210     desc.m_Parameters.m_Stride    = {1, 1, 1, 1};
211     desc.m_Parameters.m_BeginMask = (1 << 4) - 1;
212     desc.m_Parameters.m_EndMask   = (1 << 4) - 1;
213 
214     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
215     outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType);
216 
217     std::vector<float> input = std::vector<float>(
218     {
219         1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f,
220 
221         3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f,
222 
223         5.0f, 5.0f, 5.0f, 6.0f, 6.0f, 6.0f
224     });
225 
226     std::vector<float> outputExpected = std::vector<float>(
227     {
228         1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f,
229 
230         3.0f, 3.0f, 3.0f, 4.0f, 4.0f, 4.0f,
231 
232         5.0f, 5.0f, 5.0f, 6.0f, 6.0f, 6.0f
233     });
234 
235     return StridedSliceTestImpl<T, 4, 4>(
236         workloadFactory, memoryManager, tensorHandleFactory,
237         inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
238 }
239 
240 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)241 LayerTestResult<T, 2> StridedSliceShrinkAxisMaskTest(
242     armnn::IWorkloadFactory& workloadFactory,
243     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
244     const armnn::ITensorHandleFactory& tensorHandleFactory)
245 {
246     armnn::TensorInfo inputTensorInfo;
247     armnn::TensorInfo outputTensorInfo;
248 
249     unsigned int inputShape[]  = {3, 2, 3, 1};
250     unsigned int outputShape[] = {3, 1};
251 
252     armnn::StridedSliceQueueDescriptor desc;
253     desc.m_Parameters.m_Begin          = {0, 0, 1, 0};
254     desc.m_Parameters.m_End            = {1, 1, 1, 1};
255     desc.m_Parameters.m_Stride         = {1, 1, 1, 1};
256     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
257     desc.m_Parameters.m_ShrinkAxisMask = (1 << 1) | (1 << 2);
258 
259     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
260     outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
261 
262     std::vector<float> input = std::vector<float>(
263     {
264         1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
265 
266         7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
267 
268         13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
269     });
270 
271     std::vector<float> outputExpected = std::vector<float>(
272     {
273         2.0f, 8.0f, 14.0f
274     });
275 
276     return StridedSliceTestImpl<T, 4, 2>(
277         workloadFactory, memoryManager, tensorHandleFactory,
278         inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
279 }
280 
281 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskBitPosition0Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)282 LayerTestResult<T, 3> StridedSliceShrinkAxisMaskBitPosition0Test(
283         armnn::IWorkloadFactory& workloadFactory,
284         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
285         const armnn::ITensorHandleFactory& tensorHandleFactory)
286 {
287     armnn::TensorInfo inputTensorInfo;
288     armnn::TensorInfo outputTensorInfo;
289 
290     unsigned int inputShape[]  = {3, 2, 3, 1};
291     unsigned int outputShape[] = {2, 3, 1};
292 
293     armnn::StridedSliceQueueDescriptor desc;
294     desc.m_Parameters.m_Begin          = {0, 0, 0, 0};
295     desc.m_Parameters.m_End            = {1, 1, 1, 1};
296     desc.m_Parameters.m_Stride         = {1, 1, 1, 1};
297     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
298     desc.m_Parameters.m_ShrinkAxisMask = (1 << 0);
299 
300     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
301     outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType);
302 
303     std::vector<float> input = std::vector<float>(
304             {
305                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
306 
307                     7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
308 
309                     13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
310             });
311 
312     std::vector<float> outputExpected = std::vector<float>(
313             {
314                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f
315             });
316 
317     return StridedSliceTestImpl<T, 4, 3>(
318             workloadFactory, memoryManager, tensorHandleFactory,
319             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
320 }
321 
322 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskBitPosition1Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)323 LayerTestResult<T, 3> StridedSliceShrinkAxisMaskBitPosition1Test(
324         armnn::IWorkloadFactory& workloadFactory,
325         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
326         const armnn::ITensorHandleFactory& tensorHandleFactory)
327 {
328     armnn::TensorInfo inputTensorInfo;
329     armnn::TensorInfo outputTensorInfo;
330 
331     unsigned int inputShape[]  = {3, 2, 3, 1};
332     unsigned int outputShape[] = {3, 3, 1};
333 
334     armnn::StridedSliceQueueDescriptor desc;
335     desc.m_Parameters.m_Begin          = {0, 0, 0, 0};
336     desc.m_Parameters.m_End            = {1, 1, 1, 1};
337     desc.m_Parameters.m_Stride         = {1, 1, 1, 1};
338     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
339     desc.m_Parameters.m_ShrinkAxisMask = (1 << 1);
340 
341     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
342     outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType);
343 
344     std::vector<float> input = std::vector<float>(
345             {
346                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
347 
348                     7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
349 
350                     13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
351             });
352 
353     std::vector<float> outputExpected = std::vector<float>(
354             {
355                     1.0f, 2.0f, 3.0f, 7.0f, 8.0f, 9.0f, 13.0f, 14.0f, 15.0f
356             });
357 
358     return StridedSliceTestImpl<T, 4, 3>(
359             workloadFactory, memoryManager, tensorHandleFactory,
360             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
361 }
362 
363 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskBitPosition2Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)364 LayerTestResult<T, 3> StridedSliceShrinkAxisMaskBitPosition2Test(
365         armnn::IWorkloadFactory& workloadFactory,
366         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
367         const armnn::ITensorHandleFactory& tensorHandleFactory)
368 {
369     armnn::TensorInfo inputTensorInfo;
370     armnn::TensorInfo outputTensorInfo;
371 
372     unsigned int inputShape[]  = {3, 2, 3, 1};
373     unsigned int outputShape[] = {3, 2, 1};
374 
375     armnn::StridedSliceQueueDescriptor desc;
376     desc.m_Parameters.m_Begin          = {0, 0, 0, 0};
377     desc.m_Parameters.m_End            = {1, 1, 1, 1};
378     desc.m_Parameters.m_Stride         = {1, 1, 1, 1};
379     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
380     desc.m_Parameters.m_ShrinkAxisMask = (1 << 2);
381 
382     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
383     outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType);
384 
385     std::vector<float> input = std::vector<float>(
386             {
387                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
388 
389                     7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
390 
391                     13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
392             });
393 
394     std::vector<float> outputExpected = std::vector<float>(
395             {
396                     1.0f, 4.0f, 7.0f, 10.0f, 13.0f, 16.0f
397             });
398 
399     return StridedSliceTestImpl<T, 4, 3>(
400             workloadFactory, memoryManager, tensorHandleFactory,
401             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
402 }
403 
404 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskBitPosition3Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)405 LayerTestResult<T, 3> StridedSliceShrinkAxisMaskBitPosition3Test(
406         armnn::IWorkloadFactory& workloadFactory,
407         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
408         const armnn::ITensorHandleFactory& tensorHandleFactory)
409 {
410     armnn::TensorInfo inputTensorInfo;
411     armnn::TensorInfo outputTensorInfo;
412 
413     unsigned int inputShape[]  = {3, 2, 3, 1};
414     unsigned int outputShape[] = {3, 2, 3};
415 
416     armnn::StridedSliceQueueDescriptor desc;
417     desc.m_Parameters.m_Begin          = {0, 0, 0, 0};
418     desc.m_Parameters.m_End            = {1, 1, 1, 1};
419     desc.m_Parameters.m_Stride         = {1, 1, 1, 1};
420     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
421     desc.m_Parameters.m_ShrinkAxisMask = (1 << 3);
422 
423     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
424     outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType);
425 
426     std::vector<float> input = std::vector<float>(
427             {
428                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
429 
430                     7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
431 
432                     13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
433             });
434 
435     std::vector<float> outputExpected = std::vector<float>(
436             {
437                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
438 
439                     7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
440 
441                     13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
442             });
443 
444     return StridedSliceTestImpl<T, 4, 3>(
445             workloadFactory, memoryManager, tensorHandleFactory,
446             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
447 }
448 
449 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskBitPosition0And1Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)450 LayerTestResult<T, 2> StridedSliceShrinkAxisMaskBitPosition0And1Test(
451         armnn::IWorkloadFactory& workloadFactory,
452         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
453         const armnn::ITensorHandleFactory& tensorHandleFactory)
454 {
455     armnn::TensorInfo inputTensorInfo;
456     armnn::TensorInfo outputTensorInfo;
457 
458     unsigned int inputShape[]  = {3, 2, 3, 1};
459     unsigned int outputShape[] = {3, 1};
460 
461     armnn::StridedSliceQueueDescriptor desc;
462     desc.m_Parameters.m_Begin          = {0, 0, 0, 0};
463     desc.m_Parameters.m_End            = {1, 1, 1, 1};
464     desc.m_Parameters.m_Stride         = {1, 1, 1, 1};
465     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
466     desc.m_Parameters.m_ShrinkAxisMask = (1 << 0) | (1 << 1);
467 
468     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
469     outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
470 
471     std::vector<float> input = std::vector<float>(
472             {
473                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
474 
475                     7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
476 
477                     13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
478             });
479 
480     std::vector<float> outputExpected = std::vector<float>(
481             {
482                     1.0f, 2.0f, 3.0f
483             });
484 
485     return StridedSliceTestImpl<T, 4, 2>(
486             workloadFactory, memoryManager, tensorHandleFactory,
487             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
488 }
489 
490 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskBitPosition0Dim3Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)491 LayerTestResult<T, 2> StridedSliceShrinkAxisMaskBitPosition0Dim3Test(
492         armnn::IWorkloadFactory& workloadFactory,
493         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
494         const armnn::ITensorHandleFactory& tensorHandleFactory)
495 {
496     armnn::TensorInfo inputTensorInfo;
497     armnn::TensorInfo outputTensorInfo;
498 
499     unsigned int inputShape[]  = {2, 3, 1};
500     unsigned int outputShape[] = {3, 1};
501 
502     armnn::StridedSliceQueueDescriptor desc;
503     desc.m_Parameters.m_Begin          = {0, 0, 0};
504     desc.m_Parameters.m_End            = {0, 0, 0};
505     desc.m_Parameters.m_Stride         = {1, 1, 1};
506     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
507     desc.m_Parameters.m_ShrinkAxisMask = (1 << 0);
508 
509     inputTensorInfo = armnn::TensorInfo(3, inputShape, ArmnnType);
510     outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
511 
512     std::vector<float> input = std::vector<float>(
513             {
514                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f
515             });
516 
517     std::vector<float> outputExpected = std::vector<float>(
518             {
519                     1.0f, 2.0f, 3.0f
520             });
521 
522     return StridedSliceTestImpl<T, 3, 2>(
523             workloadFactory, memoryManager, tensorHandleFactory,
524             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
525 }
526 
FillVector(std::vector<float> & inputArray,float start,float step)527 void FillVector(std::vector<float>& inputArray, float start, float step)
528 {
529     for (uint32_t i = 0; i < inputArray.size(); ++i)
530     {
531         inputArray[i] = start;
532         start += step;
533     }
534 }
535 
536 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskCTSTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)537 LayerTestResult<T, 4> StridedSliceShrinkAxisMaskCTSTest(
538         armnn::IWorkloadFactory& workloadFactory,
539         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
540         const armnn::ITensorHandleFactory& tensorHandleFactory)
541 {
542     armnn::TensorInfo inputTensorInfo;
543     armnn::TensorInfo outputTensorInfo;
544 
545     unsigned int inputShape[]  = {1, 1, 8, 942};
546     unsigned int outputShape[] = {1, 1, 1, 279};
547 
548     armnn::StridedSliceQueueDescriptor desc;
549     desc.m_Parameters.m_Begin          = {0, 0, 1, 229};
550     desc.m_Parameters.m_End            = {1, 1, 2, 787};
551     desc.m_Parameters.m_Stride         = {2, 3, 3, 2};
552     desc.m_Parameters.m_BeginMask      = 2;
553     desc.m_Parameters.m_EndMask        = 0;
554     desc.m_Parameters.m_ShrinkAxisMask = 0;
555 
556     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
557     outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType);
558 
559     // Array from 1 to 7535
560     std::vector<float> input(7536);
561     FillVector(input, 1.0f, 1.0f);
562 
563     // Array from 1171 to 1727 in steps of 2
564     std::vector<float> outputExpected(279);
565     FillVector(outputExpected, 1171.0, 2.0f);
566 
567     return StridedSliceTestImpl<T, 4, 4>(
568             workloadFactory, memoryManager, tensorHandleFactory,
569             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
570 }
571 
572 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskBitPosition0And2Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)573 LayerTestResult<T, 2> StridedSliceShrinkAxisMaskBitPosition0And2Test(
574         armnn::IWorkloadFactory& workloadFactory,
575         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
576         const armnn::ITensorHandleFactory& tensorHandleFactory)
577 {
578     armnn::TensorInfo inputTensorInfo;
579     armnn::TensorInfo outputTensorInfo;
580 
581     unsigned int inputShape[]  = {3, 2, 3, 1};
582     unsigned int outputShape[] = {2, 1};
583 
584     armnn::StridedSliceQueueDescriptor desc;
585     desc.m_Parameters.m_Begin          = {0, 0, 0, 0};
586     desc.m_Parameters.m_End            = {1, 1, 1, 1};
587     desc.m_Parameters.m_Stride         = {1, 1, 1, 1};
588     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
589     desc.m_Parameters.m_ShrinkAxisMask = (1 << 0) | (1 << 2);
590 
591     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
592     outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
593 
594     std::vector<float> input = std::vector<float>(
595             {
596                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
597 
598                     7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
599 
600                     13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
601             });
602 
603     std::vector<float> outputExpected = std::vector<float>(
604             {
605                     1.0f, 4.0f
606             });
607 
608     return StridedSliceTestImpl<T, 4, 2>(
609             workloadFactory, memoryManager, tensorHandleFactory,
610             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
611 }
612 
613 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskBitPosition0And3Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)614 LayerTestResult<T, 2> StridedSliceShrinkAxisMaskBitPosition0And3Test(
615         armnn::IWorkloadFactory& workloadFactory,
616         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
617         const armnn::ITensorHandleFactory& tensorHandleFactory)
618 {
619     armnn::TensorInfo inputTensorInfo;
620     armnn::TensorInfo outputTensorInfo;
621 
622     unsigned int inputShape[]  = {3, 2, 3, 1};
623     unsigned int outputShape[] = {2, 3};
624 
625     armnn::StridedSliceQueueDescriptor desc;
626     desc.m_Parameters.m_Begin          = {0, 0, 0, 0};
627     desc.m_Parameters.m_End            = {1, 1, 1, 1};
628     desc.m_Parameters.m_Stride         = {1, 1, 1, 1};
629     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
630     desc.m_Parameters.m_ShrinkAxisMask = (1 << 0) | (1 << 3);
631 
632     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
633     outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
634 
635     std::vector<float> input = std::vector<float>(
636             {
637                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
638 
639                     7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
640 
641                     13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
642             });
643 
644     std::vector<float> outputExpected = std::vector<float>(
645             {
646                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f
647             });
648 
649     return StridedSliceTestImpl<T, 4, 2>(
650             workloadFactory, memoryManager, tensorHandleFactory,
651             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
652 }
653 
654 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSliceShrinkAxisMaskBitPosition0And1And3Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)655 LayerTestResult<T, 1> StridedSliceShrinkAxisMaskBitPosition0And1And3Test(
656         armnn::IWorkloadFactory& workloadFactory,
657         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
658         const armnn::ITensorHandleFactory& tensorHandleFactory)
659 {
660     armnn::TensorInfo inputTensorInfo;
661     armnn::TensorInfo outputTensorInfo;
662 
663     unsigned int inputShape[]  = {3, 2, 3, 1};
664     unsigned int outputShape[] = {3};
665 
666     armnn::StridedSliceQueueDescriptor desc;
667     desc.m_Parameters.m_Begin          = {0, 0, 0, 0};
668     desc.m_Parameters.m_End            = {1, 1, 1, 1};
669     desc.m_Parameters.m_Stride         = {1, 1, 1, 1};
670     desc.m_Parameters.m_EndMask        = (1 << 4) - 1;
671     desc.m_Parameters.m_ShrinkAxisMask = (1 << 0) | (1 << 1) | (1 << 3);
672 
673     inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
674     outputTensorInfo = armnn::TensorInfo(1, outputShape, ArmnnType);
675 
676     std::vector<float> input = std::vector<float>(
677             {
678                     1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
679 
680                     7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
681 
682                     13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f
683             });
684 
685     std::vector<float> outputExpected = std::vector<float>(
686             {
687                     1.0f, 2.0f, 3.0f
688             });
689 
690     return StridedSliceTestImpl<T, 4, 1>(
691             workloadFactory, memoryManager, tensorHandleFactory,
692             inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
693 }
694 
695 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSlice3dTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)696 LayerTestResult<T, 3> StridedSlice3dTest(
697     armnn::IWorkloadFactory& workloadFactory,
698     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
699     const armnn::ITensorHandleFactory& tensorHandleFactory)
700 {
701     armnn::TensorInfo inputTensorInfo;
702     armnn::TensorInfo outputTensorInfo;
703 
704     unsigned int inputShape[]  = {3, 3, 3};
705     unsigned int outputShape[] = {2, 2, 2};
706 
707     armnn::StridedSliceQueueDescriptor desc;
708     desc.m_Parameters.m_Begin   = {0, 0, 0};
709     desc.m_Parameters.m_End     = {1, 1, 1};
710     desc.m_Parameters.m_Stride  = {2, 2, 2};
711     desc.m_Parameters.m_EndMask = (1 << 3) - 1;
712 
713     inputTensorInfo = armnn::TensorInfo(3, inputShape, ArmnnType);
714     outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType);
715 
716     std::vector<float> input = std::vector<float>(
717     {
718         1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f,
719 
720         10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f,
721 
722         19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f
723     });
724 
725     std::vector<float> outputExpected = std::vector<float>(
726     {
727         1.0f, 3.0f, 7.0f, 9.0f,
728 
729         19.0f, 21.0f, 25.0f, 27.0f
730     });
731 
732     return StridedSliceTestImpl<T, 3, 3>(
733         workloadFactory, memoryManager, tensorHandleFactory,
734         inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
735 }
736 
737 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSlice3dReverseTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)738 LayerTestResult<T, 3> StridedSlice3dReverseTest(
739     armnn::IWorkloadFactory& workloadFactory,
740     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
741     const armnn::ITensorHandleFactory& tensorHandleFactory)
742 {
743     armnn::TensorInfo inputTensorInfo;
744     armnn::TensorInfo outputTensorInfo;
745 
746     unsigned int inputShape[]  = {3, 3, 3};
747     unsigned int outputShape[] = {2, 2, 2};
748 
749     armnn::StridedSliceQueueDescriptor desc;
750     desc.m_Parameters.m_Begin  = {-1, -1, -1};
751     desc.m_Parameters.m_End    = {-4, -4, -4};
752     desc.m_Parameters.m_Stride = {-2, -2, -2};
753 
754     inputTensorInfo = armnn::TensorInfo(3, inputShape, ArmnnType);
755     outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType);
756 
757     std::vector<float> input = std::vector<float>(
758     {
759         1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f,
760 
761         10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f,
762 
763         19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f
764     });
765 
766     std::vector<float> outputExpected = std::vector<float>(
767     {
768         27.0f, 25.0f, 21.0f, 19.0f,
769 
770         9.0f, 7.0f, 3.0f, 1.0f
771     });
772 
773     return StridedSliceTestImpl<T, 3, 3>(
774         workloadFactory, memoryManager, tensorHandleFactory,
775         inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
776 }
777 
778 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSlice2dTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)779 LayerTestResult<T, 2> StridedSlice2dTest(
780     armnn::IWorkloadFactory& workloadFactory,
781     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
782     const armnn::ITensorHandleFactory& tensorHandleFactory)
783 {
784     armnn::TensorInfo inputTensorInfo;
785     armnn::TensorInfo outputTensorInfo;
786 
787     unsigned int inputShape[]  = {3, 3};
788     unsigned int outputShape[] = {2, 2};
789 
790     armnn::StridedSliceQueueDescriptor desc;
791     desc.m_Parameters.m_Begin   = {0, 0};
792     desc.m_Parameters.m_End     = {1, 1};
793     desc.m_Parameters.m_Stride  = {2, 2};
794     desc.m_Parameters.m_EndMask = (1 << 2) - 1;
795 
796     inputTensorInfo = armnn::TensorInfo(2, inputShape, ArmnnType);
797     outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
798 
799     std::vector<float> input = std::vector<float>(
800     {
801         1.0f, 2.0f, 3.0f,
802 
803         4.0f, 5.0f, 6.0f,
804 
805         7.0f, 8.0f, 9.0f
806     });
807 
808     std::vector<float> outputExpected = std::vector<float>(
809     {
810         1.0f, 3.0f,
811 
812         7.0f, 9.0f
813     });
814 
815     return StridedSliceTestImpl<T, 2, 2>(
816         workloadFactory, memoryManager, tensorHandleFactory,
817         inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
818 }
819 
820 template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
StridedSlice2dReverseTest(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)821 LayerTestResult<T, 2> StridedSlice2dReverseTest(
822     armnn::IWorkloadFactory& workloadFactory,
823     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
824     const armnn::ITensorHandleFactory& tensorHandleFactory)
825 {
826     armnn::TensorInfo inputTensorInfo;
827     armnn::TensorInfo outputTensorInfo;
828 
829     unsigned int inputShape[]  = {3, 3};
830     unsigned int outputShape[] = {2, 2};
831 
832     armnn::StridedSliceQueueDescriptor desc;
833     desc.m_Parameters.m_Begin     = {0, 0};
834     desc.m_Parameters.m_End       = {1, 1};
835     desc.m_Parameters.m_Stride    = {-2, -2};
836     desc.m_Parameters.m_BeginMask = (1 << 2) - 1;
837     desc.m_Parameters.m_EndMask   = (1 << 2) - 1;
838 
839     inputTensorInfo = armnn::TensorInfo(2, inputShape, ArmnnType);
840     outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
841 
842     std::vector<float> input = std::vector<float>(
843     {
844         1.0f, 2.0f, 3.0f,
845 
846         4.0f, 5.0f, 6.0f,
847 
848         7.0f, 8.0f, 9.0f
849     });
850 
851     std::vector<float> outputExpected = std::vector<float>(
852     {
853         9.0f, 7.0f,
854 
855         3.0f, 1.0f
856     });
857 
858     return StridedSliceTestImpl<T, 2, 2>(
859         workloadFactory, memoryManager, tensorHandleFactory,
860         inputTensorInfo, outputTensorInfo, input, outputExpected, desc);
861 }
862 
863 } // anonymous namespace
864 
StridedSlice4dFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)865 LayerTestResult<float, 4> StridedSlice4dFloat32Test(
866     armnn::IWorkloadFactory& workloadFactory,
867     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
868     const armnn::ITensorHandleFactory& tensorHandleFactory)
869 {
870     return StridedSlice4dTest<armnn::DataType::Float32>(workloadFactory,
871                                                         memoryManager,
872                                                         tensorHandleFactory);
873 }
874 
StridedSlice4dReverseFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)875 LayerTestResult<float, 4> StridedSlice4dReverseFloat32Test(
876     armnn::IWorkloadFactory& workloadFactory,
877     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
878     const armnn::ITensorHandleFactory& tensorHandleFactory)
879 {
880     return StridedSlice4dReverseTest<armnn::DataType::Float32>(workloadFactory,
881                                                                memoryManager,
882                                                                tensorHandleFactory);
883 }
884 
StridedSliceSimpleStrideFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)885 LayerTestResult<float, 4> StridedSliceSimpleStrideFloat32Test(
886     armnn::IWorkloadFactory& workloadFactory,
887     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
888     const armnn::ITensorHandleFactory& tensorHandleFactory)
889 {
890     return StridedSliceSimpleStrideTest<armnn::DataType::Float32>(workloadFactory,
891                                                                   memoryManager,
892                                                                   tensorHandleFactory);
893 }
894 
StridedSliceSimpleRangeMaskFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)895 LayerTestResult<float, 4> StridedSliceSimpleRangeMaskFloat32Test(
896     armnn::IWorkloadFactory& workloadFactory,
897     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
898     const armnn::ITensorHandleFactory& tensorHandleFactory)
899 {
900     return StridedSliceSimpleRangeMaskTest<armnn::DataType::Float32>(workloadFactory,
901                                                                      memoryManager,
902                                                                      tensorHandleFactory);
903 }
904 
StridedSliceShrinkAxisMaskFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)905 LayerTestResult<float, 2> StridedSliceShrinkAxisMaskFloat32Test(
906     armnn::IWorkloadFactory& workloadFactory,
907     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
908     const armnn::ITensorHandleFactory& tensorHandleFactory)
909 {
910     return StridedSliceShrinkAxisMaskTest<armnn::DataType::Float32>(workloadFactory,
911                                                                     memoryManager,
912                                                                     tensorHandleFactory);
913 }
914 
StridedSliceShrinkAxisMaskCTSFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)915 LayerTestResult<float, 4> StridedSliceShrinkAxisMaskCTSFloat32Test(
916         armnn::IWorkloadFactory& workloadFactory,
917         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
918         const armnn::ITensorHandleFactory& tensorHandleFactory)
919 {
920     return StridedSliceShrinkAxisMaskCTSTest<armnn::DataType::Float32>(workloadFactory,
921                                                                        memoryManager,
922                                                                        tensorHandleFactory);
923 }
924 
StridedSliceShrinkAxisMaskBitPosition0Dim3Float32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)925 LayerTestResult<float, 2> StridedSliceShrinkAxisMaskBitPosition0Dim3Float32Test(
926         armnn::IWorkloadFactory& workloadFactory,
927         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
928         const armnn::ITensorHandleFactory& tensorHandleFactory)
929 {
930     return StridedSliceShrinkAxisMaskBitPosition0Dim3Test<armnn::DataType::Float32>(workloadFactory,
931                                                                                     memoryManager,
932                                                                                     tensorHandleFactory);
933 }
934 
StridedSliceShrinkAxisMaskBitPosition0Float32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)935 LayerTestResult<float, 3> StridedSliceShrinkAxisMaskBitPosition0Float32Test(
936         armnn::IWorkloadFactory& workloadFactory,
937         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
938         const armnn::ITensorHandleFactory& tensorHandleFactory)
939 {
940     return StridedSliceShrinkAxisMaskBitPosition0Test<armnn::DataType::Float32>(workloadFactory,
941                                                                                 memoryManager,
942                                                                                 tensorHandleFactory);
943 }
944 
StridedSliceShrinkAxisMaskBitPosition1Float32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)945 LayerTestResult<float, 3> StridedSliceShrinkAxisMaskBitPosition1Float32Test(
946         armnn::IWorkloadFactory& workloadFactory,
947         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
948         const armnn::ITensorHandleFactory& tensorHandleFactory)
949 {
950     return StridedSliceShrinkAxisMaskBitPosition1Test<armnn::DataType::Float32>(workloadFactory,
951                                                                                 memoryManager,
952                                                                                 tensorHandleFactory);
953 }
954 
StridedSliceShrinkAxisMaskBitPosition2Float32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)955 LayerTestResult<float, 3> StridedSliceShrinkAxisMaskBitPosition2Float32Test(
956         armnn::IWorkloadFactory& workloadFactory,
957         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
958         const armnn::ITensorHandleFactory& tensorHandleFactory)
959 {
960     return StridedSliceShrinkAxisMaskBitPosition2Test<armnn::DataType::Float32>(workloadFactory,
961                                                                                 memoryManager,
962                                                                                 tensorHandleFactory);
963 }
964 
StridedSliceShrinkAxisMaskBitPosition3Float32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)965 LayerTestResult<float, 3> StridedSliceShrinkAxisMaskBitPosition3Float32Test(
966         armnn::IWorkloadFactory& workloadFactory,
967         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
968         const armnn::ITensorHandleFactory& tensorHandleFactory)
969 {
970     return StridedSliceShrinkAxisMaskBitPosition3Test<armnn::DataType::Float32>(workloadFactory,
971                                                                                 memoryManager,
972                                                                                 tensorHandleFactory);
973 }
974 
StridedSliceShrinkAxisMaskBitPosition0And1Float32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)975 LayerTestResult<float, 2> StridedSliceShrinkAxisMaskBitPosition0And1Float32Test(
976         armnn::IWorkloadFactory& workloadFactory,
977         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
978         const armnn::ITensorHandleFactory& tensorHandleFactory)
979 {
980     return StridedSliceShrinkAxisMaskBitPosition0And1Test<armnn::DataType::Float32>(workloadFactory,
981                                                                                     memoryManager,
982                                                                                     tensorHandleFactory);
983 }
984 
StridedSliceShrinkAxisMaskBitPosition0And2Float32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)985 LayerTestResult<float, 2> StridedSliceShrinkAxisMaskBitPosition0And2Float32Test(
986         armnn::IWorkloadFactory& workloadFactory,
987         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
988         const armnn::ITensorHandleFactory& tensorHandleFactory)
989 {
990     return StridedSliceShrinkAxisMaskBitPosition0And2Test<armnn::DataType::Float32>(workloadFactory,
991                                                                                     memoryManager,
992                                                                                     tensorHandleFactory);
993 }
994 
StridedSliceShrinkAxisMaskBitPosition0And3Float32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)995 LayerTestResult<float, 2> StridedSliceShrinkAxisMaskBitPosition0And3Float32Test(
996         armnn::IWorkloadFactory& workloadFactory,
997         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
998         const armnn::ITensorHandleFactory& tensorHandleFactory)
999 {
1000     return StridedSliceShrinkAxisMaskBitPosition0And3Test<armnn::DataType::Float32>(workloadFactory,
1001                                                                                     memoryManager,
1002                                                                                     tensorHandleFactory);
1003 }
1004 
StridedSliceShrinkAxisMaskBitPosition0And1And3Float32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1005 LayerTestResult<float, 1> StridedSliceShrinkAxisMaskBitPosition0And1And3Float32Test(
1006         armnn::IWorkloadFactory& workloadFactory,
1007         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1008         const armnn::ITensorHandleFactory& tensorHandleFactory)
1009 {
1010     return StridedSliceShrinkAxisMaskBitPosition0And1And3Test<armnn::DataType::Float32>(workloadFactory,
1011                                                                                         memoryManager,
1012                                                                                         tensorHandleFactory);
1013 }
1014 
StridedSlice3dFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1015 LayerTestResult<float, 3> StridedSlice3dFloat32Test(
1016     armnn::IWorkloadFactory& workloadFactory,
1017     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1018     const armnn::ITensorHandleFactory& tensorHandleFactory)
1019 {
1020     return StridedSlice3dTest<armnn::DataType::Float32>(workloadFactory,
1021                                                         memoryManager,
1022                                                         tensorHandleFactory);
1023 }
1024 
StridedSlice3dReverseFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1025 LayerTestResult<float, 3> StridedSlice3dReverseFloat32Test(
1026     armnn::IWorkloadFactory& workloadFactory,
1027     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1028     const armnn::ITensorHandleFactory& tensorHandleFactory)
1029 {
1030     return StridedSlice3dReverseTest<armnn::DataType::Float32>(workloadFactory,
1031                                                                memoryManager,
1032                                                                tensorHandleFactory);
1033 }
1034 
StridedSlice2dFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1035 LayerTestResult<float, 2> StridedSlice2dFloat32Test(
1036     armnn::IWorkloadFactory& workloadFactory,
1037     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1038     const armnn::ITensorHandleFactory& tensorHandleFactory)
1039 {
1040     return StridedSlice2dTest<armnn::DataType::Float32>(workloadFactory,
1041                                                         memoryManager,
1042                                                         tensorHandleFactory);
1043 }
1044 
StridedSlice2dReverseFloat32Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1045 LayerTestResult<float, 2> StridedSlice2dReverseFloat32Test(
1046     armnn::IWorkloadFactory& workloadFactory,
1047     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1048     const armnn::ITensorHandleFactory& tensorHandleFactory)
1049 {
1050     return StridedSlice2dReverseTest<armnn::DataType::Float32>(workloadFactory,
1051                                                                memoryManager,
1052                                                                tensorHandleFactory);
1053 }
1054 
StridedSlice4dUint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1055 LayerTestResult<uint8_t, 4> StridedSlice4dUint8Test(
1056     armnn::IWorkloadFactory& workloadFactory,
1057     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1058     const armnn::ITensorHandleFactory& tensorHandleFactory)
1059 {
1060     return StridedSlice4dTest<armnn::DataType::QAsymmU8>(workloadFactory,
1061                                                          memoryManager,
1062                                                          tensorHandleFactory);
1063 }
1064 
StridedSlice4dReverseUint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1065 LayerTestResult<uint8_t, 4> StridedSlice4dReverseUint8Test(
1066     armnn::IWorkloadFactory& workloadFactory,
1067     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1068     const armnn::ITensorHandleFactory& tensorHandleFactory)
1069 {
1070     return StridedSlice4dReverseTest<armnn::DataType::QAsymmU8>(workloadFactory,
1071                                                                 memoryManager,
1072                                                                 tensorHandleFactory);
1073 }
1074 
StridedSliceSimpleStrideUint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1075 LayerTestResult<uint8_t, 4> StridedSliceSimpleStrideUint8Test(
1076     armnn::IWorkloadFactory& workloadFactory,
1077     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1078     const armnn::ITensorHandleFactory& tensorHandleFactory)
1079 {
1080     return StridedSliceSimpleStrideTest<armnn::DataType::QAsymmU8>(workloadFactory,
1081                                                                    memoryManager,
1082                                                                    tensorHandleFactory);
1083 }
1084 
StridedSliceSimpleRangeMaskUint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1085 LayerTestResult<uint8_t, 4> StridedSliceSimpleRangeMaskUint8Test(
1086     armnn::IWorkloadFactory& workloadFactory,
1087     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1088     const armnn::ITensorHandleFactory& tensorHandleFactory)
1089 {
1090     return StridedSliceSimpleRangeMaskTest<armnn::DataType::QAsymmU8>(workloadFactory,
1091                                                                       memoryManager,
1092                                                                       tensorHandleFactory);
1093 }
1094 
StridedSliceShrinkAxisMaskUint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1095 LayerTestResult<uint8_t, 2> StridedSliceShrinkAxisMaskUint8Test(
1096     armnn::IWorkloadFactory& workloadFactory,
1097     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1098     const armnn::ITensorHandleFactory& tensorHandleFactory)
1099 {
1100     return StridedSliceShrinkAxisMaskTest<armnn::DataType::QAsymmU8>(workloadFactory,
1101                                                                      memoryManager,
1102                                                                      tensorHandleFactory);
1103 }
1104 
StridedSliceShrinkAxisMaskBitPosition0Dim3Uint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1105 LayerTestResult<uint8_t, 2> StridedSliceShrinkAxisMaskBitPosition0Dim3Uint8Test(
1106         armnn::IWorkloadFactory& workloadFactory,
1107         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1108         const armnn::ITensorHandleFactory& tensorHandleFactory)
1109 {
1110     return StridedSliceShrinkAxisMaskBitPosition0Dim3Test<armnn::DataType::QAsymmU8>(workloadFactory,
1111                                                                                      memoryManager,
1112                                                                                      tensorHandleFactory);
1113 }
1114 
StridedSliceShrinkAxisMaskBitPosition0Uint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1115 LayerTestResult<uint8_t, 3> StridedSliceShrinkAxisMaskBitPosition0Uint8Test(
1116         armnn::IWorkloadFactory& workloadFactory,
1117         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1118         const armnn::ITensorHandleFactory& tensorHandleFactory)
1119 {
1120     return StridedSliceShrinkAxisMaskBitPosition0Test<armnn::DataType::QAsymmU8>(workloadFactory,
1121                                                                                  memoryManager,
1122                                                                                  tensorHandleFactory);
1123 }
1124 
StridedSliceShrinkAxisMaskBitPosition1Uint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1125 LayerTestResult<uint8_t, 3> StridedSliceShrinkAxisMaskBitPosition1Uint8Test(
1126         armnn::IWorkloadFactory& workloadFactory,
1127         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1128         const armnn::ITensorHandleFactory& tensorHandleFactory)
1129 {
1130     return StridedSliceShrinkAxisMaskBitPosition1Test<armnn::DataType::QAsymmU8>(workloadFactory,
1131                                                                                  memoryManager,
1132                                                                                  tensorHandleFactory);
1133 }
1134 
StridedSliceShrinkAxisMaskBitPosition2Uint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1135 LayerTestResult<uint8_t, 3> StridedSliceShrinkAxisMaskBitPosition2Uint8Test(
1136         armnn::IWorkloadFactory& workloadFactory,
1137         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1138         const armnn::ITensorHandleFactory& tensorHandleFactory)
1139 {
1140     return StridedSliceShrinkAxisMaskBitPosition2Test<armnn::DataType::QAsymmU8>(workloadFactory,
1141                                                                                  memoryManager,
1142                                                                                  tensorHandleFactory);
1143 }
1144 
StridedSliceShrinkAxisMaskBitPosition3Uint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1145 LayerTestResult<uint8_t, 3> StridedSliceShrinkAxisMaskBitPosition3Uint8Test(
1146         armnn::IWorkloadFactory& workloadFactory,
1147         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1148         const armnn::ITensorHandleFactory& tensorHandleFactory)
1149 {
1150     return StridedSliceShrinkAxisMaskBitPosition3Test<armnn::DataType::QAsymmU8>(workloadFactory,
1151                                                                                  memoryManager,
1152                                                                                  tensorHandleFactory);
1153 }
1154 
StridedSliceShrinkAxisMaskBitPosition0And1Uint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1155 LayerTestResult<uint8_t, 2> StridedSliceShrinkAxisMaskBitPosition0And1Uint8Test(
1156         armnn::IWorkloadFactory& workloadFactory,
1157         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1158         const armnn::ITensorHandleFactory& tensorHandleFactory)
1159 {
1160     return StridedSliceShrinkAxisMaskBitPosition0And1Test<armnn::DataType::QAsymmU8>(workloadFactory,
1161                                                                                      memoryManager,
1162                                                                                      tensorHandleFactory);
1163 }
1164 
StridedSliceShrinkAxisMaskBitPosition0And2Uint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1165 LayerTestResult<uint8_t, 2> StridedSliceShrinkAxisMaskBitPosition0And2Uint8Test(
1166         armnn::IWorkloadFactory& workloadFactory,
1167         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1168         const armnn::ITensorHandleFactory& tensorHandleFactory)
1169 {
1170     return StridedSliceShrinkAxisMaskBitPosition0And2Test<armnn::DataType::QAsymmU8>(workloadFactory,
1171                                                                                      memoryManager,
1172                                                                                      tensorHandleFactory);
1173 }
1174 
StridedSliceShrinkAxisMaskBitPosition0And3Uint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1175 LayerTestResult<uint8_t, 2> StridedSliceShrinkAxisMaskBitPosition0And3Uint8Test(
1176         armnn::IWorkloadFactory& workloadFactory,
1177         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1178         const armnn::ITensorHandleFactory& tensorHandleFactory)
1179 {
1180     return StridedSliceShrinkAxisMaskBitPosition0And3Test<armnn::DataType::QAsymmU8>(workloadFactory,
1181                                                                                      memoryManager,
1182                                                                                      tensorHandleFactory);
1183 }
1184 
StridedSliceShrinkAxisMaskBitPosition0And1And3Uint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1185 LayerTestResult<uint8_t, 1> StridedSliceShrinkAxisMaskBitPosition0And1And3Uint8Test(
1186         armnn::IWorkloadFactory& workloadFactory,
1187         const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1188         const armnn::ITensorHandleFactory& tensorHandleFactory)
1189 {
1190     return StridedSliceShrinkAxisMaskBitPosition0And1And3Test<armnn::DataType::QAsymmU8>(workloadFactory,
1191                                                                                          memoryManager,
1192                                                                                          tensorHandleFactory);
1193 }
1194 
StridedSlice3dUint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1195 LayerTestResult<uint8_t, 3> StridedSlice3dUint8Test(
1196     armnn::IWorkloadFactory& workloadFactory,
1197     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1198     const armnn::ITensorHandleFactory& tensorHandleFactory)
1199 {
1200     return StridedSlice3dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, tensorHandleFactory);
1201 }
1202 
StridedSlice3dReverseUint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1203 LayerTestResult<uint8_t, 3> StridedSlice3dReverseUint8Test(
1204     armnn::IWorkloadFactory& workloadFactory,
1205     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1206     const armnn::ITensorHandleFactory& tensorHandleFactory)
1207 {
1208     return StridedSlice3dReverseTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, tensorHandleFactory);
1209 }
1210 
StridedSlice2dUint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1211 LayerTestResult<uint8_t, 2> StridedSlice2dUint8Test(
1212     armnn::IWorkloadFactory& workloadFactory,
1213     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1214     const armnn::ITensorHandleFactory& tensorHandleFactory)
1215 {
1216     return StridedSlice2dTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, tensorHandleFactory);
1217 }
1218 
StridedSlice2dReverseUint8Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1219 LayerTestResult<uint8_t, 2> StridedSlice2dReverseUint8Test(
1220     armnn::IWorkloadFactory& workloadFactory,
1221     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1222     const armnn::ITensorHandleFactory& tensorHandleFactory)
1223 {
1224     return StridedSlice2dReverseTest<armnn::DataType::QAsymmU8>(workloadFactory, memoryManager, tensorHandleFactory);
1225 }
1226 
StridedSlice4dInt16Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1227 LayerTestResult<int16_t, 4> StridedSlice4dInt16Test(
1228     armnn::IWorkloadFactory& workloadFactory,
1229     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1230     const armnn::ITensorHandleFactory& tensorHandleFactory)
1231 {
1232     return StridedSlice4dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, tensorHandleFactory);
1233 }
1234 
StridedSlice4dReverseInt16Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1235 LayerTestResult<int16_t, 4> StridedSlice4dReverseInt16Test(
1236     armnn::IWorkloadFactory& workloadFactory,
1237     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1238     const armnn::ITensorHandleFactory& tensorHandleFactory)
1239 {
1240     return StridedSlice4dReverseTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, tensorHandleFactory);
1241 }
1242 
StridedSliceSimpleStrideInt16Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1243 LayerTestResult<int16_t, 4> StridedSliceSimpleStrideInt16Test(
1244     armnn::IWorkloadFactory& workloadFactory,
1245     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1246     const armnn::ITensorHandleFactory& tensorHandleFactory)
1247 {
1248     return StridedSliceSimpleStrideTest<armnn::DataType::QSymmS16>(workloadFactory,
1249                                                                    memoryManager,
1250                                                                    tensorHandleFactory);
1251 }
1252 
StridedSliceSimpleRangeMaskInt16Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1253 LayerTestResult<int16_t, 4> StridedSliceSimpleRangeMaskInt16Test(
1254     armnn::IWorkloadFactory& workloadFactory,
1255     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1256     const armnn::ITensorHandleFactory& tensorHandleFactory)
1257 {
1258     return StridedSliceSimpleRangeMaskTest<armnn::DataType::QSymmS16>(workloadFactory,
1259                                                                       memoryManager,
1260                                                                       tensorHandleFactory);
1261 }
1262 
StridedSliceShrinkAxisMaskInt16Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1263 LayerTestResult<int16_t, 2> StridedSliceShrinkAxisMaskInt16Test(
1264     armnn::IWorkloadFactory& workloadFactory,
1265     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1266     const armnn::ITensorHandleFactory& tensorHandleFactory)
1267 {
1268     return StridedSliceShrinkAxisMaskTest<armnn::DataType::QSymmS16>(workloadFactory,
1269                                                                      memoryManager,
1270                                                                      tensorHandleFactory);
1271 }
1272 
StridedSlice3dInt16Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1273 LayerTestResult<int16_t, 3> StridedSlice3dInt16Test(
1274     armnn::IWorkloadFactory& workloadFactory,
1275     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1276     const armnn::ITensorHandleFactory& tensorHandleFactory)
1277 {
1278     return StridedSlice3dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, tensorHandleFactory);
1279 }
1280 
StridedSlice3dReverseInt16Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1281 LayerTestResult<int16_t, 3> StridedSlice3dReverseInt16Test(
1282     armnn::IWorkloadFactory& workloadFactory,
1283     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1284     const armnn::ITensorHandleFactory& tensorHandleFactory)
1285 {
1286     return StridedSlice3dReverseTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, tensorHandleFactory);
1287 }
1288 
StridedSlice2dInt16Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1289 LayerTestResult<int16_t, 2> StridedSlice2dInt16Test(
1290     armnn::IWorkloadFactory& workloadFactory,
1291     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1292     const armnn::ITensorHandleFactory& tensorHandleFactory)
1293 {
1294     return StridedSlice2dTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, tensorHandleFactory);
1295 }
1296 
StridedSlice2dReverseInt16Test(armnn::IWorkloadFactory & workloadFactory,const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager,const armnn::ITensorHandleFactory & tensorHandleFactory)1297 LayerTestResult<int16_t, 2> StridedSlice2dReverseInt16Test(
1298     armnn::IWorkloadFactory& workloadFactory,
1299     const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
1300     const armnn::ITensorHandleFactory& tensorHandleFactory)
1301 {
1302     return StridedSlice2dReverseTest<armnn::DataType::QSymmS16>(workloadFactory, memoryManager, tensorHandleFactory);
1303 }
1304