David Beck | 9df2d95 | 2018-10-10 15:11:44 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #include <boost/test/unit_test.hpp> |
| 6 | |
| 7 | #include <armnn/BackendId.hpp> |
| 8 | #include <armnn/Types.hpp> |
| 9 | |
| 10 | using namespace armnn; |
| 11 | |
| 12 | BOOST_AUTO_TEST_SUITE(BackendIdTests) |
| 13 | |
| 14 | BOOST_AUTO_TEST_CASE(CreateBackendIdFromCompute) |
| 15 | { |
| 16 | BackendId fromCompute{Compute::GpuAcc}; |
| 17 | BOOST_TEST(fromCompute.Get() == GetComputeDeviceAsCString(Compute::GpuAcc)); |
| 18 | } |
| 19 | |
| 20 | BOOST_AUTO_TEST_CASE(CreateBackendIdVectorFromCompute) |
| 21 | { |
| 22 | std::vector<BackendId> fromComputes = {Compute::GpuAcc, Compute::CpuRef}; |
| 23 | BOOST_TEST(fromComputes[0].Get() == GetComputeDeviceAsCString(Compute::GpuAcc)); |
| 24 | BOOST_TEST(fromComputes[1].Get() == GetComputeDeviceAsCString(Compute::CpuRef)); |
| 25 | } |
| 26 | |
| 27 | BOOST_AUTO_TEST_SUITE_END() |