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 | // |
David Beck | 9df2d95 | 2018-10-10 15:11:44 +0100 | [diff] [blame] | 5 | |
| 6 | #include <armnn/BackendId.hpp> |
| 7 | #include <armnn/Types.hpp> |
| 8 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 9 | #include <boost/test/unit_test.hpp> |
| 10 | |
David Beck | 9df2d95 | 2018-10-10 15:11:44 +0100 | [diff] [blame] | 11 | using namespace armnn; |
| 12 | |
| 13 | BOOST_AUTO_TEST_SUITE(BackendIdTests) |
| 14 | |
| 15 | BOOST_AUTO_TEST_CASE(CreateBackendIdFromCompute) |
| 16 | { |
| 17 | BackendId fromCompute{Compute::GpuAcc}; |
| 18 | BOOST_TEST(fromCompute.Get() == GetComputeDeviceAsCString(Compute::GpuAcc)); |
| 19 | } |
| 20 | |
| 21 | BOOST_AUTO_TEST_CASE(CreateBackendIdVectorFromCompute) |
| 22 | { |
| 23 | std::vector<BackendId> fromComputes = {Compute::GpuAcc, Compute::CpuRef}; |
| 24 | BOOST_TEST(fromComputes[0].Get() == GetComputeDeviceAsCString(Compute::GpuAcc)); |
| 25 | BOOST_TEST(fromComputes[1].Get() == GetComputeDeviceAsCString(Compute::CpuRef)); |
| 26 | } |
| 27 | |
| 28 | BOOST_AUTO_TEST_SUITE_END() |