Rob Hughes | bdee426 | 2020-01-07 17:05:24 +0000 | [diff] [blame] | 1 | // |
2 | // Copyright © 2020 Arm Ltd. All rights reserved. | ||||
3 | // SPDX-License-Identifier: MIT | ||||
4 | // | ||||
5 | |||||
6 | #include "Processes.hpp" | ||||
7 | |||||
8 | #if defined(__unix__) | ||||
9 | #include <unistd.h> | ||||
10 | #elif defined(_MSC_VER) | ||||
11 | #define WIN32_LEAN_AND_MEAN | ||||
12 | #include <Windows.h> | ||||
13 | #endif | ||||
14 | |||||
15 | namespace armnnUtils | ||||
16 | { | ||||
17 | namespace Processes | ||||
18 | { | ||||
19 | |||||
20 | int GetCurrentId() | ||||
21 | { | ||||
22 | #if defined(__unix__) | ||||
23 | return getpid(); | ||||
24 | #elif defined(_MSC_VER) | ||||
25 | return ::GetCurrentProcessId(); | ||||
26 | #endif | ||||
27 | } | ||||
28 | |||||
29 | } | ||||
30 | } |