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