ArmNN
 22.05
BackendIdTests.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include <armnn/BackendId.hpp>
7 #include <armnn/Types.hpp>
8 
9 #include <doctest/doctest.h>
10 
11 using namespace armnn;
12 
13 TEST_SUITE("BackendIdTests")
14 {
15 TEST_CASE("CreateBackendIdFromCompute")
16 {
17  BackendId fromCompute{Compute::GpuAcc};
18  CHECK(fromCompute.Get() == GetComputeDeviceAsCString(Compute::GpuAcc));
19 }
20 
21 TEST_CASE("CreateBackendIdVectorFromCompute")
22 {
23  std::vector<BackendId> fromComputes = {Compute::GpuAcc, Compute::CpuRef};
24  CHECK(fromComputes[0].Get() == GetComputeDeviceAsCString(Compute::GpuAcc));
25  CHECK(fromComputes[1].Get() == GetComputeDeviceAsCString(Compute::CpuRef));
26 }
27 
28 }
TEST_SUITE("TestConstTensorLayerVisitor")
CPU Execution: Reference C++ kernels.
Copyright (c) 2021 ARM Limited and Contributors.
constexpr char const * GetComputeDeviceAsCString(Compute compute)
Deprecated function that will be removed together with the Compute enum.
Definition: BackendId.hpp:34
GPU Execution: OpenCL: ArmCompute.