1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5
6 #include "ClWorkloadFactoryHelper.hpp"
7
8 #include <cl/ClWorkloadFactory.hpp>
9 #include <aclCommon/test/MemCopyTestImpl.hpp>
10
11 #include <reference/RefWorkloadFactory.hpp>
12 #include <reference/test/RefWorkloadFactoryHelper.hpp>
13
14 #include <boost/test/unit_test.hpp>
15
16 BOOST_AUTO_TEST_SUITE(ClMemCopy)
17
BOOST_AUTO_TEST_CASE(CopyBetweenCpuAndGpu)18 BOOST_AUTO_TEST_CASE(CopyBetweenCpuAndGpu)
19 {
20 LayerTestResult<float, 4> result =
21 MemCopyTest<armnn::RefWorkloadFactory, armnn::ClWorkloadFactory, armnn::DataType::Float32>(false);
22 BOOST_TEST(CompareTensors(result.output, result.outputExpected));
23 }
24
BOOST_AUTO_TEST_CASE(CopyBetweenGpuAndCpu)25 BOOST_AUTO_TEST_CASE(CopyBetweenGpuAndCpu)
26 {
27 LayerTestResult<float, 4> result =
28 MemCopyTest<armnn::ClWorkloadFactory, armnn::RefWorkloadFactory, armnn::DataType::Float32>(false);
29 BOOST_TEST(CompareTensors(result.output, result.outputExpected));
30 }
31
BOOST_AUTO_TEST_CASE(CopyBetweenCpuAndGpuWithSubtensors)32 BOOST_AUTO_TEST_CASE(CopyBetweenCpuAndGpuWithSubtensors)
33 {
34 LayerTestResult<float, 4> result =
35 MemCopyTest<armnn::RefWorkloadFactory, armnn::ClWorkloadFactory, armnn::DataType::Float32>(true);
36 BOOST_TEST(CompareTensors(result.output, result.outputExpected));
37 }
38
BOOST_AUTO_TEST_CASE(CopyBetweenGpuAndCpuWithSubtensors)39 BOOST_AUTO_TEST_CASE(CopyBetweenGpuAndCpuWithSubtensors)
40 {
41 LayerTestResult<float, 4> result =
42 MemCopyTest<armnn::ClWorkloadFactory, armnn::RefWorkloadFactory, armnn::DataType::Float32>(true);
43 BOOST_TEST(CompareTensors(result.output, result.outputExpected));
44 }
45
46 BOOST_AUTO_TEST_SUITE_END()
47