aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Runtime.cpp
AgeCommit message (Collapse)Author
2022-02-25IVGCVSW-6801 Remove the call to sync after EnqueueWorkload if we didn't importv22.02branches/armnn_22_02David Monahan
Signed-off-by: David Monahan <David.Monahan@arm.com> Change-Id: I0c79518fb0d849809d972241ce02653259d4f8c4
2022-02-06IVGCVSW-6747 Call Cl sync after EnqueueWorkloadNarumol Prangnawarat
* Add AfterEnqueueWorkload to IBackendContext * Implement AfterEnqueueWorkload in ClBackendContext to call Cl sync * Set allocated data on outputhandler only once * Handle PreImportedHandles and CurImportedId the same way as Async Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I9f59d57e298d4a494569faec3078d66af799f77b
2022-01-31IVGCVSW-6552 Add support of aligned host memoryNarumol Prangnawarat
* Add AllocatedData functions to OutputHandler * Enable import aligned memory in ImportInputs * Enable import aligned memory in ImportOutputs * Allow to import input and output if the memory is aligned * Implement Reconfigure function on ClConvolution2dWorkload * End-to-end test on Ref and Cl to ensure that input and output memory are imported when aligned Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I9e5e4c26d1ac2f1d806803ade5f64c6479c51718
2022-01-27IVGCVSW-6739 'Issues on Logging API'Sadik Armagan
* Enabled using same instance of SimpleLogger * Removed some trailing new lines on some log messages Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I4b917c0ca5011afc9b39dad50715290ba15a1246
2021-12-08Add addition timing logging outputJan Eilers
* Adds ExecuteNetwork when building the delegate only * Adds timings to delegate subgraph creation * Adds executions times Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Ieff2f67ea8dbb6c2a708f8810e84a20485b7a631
2021-11-08IVGCVSW-6420: Constant flag in tensor info is not set correctlyCathal Corbett
!android-nn-driver:6532 !armnn-internal-tests:372451 * Made fix to 2 out of 3 ConstTensor() constructors in Tensor.hpp to throw InvalidArgumentException when TensorInfo isConstant parameter is false. * Added new ConstTensor() constructor in Tensor.cpp to accept vector<>.data() using template<typename MemoryType>. * Fixed runtime->GetOutputTensorInfo()/GetInputTensorInfo() methods and called submethods to return TensorInfo& rather than TensorInfo. * Fixed all failing unit tests for CpuRef/CpuAcc/GpuAcc to ensure any ConstTensor created has it's TensorInfo isConstant set to true. * Added unit tests in TensorTest.cpp to ensure ConstTensor constructors throw InvalidArgumentException when TensorInfo isConstat parameter is false. * Added unit test to ensure an empty ConstTensor constructor will set TensorInfo isConatant to true. * Indentation fixes. * Fix to arm_tensor.i to add isConstant parameter to TensorInfo constructor. Added methods IsConstant() and SetConstant(). * Fix to const_tensor.py to throw ValueError when TensorInfo isConstant is set to false when constructing a ConstTensor. * Fixed PyArmnn unit tests to set TensorInfo isConstant to True when ConstTensor is used. * Added unit tests in test_const_tensor.py to ensure ConstTensor constructors throw ValueError when TensorInfo isConstat parameter is false. Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I44e440dd0422c366d31bbdbc77ad2b4db0bde148
2021-10-26IVGCVSW-6470 Create MemoryStrategyBenchmarkJim Flynn
* Refactor the strategy library to be more generic * Shorten the names of the current strategies * Change validatorStrat to throw exceptions Change-Id: I0d9c9ef609b2d8675e5788610d1accac6767c660 Signed-off-by: Finn Williams <finwil01@e127804.cambridge.arm.com> Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2021-10-15Refactor: Profiler moved to GraphDerek Lamberti
* This is to enable later work to instrument the Optimizer. Signed-off-by: Derek Lamberti <derek.lamberti@arm.com> Change-Id: I2cf1fe022e0d100d6d8705adfbb8cab3ffc96a86
2021-10-08IVGCVSW-6313 Support pre-importing outputsFinn Williams
* Add ClearImportedInputs/Outputs function to IRuntime * Add UnImport function to ITensorHandle * Remove mutex from IWorkingMemHandle Change-Id: I34c9b6e1618755e10f3b4597afa1d9a9ea97e5fe Signed-off-by: Finn Williams <finwil01@e127804.cambridge.arm.com>
2021-10-06IVGCVSW-6300 'IMemoryOptimizerStrategy Add strategy library and add support ↵Sadik Armagan
in BackendRegistry' * Updated IRuntime interface for providing custom memory optimizer strategy. * Enabled selecting existing memory optimizer strategy by using BackendOptions * Added MemoryOptimizerStrategyLibrary that sets one of the existing memory optimizer strategies selected by user Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I037f8ac8efa79c0f71bd63e379101e3ad92d80c9
2021-09-15IVGCVSW-6312 Support pre-importing inputsFinn Williams
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Ifc5e6f2e36767cb2a5cbf281d40ec9989b581abc
2021-08-17IVGCVSW-6317 Cleaning up BackendRegistry following negative tests.Colm Donelan
* Deregister backends in BackendHintTest. * Deregister backend in ThrowBackendUnavailableException * Clean up dynamic backends when an exception is thrown from RuntimeImpl::RuntimeImpl. * Use CHECK_THROWS_AS_MESSAGE syntax in ClCustomAllocatorTests. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I0e6e5413dd074b5fcfc9515c85cb8d40a4a0b73c
2021-08-12IVGCVSW-6077 Add Custom Allocator testsFrancis Murtagh
* Add test for invalid backend and nullptr * Small refactor * Throw exception on nullptr allocator instead of assert Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I94ce4f61d7cb3123831f1acd98165ae14c40033a
2021-08-11IVGCVSW-6087 Add an Assertion check to make sure we aren't given null allocatorsDavid Monahan
Add conditional compilation check to Cl specific header Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: Ib196b8ef4dc5fcfd1d1ccd3f29abf8e0ecd020cb
2021-08-10Adds CustomAllocator interface and Sample AppJan Eilers
* Updates the runtime options with a CustomAllocatorMap which allows to define a CustomAllocator for specific backends * Change IBackendInternal interface to use a shared pointer to a custom allocator * Update ClBackend.hpp/cpp to use the CustomAllocator * Adds an example application and unit test which uses a CustomAllocator for GpuAcc * Refactor of the interface to use MemorySource instead of the user Mapping cl_mem directly * Modify the BackendRegistry to also hold a registry of CustomAllocators * BackendRegistry Deregister will also deregister any allocators associated with that backend id * set_global_allocator within the BaseMemoryManager so that it always matches the currently used allocator Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I156d819686021865f4375e6cb7a5c5dec8fee9e8 Signed-off-by: David Monahan <david.monahan@arm.com>
2021-07-22IVGCVSW-6073 Add protected mode to ArmNN CreationOptionsJan Eilers
* Adds logic to the Runtime to activate protected mode * Adds ProtectedContentAllocation backend capability to ClBackend It's not fully activated yet because the CustomAllocator is missing. Will print an error message and won't register the backend but won't fail. * Extends IBackendInternal with an UseCustomAllocator function. * Adds related unit tests Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I64f465c5800eb104aa90db1bbf772a4148b5072f
2021-06-23IVGCVSW-6062 Rework the async threadpoolFinn Williams
!android-nn-driver:5802 * Extract the threadpool from LoadedNetwork/Runtime * Refactor the threadpool to be handle multiple networks * Trim IAsyncExecutionCallback and add an InferenceId to AsyncExecutionCallback * Add AsyncCallbackManager class Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I36aa2ad29c16bc10ee0706adfeb6b27f60012afb
2021-06-16IVGCVSW-5835 Move the src/profiling/LabelsAndEventClasses class to ↵Nikhil Raj
profiling/common Signed-off-by: Nikhil Raj <nikhil.raj@arm.com> Change-Id: I83de0fe9c83ec7e698817095ce5cfe3319c36ea6
2021-05-06IVGCVSW-5813 Add Async Queue to IRuntimeKeith Davis
Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: Icc0d131c8ee2e9748e2f14762a75962b39c10f9d
2021-04-29IVGCVSW-5819 5820 5821 Add MemorySourceFlags to ↵Francis Murtagh
TensorHandleFactoryRegistry::GetFactory * Modify Layer::CreateTensorHandles to include MemorySource * Modify INetworkProperties to add MemorySource * Disable Neon/Cl fallback tests until full import implementation complete Change-Id: Ia4fff6ea3d4bf6afca33aae358125ccaec7f9a38 Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
2021-04-08IVGCVSW-5823 Refactor Async Network APIMike Kelly
* Moved IAsyncNetwork into IRuntime. * All LoadedNetworks can be executed Asynchronously. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Ibbc901ab9110dc2f881425b75489bccf9ad54169
2021-03-30IVGCVSW-5799 'Create Pimpl Idiom for Async prototype'Sadik Armagan
* Implemented Pimpl Idiom for IAsyncNetwork Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: Ic7311880563568b014a27f6347f8d41f2ad96df6
2021-03-29IVGCVSW-5790 Merge async prototypeMike Kelly
* Added thread safe execution mechanism for armnn * Removed duplicate function bool Compare(T a, T b, float tolerance) * Added StridedSliceAsyncEndToEndTest * Fixed memory leak Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I2d367fc77ee7c01b8953138543e76af5e691211f
2021-02-15IVGCVSW-4873 Implement Pimpl Idiom for INetwork and IOptimizedNetworkFrancis Murtagh
!android-nn-driver:5042 Signed-off-by: Kevin May <kevin.may@arm.com> Change-Id: Ia1ce8b839e81b46428ba0f78463e085e5906958d Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Signed-off-by: Finn Williams <Finn.Williams@arm.com>
2021-02-08IVGCVSW-4873 Implement Pimpl Idiom for IRuntimeKevin May
Signed-off-by: Kevin May <kevin.may@arm.com> Change-Id: I52448938735b2aa678c47e0f3061c87fa0c693b1
2020-07-23IVGCVSW-5118 Fix incorrect scoped profilingNarumol Prangnawarat
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I58c78c1dffaa9804d4ac79366e2d7af1c6c2133b
2020-07-14IVGCVSW-5101 Add a SOL/EOL and a process ID label to NetworkJim Flynn
Change-Id: I6261f46404a3aab5c069bca40586994d31d26fe8 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2020-06-25Minor improvement of inference profilingDerek Lamberti
* Start inference profiling at the actual beginning * Add profiling events for EnqueueInputs and EnqueueOutputs * Add profiling event for working memory allocation * Refactor Execute body to remove code duplication * forward arguments to constructors rather than copy Change-Id: Iacab85f0a02e88e2423885f86f97e4dba4037319 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
2020-06-17IVGCVSW-4900 Update Timeline Directory Message with new fieldsJim Flynn
Change-Id: I68097e176f7471a18498492b50339e68004dddd5 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2020-06-03remove BOM from filesLaurent Carlier
Change-Id: Ia4b4bb3be0ed6e933c77d58f8e9879b1370e9537 Signed-off-by: Laurent Carlier <laurent.carlier@arm.com>
2020-05-22Adding more performance metricsalered01
* Implemented CLTuning flow for ExecuteNetwork tests * Added --tuning-path to specify tuning file to use/create * Added --tuning-level to specify tuning level to use as well as enable extra tuning run to generate the tuning file * Fixed issue where TuningLevel was being parsed incorrectly * Added measurements for initialization, network parsing, network optimization, tuning, and shutdown * Added flag to control number of iterations inference is run for Signed-off-by: alered01 <Alex.Redshaw@arm.com> Change-Id: Ic739ff26e136e32aff9f0995217c1c3207008ca4
2020-05-19IVGCVSW-4834 Add calls to increment REGISTERED_BACKENDS and ↵Finn Williams
UNREGISTERED_BACKENDS Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I3600dd15f97ccd4ab745deb87d06ba978e2a0b11
2020-04-10IVGCVSW-4666 Call EnableProfiling when state switches to activeFinn Williams
* Move the call to EnableProfiling() into ConnectionAcknowledgedHandler * Fix an issue with MockGatord forcing some command handlers to be quiet * Add some small unrelated improvements and typo fixes to the periodic counter command handlers Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I9e6066b78d1f782cfaf27c11571c0ec5cb5d126f
2020-04-10IVGCVSW-4483 Remove boost::polymorphic_downcastJan Eilers
* exchange boost::polymorphic_downcast with armnn::PolymorphicDowncast * remove unnecessary includes of boost::polymorphic_downcast Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Ie603fb82860fe05fee547dc78073230cc62b2e1f
2020-04-06IVGCVSW-4485 Remove Boost assertNarumol Prangnawarat
* Change boost assert to armnn assert * Change include file to armnn assert * Fix ARMNN_ASSERT_MSG issue with multiple conditions * Change BOOST_ASSERT to BOOST_TEST where appropriate * Remove unused include statements Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I5d0fa3a37b7c1c921216de68f0073aa34702c9ff
2020-04-02IVGCVSW-4455 Add an Activate and Deactivate control packet to the protocolKeith Davis
* Add Activate/Deactivate command handlers * Add IReportStructure, INotifyBackends single function interfaces * Add overrided mechanism to report structure in Runtime.cpp * Add overrided mechanism to notify backends in ProfilingService.cpp * Add optional IReportStructure argument to ProfilingService constructor for use in ActivateTimelineReportingCommandHandler * Refactoring and tidying up indentation * Removal of unused code in ProfilingUtils.cpp and ProfilingService.cpp * Added GatordMock end to end test * Fixed an issue with SendCounterPacket sending duplicate packets * Fixed an issue with DirectoryCaptureCommandHandler handling of Optional Signed-off-by: Keith Davis <keith.davis@arm.com> Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I5ef1b74171459bfc649861dedf99921d22c9e63f
2020-03-18IVGCVSW-4463 Change ProfilingService to a member of runtime from a singletonSadik Armagan
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: I345c39a10a4693a500aa1687d9a5cee76da791c3
2020-03-03Modifying the IBackendProfilingContext interface to return a bool onDavid Monahan
EnableProfiling and adding error checking to the Runtime Invocation Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: I65b8bb16c6f1c7d668de31238ce0408a48974997
2020-02-07IVGCVSW-4317 Implement the Profiling Context InitialisationColm Donelan
* Call CreateBackendProfilingContext on each backend from Runtime passing an instance of the BackendProfiling interface. * Modify the signature of CreateBackendProfilingContext to remove const and return a shared_ptr to BackendProfilingContext * Add concrete BackendProfiling class. * Store BackendProfilingContexts in Profiling service. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I975eaa2093ae91fa623835f65f9e5b25eb65117a
2020-02-04Github #273 Handle failure to initialise BackendContext in RuntimeMatthew Bentham
Define CreateBackendContext to throw BackendUnavailableException if necessary runtime components are missing. Handle this in the constructor of Runtime by not adding those backends to the internal DeviceSpec owned by the Runtime. Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com> Change-Id: Iadffb5240e32e1f105683c4d361276b92d1e720c
2020-01-16Remove Logging.hpp from ArmNN.hppMatthew Bentham
Logging.hpp is mainly useful for raising Arm NN log messages. There's very little point in automatically including it for users of the library via the ArmNN.hpp convenience header. Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com> Change-Id: I71fb3188dc0b30c1bbc86a31996470c707d38c19
2019-12-13IVGCVSW-4178 Add code to increment the 3 ArmNN countersKeith Davis
* Increment at Runtime.cpp | BackendRegistry.cpp | LoadedNetwork.cpp * Update unit tests * UID generation is now handled by backends Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: Ifa53763409078c14839675206d8b260cdc36a8df
2019-12-10IVGCVSW-4212 Example of standalone dynamic reference backendNarumol Prangnawarat
* Add example to build dynamic reference backend * Add functions to clear dynamic backends * Fix the error when dynamic backend is not deregistered * Add DYARMNN_DYNAMIC_BACKEND_ENABLED to check disable empty dynamic backend when dynamic backend is enabled Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I1ef3a3f10ed6ca5ec18d0af04b007fc3bc71a3cb
2019-12-09IVGCVSW-4210 Create a public API for the common backend filesMatteo Martincigh
* Create a public API for the common backend files * Move OutputHandler to armnn internal * Remove unused headers Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I3e86d908b021e3561befa9d45158d87d2cbb18c0
2019-12-05Replace boost logging with simple loggerDerek Lamberti
!referencetests:214319 * Reduces arm nn binary size ~15% * Also fixed test logging black hole issues Change-Id: Iba27db304d9a8088fa46aeb0b52225d93bb56bc8 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
2019-11-19IVGCVSW-4068 Add Guid to WorkloadNarumol Prangnawarat
* Add Guid to Workload * Remove circular dependency Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Signed-off-by: janeil01 <jan.eilers@arm.com> Change-Id: I15342fa7481c6bdc050e057dce2d74bba07fe2dd
2019-10-31GitHub #292 Move BackendRegistry.hpp to the public APIMatteo Martincigh
* Moved to BackendRegistry.hpp include/armnn * Updated makefiles and sources accordingly Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I4d83abb581d523218a880c879fcf30c9611f7fd7
2019-10-15IVGCVSW-3948 Add Startup method to ProfilingJim Flynn
Change-Id: I591e84048775278bfc728e1b0c189ff4cf2d350b Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2019-10-08IVGCVSW-3948 Add Profiling config to Runtime constructorJim Flynn
Change-Id: Ib5cb85e620ed2cd76a85d423b2674b5d80981be9 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
2019-09-16IVGCVSW-3687 Add INetworkProperties to LoadNetworkDavid Monahan
* Allows users to specify if Import/Export should be used Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: I64da26a6acbeb91ef72d31b6ccc01bb1447f624d