[PATCH v2] vcomp: Implement omp_get_num_procs().
Paul Gofman
pgofman at codeweavers.com
Fri Oct 23 13:17:04 CDT 2020
On 10/23/20 21:01, Andrey Gusev wrote:
>
> int CDECL omp_get_num_procs(void)
> {
> - TRACE("stub\n");
> - return 1;
> + TRACE("()\n");
> + return sizeof(LOGICAL_PROCESSOR_RELATIONSHIP);
> }
>
> int CDECL omp_get_num_threads(void)
I guess you'd want the number of processors queried like
vcomp_max_threads global variable in DllMain() [1]. omp_get_num_procs()
is not the same as omp_get_max_threads() though as it is possible to
configure maximum number of threads to use in Openmp [2]. The number of
processors is not what Openmp controls, it is the number of processors
currently available in the system (which can still change during runtime
as processors can be hotplugged, stopped or resumed). I guess a trivial
test to vcomp/tests/vcomp.c comparing omp_get_num_procs() with the
number of CPUs requested by GetSystemInfo could be helpful.
1. https://www.openmp.org/spec-html/5.0/openmpsu114.html
2. https://www.openmp.org/spec-html/5.0/openmpsu112.html
More information about the wine-devel
mailing list