vcomp: Implement _vcomp_get_thread_num.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
This commit is contained in:
Sebastian Lackner 2015-10-07 05:46:25 +02:00 committed by Alexandre Julliard
parent aa39614e77
commit 0410cf9cbe
6 changed files with 17 additions and 4 deletions

View File

@ -480,6 +480,12 @@ int CDECL omp_get_thread_num(void)
return vcomp_init_thread_data()->thread_num;
}
int CDECL _vcomp_get_thread_num(void)
{
TRACE("()\n");
return vcomp_init_thread_data()->thread_num;
}
/* Time in seconds since "some time in the past" */
double CDECL omp_get_wtime(void)
{

View File

@ -65,6 +65,7 @@ static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, i
static void (CDECL *p_vcomp_for_static_simple_init)(unsigned int first, unsigned int last, int step,
BOOL increment, unsigned int *begin, unsigned int *end);
static void (WINAPIV *p_vcomp_fork)(BOOL ifval, int nargs, void *wrapper, ...);
static int (CDECL *p_vcomp_get_thread_num)(void);
static void (CDECL *p_vcomp_leave_critsect)(CRITICAL_SECTION *critsect);
static int (CDECL *p_vcomp_master_begin)(void);
static void (CDECL *p_vcomp_master_end)(void);
@ -254,6 +255,7 @@ static BOOL init_vcomp(void)
VCOMP_GET_PROC(_vcomp_for_static_init);
VCOMP_GET_PROC(_vcomp_for_static_simple_init);
VCOMP_GET_PROC(_vcomp_fork);
VCOMP_GET_PROC(_vcomp_get_thread_num);
VCOMP_GET_PROC(_vcomp_leave_critsect);
VCOMP_GET_PROC(_vcomp_master_begin);
VCOMP_GET_PROC(_vcomp_master_end);
@ -306,6 +308,8 @@ static void CDECL num_threads_cb(BOOL nested, int parallel, int nested_threads,
thread_num = pomp_get_thread_num();
ok(thread_num >= 0 && thread_num < num_threads,
"expected thread_num in range [0, %d], got %d\n", num_threads - 1, thread_num);
ok(thread_num == p_vcomp_get_thread_num(),
"expected _vcomp_get_thread_num to return the same value\n");
is_parallel = pomp_in_parallel();
ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel);
@ -344,6 +348,9 @@ static void test_omp_get_num_threads(BOOL nested)
int is_nested, is_parallel, max_threads, num_threads, thread_num;
LONG thread_count;
ok(pomp_get_thread_num != p_vcomp_get_thread_num,
"expected omp_get_thread_num != _vcomp_get_thread_num\n");
pomp_set_nested(nested);
is_nested = pomp_get_nested();
ok(is_nested == nested, "expected %d, got %d\n", nested, is_nested);

View File

@ -65,7 +65,7 @@
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr)
@ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr)
@ stub _vcomp_get_thread_num
@ cdecl _vcomp_get_thread_num()
@ cdecl _vcomp_leave_critsect(ptr)
@ stub _vcomp_master_barrier
@ cdecl _vcomp_master_begin()

View File

@ -65,7 +65,7 @@
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init
@ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork
@ stub _vcomp_get_thread_num
@ cdecl _vcomp_get_thread_num() vcomp._vcomp_get_thread_num
@ cdecl _vcomp_leave_critsect(ptr) vcomp._vcomp_leave_critsect
@ stub _vcomp_master_barrier
@ cdecl _vcomp_master_begin() vcomp._vcomp_master_begin

View File

@ -66,7 +66,7 @@
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init
@ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork
@ stub _vcomp_get_thread_num
@ cdecl _vcomp_get_thread_num() vcomp._vcomp_get_thread_num
@ cdecl _vcomp_leave_critsect(ptr) vcomp._vcomp_leave_critsect
@ stub _vcomp_master_barrier
@ cdecl _vcomp_master_begin() vcomp._vcomp_master_begin

View File

@ -65,7 +65,7 @@
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init
@ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork
@ stub _vcomp_get_thread_num
@ cdecl _vcomp_get_thread_num() vcomp._vcomp_get_thread_num
@ cdecl _vcomp_leave_critsect(ptr) vcomp._vcomp_leave_critsect
@ stub _vcomp_master_barrier
@ cdecl _vcomp_master_begin() vcomp._vcomp_master_begin