blob: af26ff36797fb834cd3f8907ba6b933ba0bd2e74 [file] [log] [blame]
Jan Tattermusch6943fb32015-02-09 17:38:52 -08001/*
Craig Tiller1a61b172015-02-16 11:53:47 -08002 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003 * Copyright 2015 gRPC authors.
Craig Tiller1a61b172015-02-16 11:53:47 -08004 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005 * 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 Tiller1a61b172015-02-16 11:53:47 -08008 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009 * http://www.apache.org/licenses/LICENSE-2.0
Craig Tiller1a61b172015-02-16 11:53:47 -080010 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011 * 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 Tiller1a61b172015-02-16 11:53:47 -080016 *
17 */
Jan Tattermusch6943fb32015-02-09 17:38:52 -080018
19#include <grpc/support/port_platform.h>
20
Yuchen Zeng12dfdc32016-04-26 22:05:41 -070021#ifdef GPR_WINDOWS
Jan Tattermusch6943fb32015-02-09 17:38:52 -080022#include <grpc/support/log.h>
23
24unsigned gpr_cpu_num_cores(void) {
zeliard06d64cd2015-04-30 18:02:06 +090025 SYSTEM_INFO si;
26 GetSystemInfo(&si);
27 return si.dwNumberOfProcessors;
Jan Tattermusch6943fb32015-02-09 17:38:52 -080028}
29
Yang Gaoc71a9d22015-05-04 00:22:12 -070030unsigned gpr_cpu_current_cpu(void) { return GetCurrentProcessorNumber(); }
Jan Tattermusch6943fb32015-02-09 17:38:52 -080031
Yuchen Zeng12dfdc32016-04-26 22:05:41 -070032#endif /* GPR_WINDOWS */