6 #if defined(ARMCOMPUTECL_ENABLED) 9 #if defined(ARMCOMPUTENEON_ENABLED) 17 #include <doctest/doctest.h> 22 using namespace armnn;
24 #if defined(ARMCOMPUTENEON_ENABLED) && defined(ARMCOMPUTECL_ENABLED) 29 TEST_CASE(
"Neon_Cl_DirectCompatibility_Test")
31 auto neonBackend = std::make_unique<NeonBackend>();
32 auto clBackend = std::make_unique<ClBackend>();
35 neonBackend->RegisterTensorHandleFactories(registry);
36 clBackend->RegisterTensorHandleFactories(registry);
38 const BackendId& neonBackendId = neonBackend->GetId();
39 const BackendId& clBackendId = clBackend->GetId();
42 backends[neonBackendId] = std::move(neonBackend);
43 backends[clBackendId] = std::move(clBackend);
75 std::vector<std::string> errors;
78 CHECK(result.m_Error ==
false);
79 CHECK(result.m_Warning ==
false);
134 #if defined(ARMNNREF_ENABLED) || defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED) 136 std::vector<std::pair<std::string, bool>> capabilityVector)
138 for (
auto pair : capabilityVector)
141 pair.first <<
" capability was not been found");
143 pair.first <<
" capability set incorrectly");
148 #if defined(ARMNNREF_ENABLED) 150 TEST_CASE(
"Ref_Backends_Unknown_Capability_Test")
152 auto refBackend = std::make_unique<RefBackend>();
153 auto refCapabilities = refBackend->GetCapabilities();
172 TEST_CASE (
"Ref_Backends_Capability_Test")
174 auto refBackend = std::make_unique<RefBackend>();
175 auto refCapabilities = refBackend->GetCapabilities();
177 CapabilityTestHelper(refCapabilities,
178 {{
"NonConstWeights",
true},
179 {
"AsyncExecution",
true},
180 {
"ProtectedContentAllocation",
false},
181 {
"ConstantTensorsAsInputs",
true},
182 {
"PreImportIOTensors",
true},
183 {
"ExternallyManagedMemory",
true},
184 {
"MultiAxisPacking",
false}});
189 #if defined(ARMCOMPUTENEON_ENABLED) 191 TEST_CASE (
"Neon_Backends_Capability_Test")
193 auto neonBackend = std::make_unique<NeonBackend>();
194 auto neonCapabilities = neonBackend->GetCapabilities();
196 CapabilityTestHelper(neonCapabilities,
197 {{
"NonConstWeights",
false},
198 {
"AsyncExecution",
false},
199 {
"ProtectedContentAllocation",
false},
200 {
"ConstantTensorsAsInputs",
true},
201 {
"PreImportIOTensors",
false},
202 {
"ExternallyManagedMemory",
true},
203 {
"MultiAxisPacking",
false}});
208 #if defined(ARMCOMPUTECL_ENABLED) 210 TEST_CASE (
"Cl_Backends_Capability_Test")
212 auto clBackend = std::make_unique<ClBackend>();
213 auto clCapabilities = clBackend->GetCapabilities();
215 CapabilityTestHelper(clCapabilities,
216 {{
"NonConstWeights",
false},
217 {
"AsyncExecution",
false},
218 {
"ProtectedContentAllocation",
true},
219 {
"ConstantTensorsAsInputs",
true},
220 {
"PreImportIOTensors",
false},
221 {
"ExternallyManagedMemory",
true},
222 {
"MultiAxisPacking",
false}});
TEST_SUITE("TestConstTensorLayerVisitor")
bool HasCapability(const std::string &name, const BackendCapabilities &capabilities)
Convenience function to check if a capability exists in a BackendCapabilites struct.
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
int Connect(InputSlot &destination)
Copyright (c) 2021 ARM Limited and Contributors.
void SetBackendId(const BackendId &id)
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
A layer user-provided data can be bound to (e.g. inputs, outputs).
void ForEachLayer(Func func) const
This layer represents a softmax operation.
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
Struct for the users to pass backend specific options.
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
OptimizationResult SelectTensorHandleStrategy(Graph &optGraph, BackendsMap &backends, TensorHandleFactoryRegistry ®istry, bool importEnabled, Optional< std::vector< std::string > &> errMessages)
Graph & TopologicalSort()
Sorts layers in topological order and return this.
A SoftmaxDescriptor for the SoftmaxLayer.
void AddCompatibilityLayers(std::map< BackendId, std::unique_ptr< class IBackendInternal >> &backends, TensorHandleFactoryRegistry ®istry)
Modifies the graph in-place, removing edges connecting layers using different compute devices...
std::map< BackendId, std::unique_ptr< class IBackendInternal > > BackendsMap