2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "TestDynamicBackend.hpp"
8 #include <backendsCommon/IBackendInternal.hpp>
10 constexpr const char* TestDynamicBackendId()
12 #if defined(VALID_TEST_DYNAMIC_BACKEND)
14 return "ValidTestDynamicBackend";
18 return "InvalidTestDynamicBackend";
23 class TestDynamicBackend : public armnn::IBackendInternal
27 : m_BackendId(TestDynamicBackendId())
30 const armnn::BackendId& GetId() const override
34 IWorkloadFactoryPtr CreateWorkloadFactory(const IMemoryManagerSharedPtr& memoryManager) const override
36 return IWorkloadFactoryPtr{};
38 ILayerSupportSharedPtr GetLayerSupport() const override
40 return ILayerSupportSharedPtr{};
44 armnn::BackendId m_BackendId;
47 const char* GetBackendId()
49 #if defined(INVALID_TEST_DYNAMIC_BACKEND_5)
51 // Return an invalid backend id
56 // Return a valid backend id
57 return TestDynamicBackendId();
62 void GetVersion(uint32_t* outMajor, uint32_t* outMinor)
64 if (!outMajor || !outMinor)
69 #if defined(INVALID_TEST_DYNAMIC_BACKEND_7)
82 void* BackendFactory()
84 #if defined(INVALID_TEST_DYNAMIC_BACKEND_6)
86 // Return an invalid backend instance
91 // Return a non-null backend instance
92 return new TestDynamicBackend();