ArmNN
 21.08
MinimumTestImpl.hpp File Reference

Go to the source code of this file.

Functions

LayerTestResult< float, 4 > MinimumBroadcast1ElementTest1 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 4 > MinimumBroadcast1ElementTest2 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< uint8_t, 4 > MinimumBroadcast1DVectorUint8Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< armnn::Half, 4 > MinimumFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< armnn::Half, 4 > MinimumBroadcast1ElementFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< armnn::Half, 4 > MinimumBroadcast1DVectorFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int16_t, 4 > MinimumInt16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int16_t, 4 > MinimumBroadcast1ElementInt16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int16_t, 4 > MinimumBroadcast1DVectorInt16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int32_t, 4 > MinimumInt32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int32_t, 4 > MinimumBroadcast1ElementInt32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int32_t, 4 > MinimumBroadcast1DVectorInt32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 

Function Documentation

◆ MinimumBroadcast1DVectorFloat16Test()

LayerTestResult<armnn::Half, 4> MinimumBroadcast1DVectorFloat16Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 181 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

185 {
186  using namespace half_float::literal;
187  const unsigned int shape0[] = { 1, 2, 2, 3 };
188  const unsigned int shape1[] = { 1, 1, 1, 3 };
189 
190  std::vector<armnn::Half> input0 =
191  {
192  1._h, 2._h, 3._h, 4._h, 5._h, 6._h,
193  7._h, 8._h, 9._h, 10._h, 11._h, 12._h
194  };
195 
196  std::vector<armnn::Half> input1 = { 1._h, 10._h, 3._h };
197 
198  std::vector<armnn::Half> output =
199  {
200  1._h, 2._h, 3._h, 1._h, 5._h, 3._h,
201  1._h, 8._h, 3._h, 1._h, 10._h, 3._h
202  };
203 
204  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float16>(
205  workloadFactory,
206  memoryManager,
207  shape0,
208  input0,
209  shape1,
210  input1,
211  shape0,
212  output,
213  tensorHandleFactory);
214 }

◆ MinimumBroadcast1DVectorInt16Test()

LayerTestResult<int16_t, 4> MinimumBroadcast1DVectorInt16Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 287 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

291 {
292  const unsigned int shape0[] = { 1, 2, 2, 3 };
293  const unsigned int shape1[] = { 1, 1, 1, 3 };
294 
295  std::vector<int16_t> input0 =
296  {
297  1, 2, 3, 4, 5, 6,
298  7, 8, 9, 10, 11, 12
299  };
300 
301  std::vector<int16_t> input1 = { 1, 10, 3 };
302 
303  std::vector<int16_t> output =
304  {
305  1, 2, 3, 1, 5, 3,
306  1, 8, 3, 1, 10, 3
307  };
308 
309  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::QSymmS16>(
310  workloadFactory,
311  memoryManager,
312  shape0,
313  input0,
314  shape1,
315  input1,
316  shape0,
317  output,
318  tensorHandleFactory);
319 }

◆ MinimumBroadcast1DVectorInt32Test()

LayerTestResult<int32_t, 4> MinimumBroadcast1DVectorInt32Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 392 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

396 {
397  const unsigned int shape0[] = { 1, 2, 2, 3 };
398  const unsigned int shape1[] = { 1, 1, 1, 3 };
399 
400  std::vector<int32_t> input0 =
401  {
402  1, 2, 3, 4, 5, 6,
403  7, 8, 9, 10, 11, 12
404  };
405 
406  std::vector<int32_t> input1 = { 1, 10, 3 };
407 
408  std::vector<int32_t> output =
409  {
410  1, 2, 3, 1, 5, 3,
411  1, 8, 3, 1, 10, 3
412  };
413 
414  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Signed32>(
415  workloadFactory,
416  memoryManager,
417  shape0,
418  input0,
419  shape1,
420  input1,
421  shape0,
422  output,
423  tensorHandleFactory);
424 }

◆ MinimumBroadcast1DVectorUint8Test()

LayerTestResult<uint8_t, 4> MinimumBroadcast1DVectorUint8Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 72 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

