-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#4766] Win32: Added support NUMA configuration with multiple count CPU sockets #4896
base: main
Are you sure you want to change the base?
Conversation
3df26f8
to
1951eb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing this PR! While NUMA is probably still rather uncommon, it'll be good to have the support (once the code compiles, that is).
typedef BOOL (*WINAPI glpie_t)( | ||
LOGICAL_PROCESSOR_RELATIONSHIP, | ||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, | ||
PDWORD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this code to compat/win32/
and use lazyload.h
(imitate existing code that declares and initializes the function pointer).
@@ -18,6 +18,67 @@ | |||
# endif | |||
#endif | |||
|
|||
#ifdef GIT_WINDOWS_NATIVE | |||
/// defines the GetLogicalProcessorInformationEx function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid C++-style comments. The existing code does not use them.
PDWORD); | ||
|
||
// Classic way to get number of cores in windows. | ||
static size_t get_windows_compatible_n_cores() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not add an extra function here. Instead, let's declare a single win32_online_cpus(void)
function in a header file in compat/win32/
and implement it in a .c
file. Or put them into compat/mingw.h
/compat/mingw.c
.
return 0; | ||
} | ||
|
||
GetLogicalProcessorInformationEx(RelationAll, NULL, &length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not forget to check the return value.
Fixed this issue: #4766