Jan Tattermusch | 6943fb3 | 2015-02-09 17:38:52 -0800 | [diff] [blame] | 1 | /* |
Craig Tiller | 1a61b17 | 2015-02-16 11:53:47 -0800 | [diff] [blame] | 2 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 3 | * Copyright 2015 gRPC authors. |
Craig Tiller | 1a61b17 | 2015-02-16 11:53:47 -0800 | [diff] [blame] | 4 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
Craig Tiller | 1a61b17 | 2015-02-16 11:53:47 -0800 | [diff] [blame] | 8 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Craig Tiller | 1a61b17 | 2015-02-16 11:53:47 -0800 | [diff] [blame] | 10 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
Craig Tiller | 1a61b17 | 2015-02-16 11:53:47 -0800 | [diff] [blame] | 16 | * |
| 17 | */ |
Jan Tattermusch | 6943fb3 | 2015-02-09 17:38:52 -0800 | [diff] [blame] | 18 | |
| 19 | #include <grpc/support/port_platform.h> |
| 20 | |
Yuchen Zeng | 12dfdc3 | 2016-04-26 22:05:41 -0700 | [diff] [blame] | 21 | #ifdef GPR_WINDOWS |
Jan Tattermusch | 6943fb3 | 2015-02-09 17:38:52 -0800 | [diff] [blame] | 22 | #include <grpc/support/log.h> |
| 23 | |
| 24 | unsigned gpr_cpu_num_cores(void) { |
zeliard | 06d64cd | 2015-04-30 18:02:06 +0900 | [diff] [blame] | 25 | SYSTEM_INFO si; |
| 26 | GetSystemInfo(&si); |
| 27 | return si.dwNumberOfProcessors; |
Jan Tattermusch | 6943fb3 | 2015-02-09 17:38:52 -0800 | [diff] [blame] | 28 | } |
| 29 | |
Yang Gao | c71a9d2 | 2015-05-04 00:22:12 -0700 | [diff] [blame] | 30 | unsigned gpr_cpu_current_cpu(void) { return GetCurrentProcessorNumber(); } |
Jan Tattermusch | 6943fb3 | 2015-02-09 17:38:52 -0800 | [diff] [blame] | 31 | |
Yuchen Zeng | 12dfdc3 | 2016-04-26 22:05:41 -0700 | [diff] [blame] | 32 | #endif /* GPR_WINDOWS */ |