blob: de6bef4c08d185eb5a47a4108e2b2220c258c53c [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//
David Beck9df2d952018-10-10 15:11:44 +01005
6#include <armnn/BackendId.hpp>
7#include <armnn/Types.hpp>
8
Sadik Armagan1625efc2021-06-10 18:24:34 +01009#include <doctest/doctest.h>
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +000010
David Beck9df2d952018-10-10 15:11:44 +010011using namespace armnn;
12
Sadik Armagan1625efc2021-06-10 18:24:34 +010013TEST_SUITE("BackendIdTests")
14{
15TEST_CASE("CreateBackendIdFromCompute")
David Beck9df2d952018-10-10 15:11:44 +010016{
17 BackendId fromCompute{Compute::GpuAcc};
Sadik Armagan1625efc2021-06-10 18:24:34 +010018 CHECK(fromCompute.Get() == GetComputeDeviceAsCString(Compute::GpuAcc));
David Beck9df2d952018-10-10 15:11:44 +010019}
20
Sadik Armagan1625efc2021-06-10 18:24:34 +010021TEST_CASE("CreateBackendIdVectorFromCompute")
David Beck9df2d952018-10-10 15:11:44 +010022{
23 std::vector<BackendId> fromComputes = {Compute::GpuAcc, Compute::CpuRef};
Sadik Armagan1625efc2021-06-10 18:24:34 +010024 CHECK(fromComputes[0].Get() == GetComputeDeviceAsCString(Compute::GpuAcc));
25 CHECK(fromComputes[1].Get() == GetComputeDeviceAsCString(Compute::CpuRef));
David Beck9df2d952018-10-10 15:11:44 +010026}
27
Sadik Armagan1625efc2021-06-10 18:24:34 +010028}