ArmNN
 21.02
SocketProfilingConnection.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include <Runtime.hpp>
9 #include <common/include/NetworkSockets.hpp>
10 
11 #pragma once
12 
13 namespace armnn
14 {
15 namespace profiling
16 {
17 
19 {
20 public:
22  bool IsOpen() const final;
23  void Close() final;
24  bool WritePacket(const unsigned char* buffer, uint32_t length) final;
25  arm::pipe::Packet ReadPacket(uint32_t timeout) final;
26 
27 private:
28 
29  // Read a full packet from the socket.
30  arm::pipe::Packet ReceivePacket();
31 
32 #ifndef __APPLE__
33  // To indicate we want to use an abstract UDS ensure the first character of the address is 0.
34  const char* m_GatorNamespace = "\0gatord_namespace";
35 #else
36  // MACOSX does not support abstract UDS
37  const char* m_GatorNamespace = "/tmp/gatord_namespace";
38 #endif
39  arm::pipe::PollFd m_Socket[1]{};
40 };
41 
42 } // namespace profiling
43 } // namespace armnn
Copyright (c) 2021 ARM Limited and Contributors.
arm::pipe::Packet ReadPacket(uint32_t timeout) final
bool WritePacket(const unsigned char *buffer, uint32_t length) final