// // Copyright © 2022 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #include #include #include using namespace armnn; TEST_SUITE("NeonBackendTests") { TEST_CASE("NeonRegisterTensorHandleFactoriesMatchingImportFactoryId") { auto neonBackend = std::make_unique(); TensorHandleFactoryRegistry registry; neonBackend->RegisterTensorHandleFactories(registry); // When calling RegisterTensorHandleFactories, CopyAndImportFactoryPair is registered // Get matching import factory id correctly CHECK((registry.GetMatchingImportFactoryId(NeonTensorHandleFactory::GetIdStatic()) == NeonTensorHandleFactory::GetIdStatic())); } TEST_CASE("NeonCreateWorkloadFactoryMatchingImportFactoryId") { auto neonBackend = std::make_unique(); TensorHandleFactoryRegistry registry; neonBackend->CreateWorkloadFactory(registry); // When calling CreateWorkloadFactory, CopyAndImportFactoryPair is registered // Get matching import factory id correctly CHECK((registry.GetMatchingImportFactoryId(NeonTensorHandleFactory::GetIdStatic()) == NeonTensorHandleFactory::GetIdStatic())); } TEST_CASE("NeonCreateWorkloadFactoryWithOptionsMatchingImportFactoryId") { auto neonBackend = std::make_unique(); TensorHandleFactoryRegistry registry; ModelOptions modelOptions; neonBackend->CreateWorkloadFactory(registry, modelOptions); // When calling CreateWorkloadFactory with ModelOptions, CopyAndImportFactoryPair is registered // Get matching import factory id correctly CHECK((registry.GetMatchingImportFactoryId(NeonTensorHandleFactory::GetIdStatic()) == NeonTensorHandleFactory::GetIdStatic())); } }