Aron Virginas-Tar | 1a0f691 | 2019-08-23 15:18:44 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "ProfilingConnectionFactory.hpp" |
Sadik Armagan | bd9e2c5 | 2019-09-26 23:13:31 +0100 | [diff] [blame] | 7 | #include "SocketProfilingConnection.hpp" |
Keith Davis | b10e081 | 2019-10-17 09:52:50 +0100 | [diff] [blame] | 8 | #include "ProfilingConnectionDumpToFileDecorator.hpp" |
Aron Virginas-Tar | 1a0f691 | 2019-08-23 15:18:44 +0100 | [diff] [blame] | 9 | |
| 10 | namespace armnn |
| 11 | { |
| 12 | |
| 13 | namespace profiling |
| 14 | { |
| 15 | |
| 16 | std::unique_ptr<IProfilingConnection> ProfilingConnectionFactory::GetProfilingConnection( |
| 17 | const Runtime::CreationOptions::ExternalProfilingOptions& options) const |
| 18 | { |
Keith Davis | b10e081 | 2019-10-17 09:52:50 +0100 | [diff] [blame] | 19 | if ( !options.m_IncomingCaptureFile.empty() || !options.m_OutgoingCaptureFile.empty() ) |
| 20 | { |
| 21 | bool ignoreFailures = false; |
| 22 | return std::make_unique<ProfilingConnectionDumpToFileDecorator>(std::make_unique<SocketProfilingConnection>(), |
| 23 | options, |
| 24 | ignoreFailures); |
| 25 | } |
| 26 | else |
| 27 | { |
| 28 | return std::make_unique<SocketProfilingConnection>(); |
| 29 | } |
Aron Virginas-Tar | 1a0f691 | 2019-08-23 15:18:44 +0100 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | } // namespace profiling |
| 33 | |
| 34 | } // namespace armnn |