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);
135 #if defined(ARMNNREF_ENABLED) || defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED) 137 std::vector<std::pair<std::string, bool>> capabilityVector)
139 for (
auto pair : capabilityVector)
142 pair.first <<
" capability was not been found");
144 pair.first <<
" capability set incorrectly");
149 #if defined(ARMNNREF_ENABLED) 151 TEST_CASE(
"Ref_Backends_Unknown_Capability_Test")
153 auto refBackend = std::make_unique<RefBackend>();
154 auto refCapabilities = refBackend->GetCapabilities();
173 TEST_CASE (
"Ref_Backends_Capability_Test")
175 auto refBackend = std::make_unique<RefBackend>();
176 auto refCapabilities = refBackend->GetCapabilities();
178 CapabilityTestHelper(refCapabilities,
179 {{
"NonConstWeights",
true},
180 {
"AsyncExecution",
true},
181 {
"ProtectedContentAllocation",
false},
182 {
"ConstantTensorsAsInputs",
true},
183 {
"PreImportIOTensors",
true},
184 {
"ExternallyManagedMemory",
true},
185 {
"MultiAxisPacking",
false}});
190 #if defined(ARMCOMPUTENEON_ENABLED) 192 TEST_CASE (
"Neon_Backends_Capability_Test")
194 auto neonBackend = std::make_unique<NeonBackend>();
195 auto neonCapabilities = neonBackend->GetCapabilities();
197 CapabilityTestHelper(neonCapabilities,
198 {{
"NonConstWeights",
false},
199 {
"AsyncExecution",
false},
200 {
"ProtectedContentAllocation",
false},
201 {
"ConstantTensorsAsInputs",
false},
202 {
"PreImportIOTensors",
false},
203 {
"ExternallyManagedMemory",
true},
204 {
"MultiAxisPacking",
false}});
209 #if defined(ARMCOMPUTECL_ENABLED) 211 TEST_CASE (
"Cl_Backends_Capability_Test")
213 auto clBackend = std::make_unique<ClBackend>();
214 auto clCapabilities = clBackend->GetCapabilities();
216 CapabilityTestHelper(clCapabilities,
217 {{
"NonConstWeights",
false},
218 {
"AsyncExecution",
false},
219 {
"ProtectedContentAllocation",
true},
220 {
"ConstantTensorsAsInputs",
false},
221 {
"PreImportIOTensors",
false},
222 {
"ExternallyManagedMemory",
true},
223 {
"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