xref: /aosp_15_r20/external/armnn/profiling/common/src/Processes.cpp (revision 89c4ff92f2867872bb9e2354d150bf0c8c502810)
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "Processes.hpp"
7 
8 #if defined(__unix__) || defined(__APPLE__)
9 #include <unistd.h>
10 #elif defined(_MSC_VER)
11 #include <common/include/WindowsWrapper.hpp>
12 #endif
13 
14 namespace arm
15 {
16 namespace pipe
17 {
18 
GetCurrentProcessId()19 int GetCurrentProcessId()
20 {
21 #if !defined(ARMNN_DISABLE_PROCESSES)
22 #if defined(__unix__) || defined(__APPLE__)
23     return getpid();
24 #elif defined(_MSC_VER)
25     return ::GetCurrentProcessId();
26 #endif
27 #else
28     return 0;
29 #endif
30 }
31 
32 } // namespace pipe
33 } // namespace arm
34