ArmNN  NotReleased
ClRuntimeTests.cpp File Reference
#include <test/RuntimeTests.hpp>
#include <LeakChecking.hpp>
#include <backendsCommon/test/RuntimeTestImpl.hpp>
#include <test/ProfilingTestUtils.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/test/unit_test.hpp>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (RuntimeValidateGpuDeviceSupportLayerNoFallback)
 
 BOOST_AUTO_TEST_CASE (ProfilingPostOptimisationStructureGpuAcc)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( RuntimeValidateGpuDeviceSupportLayerNoFallback  )

Definition at line 22 of file ClRuntimeTests.cpp.

References ARMNN_BYTES_LEAKED_IN_SCOPE, ARMNN_LEAK_CHECKER_IS_ACTIVE, ARMNN_NO_LEAKS_IN_SCOPE, ARMNN_OBJECTS_LEAKED_IN_SCOPE, ARMNN_SCOPED_LEAK_CHECKER, BOOST_CHECK(), IOutputSlot::Connect(), INetwork::Create(), IRuntime::Create(), armnn::Float32, Runtime::GetDeviceSpec(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), armnn::GpuAcc, Runtime::LoadNetwork(), armnn::Optimize(), options, armnn::RuntimeLoadedNetworksReserve(), IOutputSlot::SetTensorInfo(), armnn::Success, and Runtime::UnloadNetwork().

23 {
24  // build up the structure of the network
26 
27  armnn::IConnectableLayer* input = net->AddInputLayer(0);
28  armnn::IConnectableLayer* output = net->AddOutputLayer(0);
29 
30  input->GetOutputSlot(0).Connect(output->GetInputSlot(0));
32 
35 
36  std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc };
37  armnn::IOptimizedNetworkPtr optNet = armnn::Optimize(*net, backends, runtime->GetDeviceSpec());
38  BOOST_CHECK(optNet);
39 
40  // Load it into the runtime. It should success.
41  armnn::NetworkId netId;
42  BOOST_TEST(runtime->LoadNetwork(netId, std::move(optNet)) == armnn::Status::Success);
43 }
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
IOptimizedNetworkPtr Optimize(const INetwork &network, const std::vector< BackendId > &backendPreferences, const IDeviceSpec &deviceSpec, const OptimizerOptions &options=OptimizerOptions(), Optional< std::vector< std::string > &> messages=EmptyOptional())
Definition: Network.cpp:807
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
static INetworkPtr Create()
Definition: Network.cpp:48
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
GPU Execution: OpenCL: ArmCompute.
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
Definition: INetwork.hpp:85
static IRuntimePtr Create(const CreationOptions &options)
Definition: Runtime.cpp:32
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:61
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
Definition: INetwork.hpp:544
virtual int Connect(IInputSlot &destination)=0
armnn::Runtime::CreationOptions::ExternalProfilingOptions options
int NetworkId
Definition: IRuntime.hpp:19
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
Definition: IRuntime.hpp:24
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( ProfilingPostOptimisationStructureGpuAcc  )

Definition at line 152 of file ClRuntimeTests.cpp.

References BOOST_AUTO_TEST_SUITE_END(), armnn::GpuAcc, and VerifyPostOptimisationStructureTestImpl().

153 {
155 }
void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId)
GPU Execution: OpenCL: ArmCompute.