Skip to content

Exclude cpuid.h from Mac non x86 arch#7166

Merged
RandySheriffH merged 2 commits intomasterfrom
FixMacHeader
Mar 30, 2021
Merged

Exclude cpuid.h from Mac non x86 arch#7166
RandySheriffH merged 2 commits intomasterfrom
FixMacHeader

Conversation

@RandySheriffH
Copy link
Contributor

Exclude cpuid.h from Mac system when it is running on non x86 arch to address issue #7160.

@RandySheriffH RandySheriffH requested a review from a team as a code owner March 29, 2021 19:27
@RandySheriffH RandySheriffH changed the title Add ifdef to exclude inclusion from non x86 arch Exclude cpuid.h from Mac non x86 arch Mar 29, 2021
Copy link
Contributor

@snnn snnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may try https://cmake.org/cmake/help/latest/module/CheckIncludeFile.html . It is more portable and without the need for tweaking the macro for every platform and every compiler.

@snnn
Copy link
Contributor

snnn commented Mar 29, 2021

BTW, are you interested in doing an investigation on hwloc? For example, if we bring it in, how much it would increase our binary size. hwloc is the standard way of fetching such information on Unix-like operating systems.

@olokobayusuf
Copy link

@RandySheriffH I see you blocked out the use of __cpuid_*** in ThreadPoolProfiler::LogCore. There's another usage in ThreadPoolProfiler::LogRun. Haven't looked at what these methods do, but the latter will likely be similarly affected.

@guoyu-wang
Copy link
Contributor

guoyu-wang commented Mar 30, 2021

BTW, are you interested in doing an investigation on hwloc? For example, if we bring it in, how much it would increase our binary size. hwloc is the standard way of fetching such information on Unix-like operating systems.

Or maybe https://github.com/pytorch/cpuinfo

@RandySheriffH
Copy link
Contributor Author

RandySheriffH commented Mar 30, 2021

hwloc

Will take a delve here. :)

@RandySheriffH RandySheriffH merged commit d880578 into master Mar 30, 2021
@RandySheriffH RandySheriffH deleted the FixMacHeader branch March 30, 2021 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants