blob: 759eb7a95edda65d8e1da8c2288a128e66a88082 [file] [log] [blame]
Aron Virginas-Tar1a0f6912019-08-23 15:18:44 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "ProfilingConnectionFactory.hpp"
Sadik Armaganbd9e2c52019-09-26 23:13:31 +01007#include "SocketProfilingConnection.hpp"
Keith Davisb10e0812019-10-17 09:52:50 +01008#include "ProfilingConnectionDumpToFileDecorator.hpp"
Aron Virginas-Tar1a0f6912019-08-23 15:18:44 +01009
10namespace armnn
11{
12
13namespace profiling
14{
15
16std::unique_ptr<IProfilingConnection> ProfilingConnectionFactory::GetProfilingConnection(
17 const Runtime::CreationOptions::ExternalProfilingOptions& options) const
18{
Keith Davisb10e0812019-10-17 09:52:50 +010019 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-Tar1a0f6912019-08-23 15:18:44 +010030}
31
32} // namespace profiling
33
34} // namespace armnn