76 {
77  const unsigned int shape0[] = { 1, 2, 2, 3 };
78  const unsigned int shape1[] = { 1, 1, 1, 3 };
79 
80  std::vector<uint8_t> input0 =
81  {
82  1, 2, 3, 3, 2, 1,
83  7, 1, 2, 3, 4, 5
84  };
85 
86  std::vector<uint8_t> input1 = { 1, 2, 3 };
87 
88  std::vector<uint8_t> output =
89  {
90  1, 2, 3, 1, 2, 1,
91  1, 1, 2, 1, 2, 3
92  };
93 
94  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::QAsymmU8>(
95  workloadFactory,
96  memoryManager,
97  shape0,
98  input0,
99  shape1,
100  input1,
101  shape0,
102  output,
103  tensorHandleFactory);
104 }

◆ MinimumBroadcast1ElementFloat16Test()

LayerTestResult<armnn::Half, 4> MinimumBroadcast1ElementFloat16Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 145 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

149 {
150  using namespace half_float::literal;
151 
152  const unsigned int shape0[] = { 1, 2, 2, 3 };
153  const unsigned int shape1[] = { 1, 1, 1, 1 };
154 
155  std::vector<armnn::Half> input0 =
156  {
157  1._h, 2._h, 3._h, 4._h, 5._h, 6._h,
158  7._h, 8._h, 9._h, 10._h, 11._h, 12._h
159  };
160 
161  std::vector<armnn::Half> input1 = { 2._h };
162 
163  std::vector<armnn::Half> output =
164  {
165  1._h, 2._h, 2._h, 2._h, 2._h, 2._h,
166  2._h, 2._h, 2._h, 2._h, 2._h, 2._h
167  };
168 
169  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float16>(
170  workloadFactory,
171  memoryManager,
172  shape0,
173  input0,
174  shape1,
175  input1,
176  shape0,
177  output,
178  tensorHandleFactory);
179 }

◆ MinimumBroadcast1ElementInt16Test()

LayerTestResult<int16_t, 4> MinimumBroadcast1ElementInt16Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 253 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

257 {
258  const unsigned int shape0[] = { 1, 2, 2, 3 };
259  const unsigned int shape1[] = { 1, 1, 1, 1 };
260 
261  std::vector<int16_t> input0 =
262  {
263  1, 2, 3, 4, 5, 6,
264  7, 8, 9, 10, 11, 12
265  };
266 
267  std::vector<int16_t> input1 = { 2 };
268 
269  std::vector<int16_t> output =
270  {
271  1, 2, 2, 2, 2, 2,
272  2, 2, 2, 2, 2, 2
273  };
274 
275  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::QSymmS16>(
276  workloadFactory,
277  memoryManager,
278  shape0,
279  input0,
280  shape1,
281  input1,
282  shape0,
283  output,
284  tensorHandleFactory);
285 }

◆ MinimumBroadcast1ElementInt32Test()

LayerTestResult<int32_t, 4> MinimumBroadcast1ElementInt32Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 358 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

362 {
363  const unsigned int shape0[] = { 1, 2, 2, 3 };
364  const unsigned int shape1[] = { 1, 1, 1, 1 };
365 
366  std::vector<int32_t> input0 =
367  {
368  1, 2, 3, 4, 5, 6,
369  7, 8, 9, 10, 11, 12
370  };
371 
372  std::vector<int32_t> input1 = { 2 };
373 
374  std::vector<int32_t> output =
375  {
376  1, 2, 2, 2, 2, 2,
377  2, 2, 2, 2, 2, 2
378  };
379 
380  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Signed32>(
381  workloadFactory,
382  memoryManager,
383  shape0,
384  input0,
385  shape1,
386  input1,
387  shape0,
388  output,
389  tensorHandleFactory);
390 }

◆ MinimumBroadcast1ElementTest1()

LayerTestResult<float, 4> MinimumBroadcast1ElementTest1 ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 19 of file MinimumTestImpl.cpp.

References armnn::IgnoreUnused().

Referenced by TEST_SUITE().

23 {
24  IgnoreUnused(memoryManager);
25  unsigned int shape0[] = { 1, 2, 2, 2 };
26  unsigned int shape1[] = { 1, 1, 1, 1 };
27 
28  std::vector<float> input0 = { 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f };
29 
30  std::vector<float> input1 = { 2.f };
31 
32  std::vector<float> output = { 1.f, 2.f, 2.f, 2.f, 2.f, 2.f, 2.f, 2.f };
33 
34  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float32>(
35  workloadFactory,
36  memoryManager,
37  shape0,
38  input0,
39  shape1,
40  input1,
41  shape0,
42  output,
43  tensorHandleFactory);
44 }
void IgnoreUnused(Ts &&...)

