aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/ProfilingConnectionFactory.cpp
blob: 759eb7a95edda65d8e1da8c2288a128e66a88082 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "ProfilingConnectionFactory.hpp"
#include "SocketProfilingConnection.hpp"
#include "ProfilingConnectionDumpToFileDecorator.hpp"

namespace armnn
{

namespace profiling
{

std::unique_ptr<IProfilingConnection> ProfilingConnectionFactory::GetProfilingConnection(
    const Runtime::CreationOptions::ExternalProfilingOptions& options) const
{
    if ( !options.m_IncomingCaptureFile.empty() || !options.m_OutgoingCaptureFile.empty() )
    {
        bool ignoreFailures = false;
        return std::make_unique<ProfilingConnectionDumpToFileDecorator>(std::make_unique<SocketProfilingConnection>(),
                                                                        options,
                                                                        ignoreFailures);
    }
    else
    {
        return std::make_unique<SocketProfilingConnection>();
    }
}

} // namespace profiling

} // namespace armnn