ArmNN
 20.02
MemCopyTests.cpp File Reference

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (AclTypeConversions)
 
 BOOST_AUTO_TEST_CASE (CopyBetweenNeonAndGpu)
 
 BOOST_AUTO_TEST_CASE (CopyBetweenGpuAndNeon)
 
 BOOST_AUTO_TEST_CASE (CopyBetweenNeonAndGpuWithSubtensors)
 
 BOOST_AUTO_TEST_CASE (CopyBetweenGpuAndNeonWithSubtensors)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/5]

BOOST_AUTO_TEST_CASE ( AclTypeConversions  )

Definition at line 22 of file MemCopyTests.cpp.

23 {
24  arm_compute::Strides strides(1, 2, 3, 4);
25  armnn::TensorShape convertedStrides = armnn::armcomputetensorutils::GetStrides(strides);
26 
27  BOOST_TEST(convertedStrides[0] == 4);
28  BOOST_TEST(convertedStrides[1] == 3);
29  BOOST_TEST(convertedStrides[2] == 2);
30  BOOST_TEST(convertedStrides[3] == 1);
31 
32  arm_compute::TensorShape shape(5, 6, 7, 8);
33  armnn::TensorShape convertedshape = armnn::armcomputetensorutils::GetShape(shape);
34 
35  BOOST_TEST(convertedshape[0] == 8);
36  BOOST_TEST(convertedshape[1] == 7);
37  BOOST_TEST(convertedshape[2] == 6);
38  BOOST_TEST(convertedshape[3] == 5);
39 }

◆ BOOST_AUTO_TEST_CASE() [2/5]

BOOST_AUTO_TEST_CASE ( CopyBetweenNeonAndGpu  )

Definition at line 47 of file MemCopyTests.cpp.

References CompareTensors(), LayerTestResult< T, n >::output, and LayerTestResult< T, n >::outputExpected.

48 {
50  MemCopyTest<armnn::NeonWorkloadFactory, armnn::ClWorkloadFactory, armnn::DataType::Float32>(false);
51  BOOST_TEST(CompareTensors(result.output, result.outputExpected));
52 }
boost::test_tools::predicate_result CompareTensors(const boost::multi_array< T, n > &a, const boost::multi_array< T, n > &b, bool compareBoolean=false)
boost::multi_array< T, n > outputExpected
boost::multi_array< T, n > output

◆ BOOST_AUTO_TEST_CASE() [3/5]

BOOST_AUTO_TEST_CASE ( CopyBetweenGpuAndNeon  )

Definition at line 54 of file MemCopyTests.cpp.

References CompareTensors(), LayerTestResult< T, n >::output, and LayerTestResult< T, n >::outputExpected.

55 {
57  MemCopyTest<armnn::ClWorkloadFactory, armnn::NeonWorkloadFactory, armnn::DataType::Float32>(false);
58  BOOST_TEST(CompareTensors(result.output, result.outputExpected));
59 }
boost::test_tools::predicate_result CompareTensors(const boost::multi_array< T, n > &a, const boost::multi_array< T, n > &b, bool compareBoolean=false)
boost::multi_array< T, n > outputExpected
boost::multi_array< T, n > output

◆ BOOST_AUTO_TEST_CASE() [4/5]

BOOST_AUTO_TEST_CASE ( CopyBetweenNeonAndGpuWithSubtensors  )

Definition at line 61 of file MemCopyTests.cpp.

References CompareTensors(), LayerTestResult< T, n >::output, and LayerTestResult< T, n >::outputExpected.

62 {
64  MemCopyTest<armnn::NeonWorkloadFactory, armnn::ClWorkloadFactory, armnn::DataType::Float32>(true);
65  BOOST_TEST(CompareTensors(result.output, result.outputExpected));
66 }
boost::test_tools::predicate_result CompareTensors(const boost::multi_array< T, n > &a, const boost::multi_array< T, n > &b, bool compareBoolean=false)
boost::multi_array< T, n > outputExpected
boost::multi_array< T, n > output

◆ BOOST_AUTO_TEST_CASE() [5/5]

BOOST_AUTO_TEST_CASE ( CopyBetweenGpuAndNeonWithSubtensors  )

Definition at line 68 of file MemCopyTests.cpp.

References BOOST_AUTO_TEST_SUITE_END(), CompareTensors(), LayerTestResult< T, n >::output, and LayerTestResult< T, n >::outputExpected.

69 {
71  MemCopyTest<armnn::ClWorkloadFactory, armnn::NeonWorkloadFactory, armnn::DataType::Float32>(true);
72  BOOST_TEST(CompareTensors(result.output, result.outputExpected));
73 }
boost::test_tools::predicate_result CompareTensors(const boost::multi_array< T, n > &a, const boost::multi_array< T, n > &b, bool compareBoolean=false)
boost::multi_array< T, n > outputExpected
boost::multi_array< T, n > output