◆ MinimumBroadcast1ElementTest2()

LayerTestResult<float, 4> MinimumBroadcast1ElementTest2 ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 46 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

50 {
51  unsigned int shape0[] = { 1, 2, 2, 2 };
52  unsigned int shape1[] = { 1, 1, 1, 1 };
53 
54  std::vector<float> input0 = { 1.f, 6.f, 3.f, 2.f, 8.f, 9.f, 1.f, 10.f };
55 
56  std::vector<float> input1 = { 5.f };
57 
58  std::vector<float> output = { 1.f, 5.f, 3.f, 2.f, 5.f, 5.f, 1.f, 5.f };
59 
60  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float32>(
61  workloadFactory,
62  memoryManager,
63  shape0,
64  input0,
65  shape1,
66  input1,
67  shape0,
68  output,
69  tensorHandleFactory);
70 }

◆ MinimumFloat16Test()

LayerTestResult<armnn::Half , 4> MinimumFloat16Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 106 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

110 {
111  using namespace half_float::literal;
112 
113  unsigned int shape[] = { 2, 2, 2, 2 };
114 
115  std::vector<armnn::Half> input0 =
116  {
117  1._h, 1._h, 1._h, 1._h, 6._h, 6._h, 6._h, 6._h,
118  3._h, 3._h, 3._h, 3._h, 4._h, 4._h, 4._h, 4._h
119  };
120 
121  std::vector<armnn::Half> input1 =
122  {
123  2._h, 2._h, 2._h, 2._h, 3._h, 3._h, 3._h, 3._h,
124  4._h, 4._h, 4._h, 4._h, 5._h, 5._h, 5._h, 5._h
125  };
126 
127  std::vector<armnn::Half> output
128  {
129  1._h, 1._h, 1._h, 1._h, 3._h, 3._h, 3._h, 3._h,
130  3._h, 3._h, 3._h, 3._h, 4._h, 4._h, 4._h, 4._h
131  };
132 
133  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float16>(
134  workloadFactory,
135  memoryManager,
136  shape,
137  input0,
138  shape,
139  input1,
140  shape,
141  output,
142  tensorHandleFactory);
143 }

◆ MinimumInt16Test()

LayerTestResult<int16_t , 4> MinimumInt16Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 216 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

220 {
221  unsigned int shape[] = { 2, 2, 2, 2 };
222 
223  std::vector<int16_t> input0 =
224  {
225  1, 1, 1, 1, 6, 6, 6, 6,
226  3, 3, 3, 3, 4, 4, 4, 4
227  };
228 
229  std::vector<int16_t> input1 =
230  {
231  2, 2, 2, 2, 3, 3, 3, 3,
232  4, 4, 4, 4, 5, 5, 5, 5
233  };
234 
235  std::vector<int16_t> output
236  {
237  1, 1, 1, 1, 3, 3, 3, 3,
238  3, 3, 3, 3, 4, 4, 4, 4
239  };
240 
241  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::QSymmS16>(
242  workloadFactory,
243  memoryManager,
244  shape,
245  input0,
246  shape,
247  input1,
248  shape,
249  output,
250  tensorHandleFactory);
251 }

◆ MinimumInt32Test()

LayerTestResult<int32_t , 4> MinimumInt32Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 321 of file MinimumTestImpl.cpp.

Referenced by TEST_SUITE().

325 {
326  unsigned int shape[] = { 2, 2, 2, 2 };
327 
328  std::vector<int32_t> input0 =
329  {
330  1, 1, 1, 1, 6, 6, 6, 6,
331  3, 3, 3, 3, 4, 4, 4, 4
332  };
333 
334  std::vector<int32_t> input1 =
335  {
336  2, 2, 2, 2, 3, 3, 3, 3,
337  4, 4, 4, 4, 5, 5, 5, 5
338  };
339 
340  std::vector<int32_t> output
341  {
342  1, 1, 1, 1, 3, 3, 3, 3,
343  3, 3, 3, 3, 4, 4, 4, 4
344  };
345 
346  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Signed32>(
347  workloadFactory,
348  memoryManager,
349  shape,
350  input0,
351  shape,
352  input1,
353  shape,
354  output,
355  tensorHandleFactory);
356 }