aboutsummaryrefslogtreecommitdiff
path: root/src/backends/test
diff options
context:
space:
mode:
authorDavid Beck <david.beck@arm.com>2018-10-10 15:11:44 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-22 16:57:53 +0100
commit9df2d951616e3d76b67a9852d5324de96633f0f9 (patch)
tree37a57a98ef8aafba748d332bfc686e2b022398d6 /src/backends/test
parent6b779f0e437127bfa71a529e9b848b5e41683ab8 (diff)
downloadarmnn-9df2d951616e3d76b67a9852d5324de96633f0f9.tar.gz
IVGCVSW-1952 : add BackendId class to prepare for the replacement of Compute enum
!armnn:152674 Change-Id: I1bcdfdfbfb73e502d58f35717e2558e24651013c
Diffstat (limited to 'src/backends/test')
-rw-r--r--src/backends/test/BackendIdTests.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/backends/test/BackendIdTests.cpp b/src/backends/test/BackendIdTests.cpp
new file mode 100644
index 0000000000..0ef0a20d7f
--- /dev/null
+++ b/src/backends/test/BackendIdTests.cpp
@@ -0,0 +1,27 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+#include <boost/test/unit_test.hpp>
+
+#include <armnn/BackendId.hpp>
+#include <armnn/Types.hpp>
+
+using namespace armnn;
+
+BOOST_AUTO_TEST_SUITE(BackendIdTests)
+
+BOOST_AUTO_TEST_CASE(CreateBackendIdFromCompute)
+{
+ BackendId fromCompute{Compute::GpuAcc};
+ BOOST_TEST(fromCompute.Get() == GetComputeDeviceAsCString(Compute::GpuAcc));
+}
+
+BOOST_AUTO_TEST_CASE(CreateBackendIdVectorFromCompute)
+{
+ std::vector<BackendId> fromComputes = {Compute::GpuAcc, Compute::CpuRef};
+ BOOST_TEST(fromComputes[0].Get() == GetComputeDeviceAsCString(Compute::GpuAcc));
+ BOOST_TEST(fromComputes[1].Get() == GetComputeDeviceAsCString(Compute::CpuRef));
+}
+
+BOOST_AUTO_TEST_SUITE_END()