diff options
Diffstat (limited to 'src/backends/cl/test')
-rw-r--r-- | src/backends/cl/test/ClCreateWorkloadTests.cpp | 28 | ||||
-rw-r--r-- | src/backends/cl/test/ClLayerTests.cpp | 4 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/backends/cl/test/ClCreateWorkloadTests.cpp b/src/backends/cl/test/ClCreateWorkloadTests.cpp index b7522547d4..896d486ebf 100644 --- a/src/backends/cl/test/ClCreateWorkloadTests.cpp +++ b/src/backends/cl/test/ClCreateWorkloadTests.cpp @@ -1035,6 +1035,34 @@ BOOST_AUTO_TEST_CASE(CreateStackUint8Workload) ClCreateStackWorkloadTest<armnn::DataType::QAsymmU8>({ 3, 4, 5 }, { 3, 4, 2, 5 }, 2, 2); } + +template <typename QLstmWorkloadType> +static void ClCreateQLstmWorkloadTest() +{ + Graph graph; + ClWorkloadFactory factory = ClWorkloadFactoryHelper::GetFactory(ClWorkloadFactoryHelper::GetMemoryManager()); + + auto workload = CreateQLstmWorkloadTest<QLstmWorkloadType>(factory, graph); + QLstmQueueDescriptor queueDescriptor = workload->GetData(); + + IAclTensorHandle* inputHandle = PolymorphicDowncast<IAclTensorHandle*>(queueDescriptor.m_Inputs[0]); + BOOST_TEST((inputHandle->GetShape() == TensorShape({2, 4}))); + BOOST_TEST((inputHandle->GetDataType() == arm_compute::DataType::QASYMM8_SIGNED)); + + IAclTensorHandle* cellStateOutHandle = PolymorphicDowncast<IAclTensorHandle*>(queueDescriptor.m_Outputs[1]); + BOOST_TEST((cellStateOutHandle->GetShape() == TensorShape({2, 4}))); + BOOST_TEST((cellStateOutHandle->GetDataType() == arm_compute::DataType::QSYMM16)); + + IAclTensorHandle* outputHandle = PolymorphicDowncast<IAclTensorHandle*>(queueDescriptor.m_Outputs[2]); + BOOST_TEST((outputHandle->GetShape() == TensorShape({2, 4}))); + BOOST_TEST((outputHandle->GetDataType() == arm_compute::DataType::QASYMM8_SIGNED)); +} + +BOOST_AUTO_TEST_CASE(CreateQLstmWorkloadTest) +{ + ClCreateQLstmWorkloadTest<ClQLstmWorkload>(); +} + template <typename QuantizedLstmWorkloadType> static void ClCreateQuantizedLstmWorkloadTest() { diff --git a/src/backends/cl/test/ClLayerTests.cpp b/src/backends/cl/test/ClLayerTests.cpp index ce4496e71b..1c433a85c5 100644 --- a/src/backends/cl/test/ClLayerTests.cpp +++ b/src/backends/cl/test/ClLayerTests.cpp @@ -516,6 +516,10 @@ ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjection, ARMNN_AUTO_TEST_CASE(LstmLayerFloat32NoCifgWithPeepholeWithProjectionWithLayerNorm, LstmLayerFloat32NoCifgWithPeepholeWithProjectionWithLayerNormTest) +// QLstm +ARMNN_AUTO_TEST_CASE(QLstm, QLstmTest) + +// QuantizedLstm ARMNN_AUTO_TEST_CASE(QuantizedLstm, QuantizedLstmTest) // Convert from Float16 to Float32 |