Add parameter to GOMP_{loop,distribute}_static_worksharing{,_start} carrying the
total number of loop iterations. niter is unused for now, pending OMPT
implementation.
The call in omp-expand.cc is moved after the iteration count computation
so that the iteration count is available to pass as the argument.
gcc/ChangeLog:
* builtin-types.def (BT_FN_COMPLEX_INT): Remove.
(BT_FN_COMPLEX_INT_ULONGLONG): New.
* omp-builtins.def (BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING): Use
BT_FN_COMPLEX_INT_ULONGLONG.
(BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING_START): Likewise.
(BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING): Likewise.
(BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING_START): Likewise.
* omp-expand.cc (expand_omp_for_static_nochunk): Move worksharing
builtin call after iteration count computation; pass n as niter.
(expand_omp_for_static_chunk): Likewise.
gcc/fortran/ChangeLog:
* types.def (BT_FN_COMPLEX_INT): Remove.
(BT_FN_COMPLEX_INT_ULONGLONG): New.
libgomp/ChangeLog:
* config/gcn/teams.c (GOMP_distribute_static_worksharing): Add
long niter parameter (unused).
(GOMP_distribute_static_worksharing_start): Likewise.
* config/nvptx/teams.c (GOMP_distribute_static_worksharing):
Likewise.
(GOMP_distribute_static_worksharing_start): Likewise.
* libgomp.texi: Update function signatures; fix real/imaginary
description; document niter parameter.
* libgomp_g.h (GOMP_loop_static_worksharing): Update prototype.
(GOMP_distribute_static_worksharing): Likewise.
* loop.c (GOMP_loop_static_worksharing): Add long niter parameter
(unused).
(GOMP_loop_static_worksharing_start): Likewise.
* teams.c (GOMP_distribute_static_worksharing): Likewise.
(GOMP_distribute_static_worksharing_start): Likewise.
* testsuite/libgomp.c-c++-common/for-static-1.c: Update scan
pattern to match niter argument.
* testsuite/libgomp.c-c++-common/for-static-2.c: Likewise.
* testsuite/libgomp.c-c++-common/for-static-3.c: Likewise.
gcc/testsuite/ChangeLog:
* c-c++-common/gomp/for-static-1.c: Update scan pattern to match
niter argument.
* c-c++-common/gomp/for-static-2.c: Likewise.
* c-c++-common/gomp/for-static-3.c: Likewise.
Co-authored-by: Thomas Schwinge <tschwinge@baylibre.com>
DEF_FUNCTION_TYPE_0 (BT_FN_PID, BT_PID)
DEF_FUNCTION_TYPE_0 (BT_FN_INT, BT_INT)
DEF_FUNCTION_TYPE_0 (BT_FN_UINT, BT_UINT)
-DEF_FUNCTION_TYPE_0 (BT_FN_COMPLEX_INT, BT_COMPLEX_INT)
DEF_FUNCTION_TYPE_0 (BT_FN_ULONG, BT_ULONG)
DEF_FUNCTION_TYPE_0 (BT_FN_ULONGLONG, BT_ULONGLONG)
DEF_FUNCTION_TYPE_0 (BT_FN_FLOAT, BT_FLOAT)
DEF_FUNCTION_TYPE_1 (BT_FN_UINT32_UINT16, BT_UINT32, BT_UINT16)
DEF_FUNCTION_TYPE_1 (BT_FN_INT_FENV_T_PTR, BT_INT, BT_FENV_T_PTR)
DEF_FUNCTION_TYPE_1 (BT_FN_INT_CONST_FENV_T_PTR, BT_INT, BT_CONST_FENV_T_PTR)
+DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_INT_ULONGLONG, BT_COMPLEX_INT, BT_ULONGLONG)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR)
DEF_FUNCTION_TYPE_0 (BT_FN_BOOL, BT_BOOL)
DEF_FUNCTION_TYPE_0 (BT_FN_PTR, BT_PTR)
DEF_FUNCTION_TYPE_0 (BT_FN_INT, BT_INT)
-DEF_FUNCTION_TYPE_0 (BT_FN_COMPLEX_INT, BT_COMPLEX_INT)
DEF_FUNCTION_TYPE_0 (BT_FN_UINT, BT_UINT)
DEF_FUNCTION_TYPE_0 (BT_FN_VOID, BT_VOID)
DEF_FUNCTION_TYPE_0 (BT_FN_ULONGLONG, BT_ULONGLONG)
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_INT, BT_VOID, BT_INT)
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_BOOL, BT_VOID, BT_BOOL)
DEF_FUNCTION_TYPE_1 (BT_FN_BOOL_INT, BT_BOOL, BT_INT)
+DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_INT_ULONGLONG, BT_COMPLEX_INT, BT_ULONGLONG)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR)
ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_MASKED_END, "GOMP_masked_end", BT_FN_VOID,
ATTR_NOTHROW_LEAF_LIST)
+/* TODO review these function attributes once OMPT implementation done */
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING,
- "GOMP_loop_static_worksharing", BT_FN_COMPLEX_INT,
+ "GOMP_loop_static_worksharing",
+ BT_FN_COMPLEX_INT_ULONGLONG,
ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING_START,
- "GOMP_loop_static_worksharing_start", BT_FN_COMPLEX_INT,
+ "GOMP_loop_static_worksharing_start",
+ BT_FN_COMPLEX_INT_ULONGLONG,
ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING_END,
"GOMP_loop_static_worksharing_end", BT_FN_VOID,
"GOMP_loop_static_worksharing_dispatch", BT_FN_VOID,
ATTR_NOTHROW_LEAF_LIST)
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING,
- "GOMP_distribute_static_worksharing", BT_FN_COMPLEX_INT,
+ "GOMP_distribute_static_worksharing",
+ BT_FN_COMPLEX_INT_ULONGLONG,
ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING_START,
- "GOMP_distribute_static_worksharing_start", BT_FN_COMPLEX_INT,
+ "GOMP_distribute_static_worksharing_start",
+ BT_FN_COMPLEX_INT_ULONGLONG,
ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING_END,
"GOMP_distribute_static_worksharing_end", BT_FN_VOID,
release_ssa_name (gimple_assign_lhs (g));
}
}
- /* Fetch the thread/team id and the number of threads/teams in a single
- call to GOMP_loop_static_worksharing or GOMP_distribute_static_worksharing.
- The helper returns both values packed into one complex int, with
- the id as the imaginary part and the count as the real part. Returning
- (rather than writing through pointers) keeps both values as plain SSA
- names, which lets later passes - notably IPA-CP propagating constants
- into the outlined kernel - reason about them. */
- tree decl;
- switch (gimple_omp_for_kind (fd->for_stmt))
- {
- case GF_OMP_FOR_KIND_FOR:
- decl = builtin_decl_explicit (
- flag_openmp_ompt ? BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING_START
- : BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING);
- break;
- case GF_OMP_FOR_KIND_DISTRIBUTE:
- decl = builtin_decl_explicit (
- flag_openmp_ompt ? BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING_START
- : BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING);
- break;
- default:
- gcc_unreachable ();
- }
- {
- tree packed = build_call_expr (decl, 0);
- packed = force_gimple_operand_gsi (&gsi, packed, true, NULL_TREE,
- true, GSI_SAME_STMT);
- threadid = fold_build1 (IMAGPART_EXPR, integer_type_node, packed);
- threadid = fold_convert (itype, threadid);
- threadid = force_gimple_operand_gsi (&gsi, threadid, true, NULL_TREE,
- true, GSI_SAME_STMT);
- nthreads = fold_build1 (REALPART_EXPR, integer_type_node, packed);
- nthreads = fold_convert (itype, nthreads);
- nthreads = force_gimple_operand_gsi (&gsi, nthreads, true, NULL_TREE,
- true, GSI_SAME_STMT);
- }
n1 = fd->loop.n1;
n2 = fd->loop.n2;
t = fold_convert (itype, t);
n = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT);
+ {
+ /* Fetch the thread/team id and the number of threads/teams in a single
+ call to GOMP_loop_static_worksharing or
+ GOMP_distribute_static_worksharing. The helper returns both values packed
+ into one complex int, with the id as the imaginary part and the count as
+ the real part. Returning (rather than writing through pointers) keeps
+ both values as plain SSA names, which lets later passes - notably IPA-CP
+ propagating constants into the outlined kernel - reason about them.
+ Also pass the total number of iterations for OMPT. */
+ tree decl;
+ switch (gimple_omp_for_kind (fd->for_stmt))
+ {
+ case GF_OMP_FOR_KIND_FOR:
+ decl = builtin_decl_explicit (
+ flag_openmp_ompt ? BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING_START
+ : BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING);
+ break;
+ case GF_OMP_FOR_KIND_DISTRIBUTE:
+ decl = builtin_decl_explicit (
+ flag_openmp_ompt ? BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING_START
+ : BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ tree n_ull = fold_convert (long_long_unsigned_type_node, n);
+ tree packed = build_call_expr (decl, 1, n_ull);
+ packed = force_gimple_operand_gsi (&gsi, packed, true, NULL_TREE,
+ true, GSI_SAME_STMT);
+ threadid = fold_build1 (IMAGPART_EXPR, integer_type_node, packed);
+ threadid = fold_convert (itype, threadid);
+ threadid = force_gimple_operand_gsi (&gsi, threadid, true, NULL_TREE,
+ true, GSI_SAME_STMT);
+ nthreads = fold_build1 (REALPART_EXPR, integer_type_node, packed);
+ nthreads = fold_convert (itype, nthreads);
+ nthreads = force_gimple_operand_gsi (&gsi, nthreads, true, NULL_TREE,
+ true, GSI_SAME_STMT);
+ }
+
q = create_tmp_reg (itype, "q");
t = fold_build2 (TRUNC_DIV_EXPR, itype, n, nthreads);
t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, true, GSI_SAME_STMT);
release_ssa_name (gimple_assign_lhs (g));
}
}
- /* Fetch the thread/team id and the number of threads/teams in a single
- call to GOMP_loop_static_worksharing or GOMP_distribute_static_worksharing.
- The helper returns both values packed into one complex int, with
- the id as the imaginary part and the count as the real part. Returning
- (rather than writing through pointers) keeps both values as plain SSA
- names, which lets later passes - notably IPA-CP propagating constants
- into the outlined kernel - reason about them. */
- tree decl;
- switch (gimple_omp_for_kind (fd->for_stmt))
- {
- case GF_OMP_FOR_KIND_FOR:
- decl = builtin_decl_explicit (
- flag_openmp_ompt ? BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING_START
- : BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING);
- break;
- case GF_OMP_FOR_KIND_DISTRIBUTE:
- decl = builtin_decl_explicit (
- flag_openmp_ompt ? BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING_START
- : BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING);
- break;
- default:
- gcc_unreachable ();
- }
- {
- tree packed = build_call_expr (decl, 0);
- packed = force_gimple_operand_gsi (&gsi, packed, true, NULL_TREE,
- true, GSI_SAME_STMT);
- threadid = fold_build1 (IMAGPART_EXPR, integer_type_node, packed);
- threadid = fold_convert (itype, threadid);
- threadid = force_gimple_operand_gsi (&gsi, threadid, true, NULL_TREE,
- true, GSI_SAME_STMT);
- nthreads = fold_build1 (REALPART_EXPR, integer_type_node, packed);
- nthreads = fold_convert (itype, nthreads);
- nthreads = force_gimple_operand_gsi (&gsi, nthreads, true, NULL_TREE,
- true, GSI_SAME_STMT);
- }
n1 = fd->loop.n1;
n2 = fd->loop.n2;
n = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
true, GSI_SAME_STMT);
+ {
+ /* Fetch the thread/team id and the number of threads/teams in a single
+ call to GOMP_loop_static_worksharing or
+ GOMP_distribute_static_worksharing. The helper returns both values packed
+ into one complex int, with the id as the imaginary part and the count as
+ the real part. Returning (rather than writing through pointers) keeps
+ both values as plain SSA names, which lets later passes - notably IPA-CP
+ propagating constants into the outlined kernel - reason about them.
+ Also pass the total number of iterations for OMPT. */
+ tree decl;
+ switch (gimple_omp_for_kind (fd->for_stmt))
+ {
+ case GF_OMP_FOR_KIND_FOR:
+ decl = builtin_decl_explicit (
+ flag_openmp_ompt ? BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING_START
+ : BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING);
+ break;
+ case GF_OMP_FOR_KIND_DISTRIBUTE:
+ decl = builtin_decl_explicit (
+ flag_openmp_ompt ? BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING_START
+ : BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ tree n_ull = fold_convert (long_long_unsigned_type_node, n);
+ tree packed = build_call_expr (decl, 1, n_ull);
+ packed = force_gimple_operand_gsi (&gsi, packed, true, NULL_TREE, true,
+ GSI_SAME_STMT);
+ threadid = fold_build1 (IMAGPART_EXPR, integer_type_node, packed);
+ threadid = fold_convert (itype, threadid);
+ threadid = force_gimple_operand_gsi (&gsi, threadid, true, NULL_TREE, true,
+ GSI_SAME_STMT);
+ nthreads = fold_build1 (REALPART_EXPR, integer_type_node, packed);
+ nthreads = fold_convert (itype, nthreads);
+ nthreads = force_gimple_operand_gsi (&gsi, nthreads, true, NULL_TREE, true,
+ GSI_SAME_STMT);
+ }
+
trip_var = create_tmp_reg (itype, ".trip");
if (gimple_in_ssa_p (cfun))
{
#include "for-static.h"
-/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing \\(" 2 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing \\(" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing \\(\[^\\)\]" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "GOMP_loop_static_worksharing_start" "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "GOMP_loop_static_worksharing_dispatch" "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "GOMP_loop_static_worksharing_end" "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing \\(\[^\\)\]" 2 "ompexp" } } */
/* { dg-final { scan-tree-dump-not "omp_get_num_threads" "ompexp" } } */
/* { dg-final { scan-tree-dump-not "omp_get_thread_num" "ompexp" } } */
/* { dg-final { scan-tree-dump-not "omp_get_num_teams" "ompexp" } } */
#include "for-static.h"
-/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_start \\(" 2 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_end \\(" 2 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_start \\(" 2 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_end \\(" 2 "ompexp" } } */
/* { dg-final { scan-tree-dump-not "GOMP_loop_static_worksharing \\(" "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_start \\(\[^\\)\]" 2 "ompexp" } } */
/* { dg-final { scan-tree-dump-not "GOMP_loop_static_worksharing_dispatch" "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_end \\(\\)" 2 "ompexp" } } */
/* { dg-final { scan-tree-dump-not "GOMP_distribute_static_worksharing \\(" "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_start \\(\[^\\)\]" 2 "ompexp" } } */
/* { dg-final { scan-tree-dump-not "GOMP_distribute_static_worksharing_dispatch" "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_end \\(\\)" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "omp_get_num_threads" "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "omp_get_thread_num" "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "omp_get_num_teams" "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "omp_get_team_num" "ompexp" } } */
#include "for-static.h"
-/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_start \\(" 2 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_dispatch \\(" 2 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_end \\(" 2 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_start \\(" 2 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_dispatch \\(" 2 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_end \\(" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "GOMP_loop_static_worksharing \\(" "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_start \\(\[^\\)\]" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_dispatch \\(\\)" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_static_worksharing_end \\(\\)" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "GOMP_distribute_static_worksharing \\(" "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_start \\(\[^\\)\]" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_dispatch \\(\\)" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_distribute_static_worksharing_end \\(\\)" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "omp_get_num_threads" "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "omp_get_thread_num" "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "omp_get_num_teams" "ompexp" } } */
+/* { dg-final { scan-tree-dump-not "omp_get_team_num" "ompexp" } } */
}
/* For a distribute construct with static schedule, return the team ID and
- number of teams packed into a single complexvalue. */
+ number of teams packed into a single complex value. NITER is the total
+ number of iterations. */
_Complex int
-GOMP_distribute_static_worksharing (void)
+GOMP_distribute_static_worksharing (unsigned long long niter
+ __attribute__ ((unused)))
{
int __lds *gomp_team_num = (int __lds *) GOMP_TEAM_NUM;
unsigned tid = *gomp_team_num;
/* OMPT variant enabled by -fopenmp-ompt. */
_Complex int
-GOMP_distribute_static_worksharing_start (void)
+GOMP_distribute_static_worksharing_start (unsigned long long niter
+ __attribute__ ((unused)))
{
int __lds *gomp_team_num = (int __lds *) GOMP_TEAM_NUM;
unsigned tid = *gomp_team_num;
}
/* For a distribute construct with static schedule, return the team ID and
- number of teams packed into a single complexvalue. */
+ number of teams packed into a single complex value. NITER is the total
+ number of iterations. */
_Complex int
-GOMP_distribute_static_worksharing (void)
+GOMP_distribute_static_worksharing (unsigned long long niter
+ __attribute__ ((unused)))
{
unsigned tid = __gomp_team_num;
unsigned nteams = gomp_num_teams_var + 1;
/* OMPT variant enabled by -fopenmp-ompt. */
_Complex int
-GOMP_distribute_static_worksharing_start (void)
+GOMP_distribute_static_worksharing_start (unsigned long long niter
+ __attribute__ ((unused)))
{
unsigned tid = __gomp_team_num;
unsigned nteams = gomp_num_teams_var + 1;
For @code{schedule(static)} without @code{ordered}, the compiler uses:
@smallexample
- _Complex int GOMP_loop_static_worksharing (void)
+ _Complex int GOMP_loop_static_worksharing (unsigned long long)
@end smallexample
-which returns the thread id in the real part and the thread count in the imaginary
-part as a single value, avoiding separate @code{omp_get_thread_num} /
+which returns the thread id in the imaginary part and the thread count in the
+real part as a single value, avoiding separate @code{omp_get_thread_num} /
@code{omp_get_num_threads} calls that OMPT cannot distinguish from user queries.
+For OMPT, the total number of loop iterations is passed as argument.
Similarly, for @code{distribute} constructs:
@smallexample
- _Complex int GOMP_distribute_static_worksharing (void)
+ _Complex int GOMP_distribute_static_worksharing (unsigned long long)
@end smallexample
returns the team id and team count.
extern void GOMP_loop_end_nowait (void);
extern bool GOMP_loop_end_cancel (void);
-extern __complex__ int GOMP_loop_static_worksharing (void);
-extern __complex__ int GOMP_loop_static_worksharing_start (void);
+extern _Complex int GOMP_loop_static_worksharing (unsigned long long);
+extern _Complex int GOMP_loop_static_worksharing_start (unsigned long long);
extern void GOMP_loop_static_worksharing_dispatch (void);
extern void GOMP_loop_static_worksharing_end (void);
extern void GOMP_teams_reg (void (*) (void *), void *, unsigned, unsigned,
unsigned);
-extern __complex__ int GOMP_distribute_static_worksharing (void);
-extern __complex__ int GOMP_distribute_static_worksharing_start (void);
+extern _Complex int GOMP_distribute_static_worksharing (unsigned long long);
+extern _Complex int GOMP_distribute_static_worksharing_start (unsigned long long);
extern void GOMP_distribute_static_worksharing_dispatch (void);
extern void GOMP_distribute_static_worksharing_end (void);
#endif
/* For a worksharing-loop construct with static schedule, return the thread ID
- and number of threads packed into a single complex value. */
+ and number of threads packed into a single complex value. NITER is the total
+ number of iterations. */
_Complex int
-GOMP_loop_static_worksharing (void)
+GOMP_loop_static_worksharing (unsigned long long niter
+ __attribute__ ((unused)))
{
struct gomp_team *team = gomp_thread ()->ts.team;
unsigned tid = gomp_thread ()->ts.team_id;
/* OMPT variant enabled by -fopenmp-ompt. */
_Complex int
-GOMP_loop_static_worksharing_start (void)
+GOMP_loop_static_worksharing_start (unsigned long long niter
+ __attribute__ ((unused)))
{
struct gomp_team *team = gomp_thread ()->ts.team;
unsigned tid = gomp_thread ()->ts.team_id;
}
/* For a distribute construct with static schedule, return the team ID and
- number of teams packed into a single complex value. */
+ number of teams packed into a single complex value. NITER is the total
+ number of iterations. */
_Complex int
-GOMP_distribute_static_worksharing (void)
+GOMP_distribute_static_worksharing (unsigned long long
+ niter __attribute__ ((unused)))
{
struct gomp_thread *thr = gomp_thread ();
unsigned tid = thr->team_num;
/* OMPT variant enabled by -fopenmp-ompt. */
_Complex int
-GOMP_distribute_static_worksharing_start (void)
+GOMP_distribute_static_worksharing_start (unsigned long long
+ niter __attribute__ ((unused)))
{
struct gomp_thread *thr = gomp_thread ();
unsigned tid = thr->team_num;
#include "for-static.h"
-/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing \\(" 2 "optimized" } } */
+/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing \\(\[^\\)\]" 2 "optimized" } } */
/* { dg-final { scan-offload-tree-dump-not "omp_get_num_teams" "optimized" } } */
/* { dg-final { scan-offload-tree-dump-not "omp_get_team_num" "optimized" } } */
#include "for-static.h"
-/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_start \\(" 2 "optimized" } } */
-/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_end \\(" 2 "optimized" } } */
+/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_start \\(\[^\\)\]" 2 "optimized" } } */
+/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_end \\(\\)" 2 "optimized" } } */
/* { dg-final { scan-offload-tree-dump-not "GOMP_distribute_static_worksharing \\(" "optimized" } } */
/* { dg-final { scan-offload-tree-dump-not "GOMP_distribute_static_worksharing_dispatch" "optimized" } } */
#include "for-static.h"
-/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_start \\(" 2 "optimized" } } */
-/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_dispatch \\(" 2 "optimized" } } */
-/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_end \\(" 2 "optimized" } } */
+/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_start \\(\[^\\)\]" 2 "optimized" } } */
+/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_dispatch \\(\\)" 2 "optimized" } } */
+/* { dg-final { scan-offload-tree-dump-times "GOMP_distribute_static_worksharing_end \\(\\)" 2 "optimized" } } */