ArmNN
 20.05
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)
 
LayerTestResult< float, 4 > MinimumBroadcast1ElementTest2 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
LayerTestResult< uint8_t, 4 > MinimumBroadcast1DVectorUint8Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
LayerTestResult< armnn::Half, 4 > MinimumFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
LayerTestResult< armnn::Half, 4 > MinimumBroadcast1ElementFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
LayerTestResult< armnn::Half, 4 > MinimumBroadcast1DVectorFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
LayerTestResult< int16_t, 4 > MinimumInt16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
LayerTestResult< int16_t, 4 > MinimumBroadcast1ElementInt16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
LayerTestResult< int16_t, 4 > MinimumBroadcast1DVectorInt16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 

Function Documentation

◆ MinimumBroadcast1DVectorFloat16Test()

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

Definition at line 171 of file MinimumTestImpl.cpp.

174 {
175  using namespace half_float::literal;
176 
177  const unsigned int shape0[] = { 1, 2, 2, 3 };
178  const unsigned int shape1[] = { 1, 1, 1, 3 };
179 
180  std::vector<armnn::Half> input0 =
181  {
182  1._h, 2._h, 3._h, 4._h, 5._h, 6._h,
183  7._h, 8._h, 9._h, 10._h, 11._h, 12._h
184  };
185 
186  std::vector<armnn::Half> input1 = { 1._h, 10._h, 3._h };
187 
188  std::vector<armnn::Half> output =
189  {
190  1._h, 2._h, 3._h, 1._h, 5._h, 3._h,
191  1._h, 8._h, 3._h, 1._h, 10._h, 3._h
192  };
193 
194  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float16>(
195  workloadFactory,
196  memoryManager,
197  shape0,
198  input0,
199  shape1,
200  input1,
201  shape0,
202  output);
203 }

◆ MinimumBroadcast1DVectorInt16Test()

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

Definition at line 272 of file MinimumTestImpl.cpp.

275 {
276  const unsigned int shape0[] = { 1, 2, 2, 3 };
277  const unsigned int shape1[] = { 1, 1, 1, 3 };
278 
279  std::vector<int16_t> input0 =
280  {
281  1, 2, 3, 4, 5, 6,
282  7, 8, 9, 10, 11, 12
283  };
284 
285  std::vector<int16_t> input1 = { 1, 10, 3 };
286 
287  std::vector<int16_t> output =
288  {
289  1, 2, 3, 1, 5, 3,
290  1, 8, 3, 1, 10, 3
291  };
292 
293  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::QSymmS16>(
294  workloadFactory,
295  memoryManager,
296  shape0,
297  input0,
298  shape1,
299  input1,
300  shape0,
301  output);
302 }

◆ MinimumBroadcast1DVectorUint8Test()

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

Definition at line 68 of file MinimumTestImpl.cpp.

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

◆ MinimumBroadcast1ElementFloat16Test()

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

Definition at line 137 of file MinimumTestImpl.cpp.

140 {
141  using namespace half_float::literal;
142 
143  const unsigned int shape0[] = { 1, 2, 2, 3 };
144  const unsigned int shape1[] = { 1, 1, 1, 1 };
145 
146  std::vector<armnn::Half> input0 =
147  {
148  1._h, 2._h, 3._h, 4._h, 5._h, 6._h,
149  7._h, 8._h, 9._h, 10._h, 11._h, 12._h
150  };
151 
152  std::vector<armnn::Half> input1 = { 2._h };
153 
154  std::vector<armnn::Half> output =
155  {
156  1._h, 2._h, 2._h, 2._h, 2._h, 2._h,
157  2._h, 2._h, 2._h, 2._h, 2._h, 2._h
158  };
159 
160  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float16>(
161  workloadFactory,
162  memoryManager,
163  shape0,
164  input0,
165  shape1,
166  input1,
167  shape0,
168  output);
169 }

◆ MinimumBroadcast1ElementInt16Test()

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

Definition at line 240 of file MinimumTestImpl.cpp.

243 {
244  const unsigned int shape0[] = { 1, 2, 2, 3 };
245  const unsigned int shape1[] = { 1, 1, 1, 1 };
246 
247  std::vector<int16_t> input0 =
248  {
249  1, 2, 3, 4, 5, 6,
250  7, 8, 9, 10, 11, 12
251  };
252 
253  std::vector<int16_t> input1 = { 2 };
254 
255  std::vector<int16_t> output =
256  {
257  1, 2, 2, 2, 2, 2,
258  2, 2, 2, 2, 2, 2
259  };
260 
261  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::QSymmS16>(
262  workloadFactory,
263  memoryManager,
264  shape0,
265  input0,
266  shape1,
267  input1,
268  shape0,
269  output);
270 }

◆ MinimumBroadcast1ElementTest1()

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

Definition at line 19 of file MinimumTestImpl.cpp.

References armnn::IgnoreUnused().

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

◆ MinimumBroadcast1ElementTest2()

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

Definition at line 44 of file MinimumTestImpl.cpp.

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

◆ MinimumFloat16Test()

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

Definition at line 100 of file MinimumTestImpl.cpp.

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

◆ MinimumInt16Test()

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

Definition at line 205 of file MinimumTestImpl.cpp.

208 {
209  unsigned int shape[] = { 2, 2, 2, 2 };
210 
211  std::vector<int16_t> input0 =
212  {
213  1, 1, 1, 1, 6, 6, 6, 6,
214  3, 3, 3, 3, 4, 4, 4, 4
215  };
216 
217  std::vector<int16_t> input1 =
218  {
219  2, 2, 2, 2, 3, 3, 3, 3,
220  4, 4, 4, 4, 5, 5, 5, 5
221  };
222 
223  std::vector<int16_t> output
224  {
225  1, 1, 1, 1, 3, 3, 3, 3,
226  3, 3, 3, 3, 4, 4, 4, 4
227  };
228 
229  return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::QSymmS16>(
230  workloadFactory,
231  memoryManager,
232  shape,
233  input0,
234  shape,
235  input1,
236  shape,
237  output);
238 }