blob: 0ef0a20d7f4c148df2e0135a787581395a85ed04 [file] [log] [blame]
David Beck9df2d952018-10-10 15:11:44 +01001//
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
10using namespace armnn;
11
12BOOST_AUTO_TEST_SUITE(BackendIdTests)
13
14BOOST_AUTO_TEST_CASE(CreateBackendIdFromCompute)
15{
16 BackendId fromCompute{Compute::GpuAcc};
17 BOOST_TEST(fromCompute.Get() == GetComputeDeviceAsCString(Compute::GpuAcc));
18}
19
20BOOST_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
27BOOST_AUTO_TEST_SUITE_END()