11 std::unique_ptr<armnn::IWorkload> CreateWorkload<armnn::DivisionQueueDescriptor>(
16 return workloadFactory.CreateDivision(descriptor, info);
24 const unsigned int width = 2u;
25 const unsigned int height = 2u;
26 const unsigned int channelCount = 2u;
27 const unsigned int batchSize = 2u;
29 unsigned int shape[] = { batchSize, channelCount, height, width };
31 std::vector<float> input0 =
33 1.f, 1.f, 1.f, 1.f, 0.f, 0.f, 0.f, 0.f,
34 -1.f, -1.f, -1.f, -1.f, 5.f, 5.f, 5.f, 5.f
37 std::vector<float> input1 =
39 0.f, 0.f, -0.f, -0.f, 0.f, 0.f, -0.f, -0.f,
40 0.f, 0.f, -0.f, -0.f, 5.f, 5.f, 5.f, 5.f
43 std::vector<float> output =
45 INFINITY, INFINITY, -INFINITY, -INFINITY, NAN, NAN, -NAN, -NAN,
46 -INFINITY, -INFINITY, INFINITY, INFINITY, 1, 1, 1, 1
49 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float32>(
64 const unsigned int width = 2u;
65 const unsigned int height = 2u;
66 const unsigned int channelCount = 2u;
67 const unsigned int batchSize = 2u;
69 unsigned int shape[] = { batchSize, channelCount, height, width };
71 std::vector<float> input0 =
73 2.f, 2.f, 2.f, 2.f, 3.f, 3.f, 3.f, 3.f,
74 4.f, 4.f, 4.f, 4.f, 5.f, 5.f, 5.f, 5.f
77 std::vector<float> input1 =
79 1.f, 1.f, 1.f, 1.f, 2.f, 2.f, 2.f, 2.f,
80 4.f, 4.f, 4.f, 4.f, 4.f, 4.f, 4.f, 4.f
83 std::vector<float> output =
85 2.f, 2.f, 2.f, 2.f, 1.50f, 1.50f, 1.50f, 1.50f,
86 1.f, 1.f, 1.f, 1.f, 1.25f, 1.25f, 1.25f, 1.25f
89 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float32>(
104 unsigned int shape0[] = { 1, 2, 2, 2 };
105 unsigned int shape1[] = { 1, 1, 1, 1 };
107 std::vector<float> input0({ 2, 4, 6, 8, 10, 12, 14, 16});
109 std::vector<float> input1({ 2 });
111 std::vector<float> output({ 1, 2, 3, 4, 5, 6, 7, 8});
113 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float32>(
128 unsigned int shape0[] = { 1, 3, 3, 2 };
129 unsigned int shape1[] = { 1, 1, 1, 2 };
131 std::vector<float> input0 =
133 1.f, 4.f, 3.f, 8.f, 5.f, 12.f,
134 7.f, 16.f, 9.f, 20.f, 11.f, 24.f,
135 13.f, 28.f, 15.f, 32.f, 17.f, 36.f
138 std::vector<float> input1 = { 1.f, 2.f };
140 std::vector<float> output =
142 1.f, 2.f, 3.f, 4.f, 5.f, 6.f,
143 7.f, 8.f, 9.f, 10.f, 11.f, 12.f,
144 13.f, 14.f, 15.f, 16.f, 17.f, 18.f
147 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float32>(
162 using namespace half_float::literal;
164 const unsigned int width = 2u;
165 const unsigned int height = 2u;
166 const unsigned int channelCount = 2u;
167 const unsigned int batchSize = 2u;
169 unsigned int shape[] = { batchSize, channelCount, height, width };
171 std::vector<armnn::Half> input0 =
173 2._h, 2._h, 2._h, 2._h, 3._h, 3._h, 3._h, 3._h,
174 4._h, 4._h, 4._h, 4._h, 5._h, 5._h, 5._h, 5._h
177 std::vector<armnn::Half> input1 =
179 1._h, 1._h, 1._h, 1._h, 2._h, 2._h, 2._h, 2._h,
180 4._h, 4._h, 4._h, 4._h, 4._h, 4._h, 4._h, 4._h
183 std::vector<armnn::Half> output =
185 2._h, 2._h, 2._h, 2._h, 1.50_h, 1.50_h, 1.50_h, 1.50_h,
186 1._h, 1._h, 1._h, 1._h, 1.25_h, 1.25_h, 1.25_h, 1.25_h
189 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float16>(
204 using namespace half_float::literal;
206 unsigned int shape0[] = { 1, 2, 2, 2 };
207 unsigned int shape1[] = { 1, 1, 1, 1 };
209 std::vector<armnn::Half> input0({ 2._h, 4._h, 6._h, 8._h, 10._h, 12._h, 14._h, 16._h});
211 std::vector<armnn::Half> input1({ 2._h });
213 std::vector<armnn::Half> output({ 1._h, 2._h, 3._h, 4._h, 5._h, 6._h, 7._h, 8._h});
215 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float16>(
230 using namespace half_float::literal;
232 unsigned int shape0[] = { 1, 3, 3, 2 };
233 unsigned int shape1[] = { 1, 1, 1, 2 };
235 std::vector<armnn::Half> input0 =
237 1._h, 4._h, 3._h, 8._h, 5._h, 12._h,
238 7._h, 16._h, 9._h, 20._h, 11._h, 24._h,
239 13._h, 28._h, 15._h, 32._h, 17._h, 36._h
242 std::vector<armnn::Half> input1 = { 1._h, 2._h };
244 std::vector<armnn::Half> output =
246 1._h, 2._h, 3._h, 4._h, 5._h, 6._h,
247 7._h, 8._h, 9._h, 10._h, 11._h, 12._h,
248 13._h, 14._h, 15._h, 16._h, 17._h, 18._h
251 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float16>(
266 const unsigned int width = 2u;
267 const unsigned int height = 2u;
268 const unsigned int channelCount = 2u;
269 const unsigned int batchSize = 2u;
271 unsigned int shape[] = { batchSize, channelCount, height, width };
273 std::vector<uint8_t> input0 =
275 2, 2, 2, 2, 3, 3, 3, 3,
276 4, 4, 4, 4, 5, 5, 5, 5
279 std::vector<uint8_t> input1 =
281 1, 1, 1, 1, 2, 2, 2, 2,
282 4, 4, 4, 4, 4, 4, 4, 4
285 std::vector<uint8_t> output =
287 8, 8, 8, 8, 6, 6, 6, 6,
288 4, 4, 4, 4, 5, 5, 5, 5
291 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QAsymmU8>(
308 unsigned int shape0[] = { 1, 2, 2, 2 };
309 unsigned int shape1[] = { 1, 1, 1, 1 };
311 std::vector<uint8_t> input0 = { 2, 4, 6, 8, 10, 12, 14, 16};
313 std::vector<uint8_t> input1 = { 2 };
315 std::vector<uint8_t> output = { 1, 2, 3, 4, 5, 6, 7, 8};
317 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QAsymmU8>(
332 unsigned int shape0[] = { 1, 3, 3, 2 };
333 unsigned int shape1[] = { 1, 1, 1, 2 };
335 std::vector<uint8_t> input0 =
338 7, 16, 9, 20, 11, 24,
339 13, 28, 15, 32, 17, 36
342 std::vector<uint8_t> input1 = { 1, 2 };
344 std::vector<uint8_t> output =
348 13, 14, 15, 16, 17, 18
351 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QAsymmU8>(
366 unsigned int shape[] = { 2, 2, 2, 2 };
368 std::vector<int16_t> input0 =
370 2, 2, 2, 2, 3, 3, 3, 3,
371 4, 4, 4, 4, 5, 5, 5, 5
374 std::vector<int16_t> input1 =
376 1, 1, 1, 1, 2, 2, 2, 2,
377 4, 4, 4, 4, 4, 4, 4, 4
380 std::vector<int16_t> output =
382 8, 8, 8, 8, 6, 6, 6, 6,
383 4, 4, 4, 4, 5, 5, 5, 5
386 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QSymmS16>(
403 unsigned int shape0[] = { 1, 2, 2, 2 };
404 unsigned int shape1[] = { 1, 1, 1, 1 };
406 std::vector<int16_t> input0 = { 2, 4, 6, 8, 10, 12, 14, 16};
408 std::vector<int16_t> input1 = { 2 };
410 std::vector<int16_t> output = { 1, 2, 3, 4, 5, 6, 7, 8};
412 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QSymmS16>(
427 unsigned int shape0[] = { 1, 3, 3, 2 };
428 unsigned int shape1[] = { 1, 1, 1, 2 };
430 std::vector<int16_t> input0 =
433 7, 16, 9, 20, 11, 24,
434 13, 28, 15, 32, 17, 36
437 std::vector<int16_t> input1 = { 1, 2 };
439 std::vector<int16_t> output =
443 13, 14, 15, 16, 17, 18
446 return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QSymmS16>(
LayerTestResult< float, 4 > DivisionBroadcast1DVectorTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
LayerTestResult< armnn::Half, 4 > DivisionBroadcast1ElementFloat16Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
LayerTestResult< int16_t, 4 > DivisionInt16Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
void IgnoreUnused(Ts &&...)
LayerTestResult< armnn::Half, 4 > DivisionBroadcast1DVectorFloat16Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
LayerTestResult< int16_t, 4 > DivisionBroadcast1ElementInt16Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
LayerTestResult< uint8_t, 4 > DivisionUint8Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
LayerTestResult< armnn::Half, 4 > DivisionFloat16Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
LayerTestResult< float, 4 > DivisionTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
LayerTestResult< float, 4 > DivisionByZeroTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
Contains information about inputs and outputs to a layer.
LayerTestResult< int16_t, 4 > DivisionBroadcast1DVectorInt16Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
LayerTestResult< uint8_t, 4 > DivisionBroadcast1DVectorUint8Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
LayerTestResult< uint8_t, 4 > DivisionBroadcast1ElementUint8Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
LayerTestResult< float, 4 > DivisionBroadcast1ElementTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)