12 #include <boost/test/unit_test.hpp> 20 SwapRegistryStorage() :
armnn::BackendRegistry()
25 ~SwapRegistryStorage()
31 FactoryStorage m_TempStorage;
40 using namespace armnn;
43 SwapRegistryStorage helper;
51 using namespace armnn;
52 SwapRegistryStorage helper;
67 BOOST_TEST(called ==
false);
72 BOOST_TEST(called ==
false);
75 BOOST_TEST(called ==
true);
81 using namespace armnn;
82 SwapRegistryStorage helper;
95 BOOST_TEST(called ==
false);
100 BOOST_TEST(called ==
false);
103 BOOST_TEST(called ==
true);
116 using namespace armnn;
118 const BackendId mockBackendId(
"MockDynamicBackend");
120 const std::string exceptionMessage(
"Neon support not found on device, could not register CpuAcc Backend.\n");
130 ARMNN_LOG(
info) <<
"Neon support not found on device, could not register CpuAcc Backend.";
140 auto backend = factoryFunc();
145 BOOST_CHECK_EQUAL(e.
what(), exceptionMessage);
146 BOOST_TEST_MESSAGE(
"ThrowBackendUnavailableExceptionImpl: BackendUnavailableException caught.");
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
FactoryFunction GetFactory(const BackendId &id) const
void Register(const BackendId &id, FactoryFunction factory)
static void Swap(BackendRegistry &instance, FactoryStorage &other)
For testing only.
virtual const char * what() const noexcept override
#define ARMNN_LOG(severity)
BackendRegistry & BackendRegistryInstance()
Copyright (c) 2021 ARM Limited and Contributors.
BOOST_AUTO_TEST_CASE(SwapRegistry)
BOOST_AUTO_TEST_SUITE_END()
void Deregister(const BackendId &id)
std::unique_ptr< IBackendInternal > IBackendInternalUniquePtr
Class for non-fatal exceptions raised while initialising a backend.