| 742 | |
| 743 | template <typename SoftmaxWorkloadType, typename armnn::DataType DataType> |
| 744 | static void ClSoftmaxWorkloadTest() |
| 745 | { |
| 746 | Graph graph; |
| 747 | ClWorkloadFactory factory = |
| 748 | ClWorkloadFactoryHelper::GetFactory(ClWorkloadFactoryHelper::GetMemoryManager()); |
| 749 | |
| 750 | auto workload = CreateSoftmaxWorkloadTest<SoftmaxWorkloadType, DataType>(factory, graph); |
| 751 | |
| 752 | // Checks that inputs/outputs are as we expect them (see definition of ClSoftmaxFloatWorkload). |
| 753 | SoftmaxQueueDescriptor queueDescriptor = workload->GetData(); |
| 754 | auto inputHandle = PolymorphicDowncast<IClTensorHandle*>(queueDescriptor.m_Inputs[0]); |
| 755 | auto outputHandle = PolymorphicDowncast<IClTensorHandle*>(queueDescriptor.m_Outputs[0]); |
| 756 | |
| 757 | armnn::TensorInfo tensorInfo({4, 1}, DataType); |
| 758 | if (DataType == armnn::DataType::QAsymmU8) |
| 759 | { |
| 760 | tensorInfo.SetQuantizationOffset(0); |
| 761 | tensorInfo.SetQuantizationScale(1.f / 256); |
| 762 | } |
| 763 | else if (DataType == armnn::DataType::QAsymmS8) |
| 764 | { |
| 765 | tensorInfo.SetQuantizationOffset(-128); |
| 766 | tensorInfo.SetQuantizationScale(1.f / 256); |
| 767 | } |
| 768 | |
| 769 | auto predResult = CompareIClTensorHandleShape(inputHandle, {4, 1}); |
| 770 | CHECK_MESSAGE(predResult.m_Result, predResult.m_Message.str()); |
| 771 | predResult = CompareIClTensorHandleShape(outputHandle, {4, 1}); |
| 772 | CHECK_MESSAGE(predResult.m_Result, predResult.m_Message.str()); |
| 773 | } |
| 774 | |
| 775 | |
| 776 | TEST_CASE_FIXTURE(ClContextControlFixture, "CreateSoftmaxFloat32WorkloadTest") |
nothing calls this directly
no test coverage detected