ArmNN
 20.05
BackendIdTests.cpp File Reference
#include <armnn/BackendId.hpp>
#include <armnn/Types.hpp>
#include <boost/test/unit_test.hpp>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (CreateBackendIdFromCompute)
 
 BOOST_AUTO_TEST_CASE (CreateBackendIdVectorFromCompute)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( CreateBackendIdFromCompute  )

Definition at line 15 of file BackendIdTests.cpp.

References armnn::GetComputeDeviceAsCString(), and armnn::GpuAcc.

16 {
17  BackendId fromCompute{Compute::GpuAcc};
18  BOOST_TEST(fromCompute.Get() == GetComputeDeviceAsCString(Compute::GpuAcc));
19 }
constexpr char const * GetComputeDeviceAsCString(Compute compute)
Deprecated function that will be removed together with the Compute enum.
Definition: BackendId.hpp:34

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( CreateBackendIdVectorFromCompute  )

Definition at line 21 of file BackendIdTests.cpp.

References BOOST_AUTO_TEST_SUITE_END(), armnn::CpuRef, armnn::GetComputeDeviceAsCString(), and armnn::GpuAcc.

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 }
constexpr char const * GetComputeDeviceAsCString(Compute compute)
Deprecated function that will be removed together with the Compute enum.
Definition: BackendId.hpp:34