[patch,gomp-4_0-branch] openacc parallel reduction part 1
Thomas Schwinge
thomas@codesourcery.com
Mon Jul 7 09:55:00 GMT 2014
Hi Cesar!
On Sun, 6 Jul 2014 16:10:56 -0700, Cesar Philippidis <cesar_philippidis@mentor.com> wrote:
> This patch is the first step to enabling parallel reductions in openacc.
Thanks!
> As mentioned earlier, this patch isn't complete yet. For starters, parts
> of it depends on our internal ptx backend. I've temporarily remapped the
> ptx dependencies to their openmp equivalent, but without a proper
> openacc runtime this infrastructure won't do much.
For the curious: we're working on preparing our implementation of the
OpenACC Runtime Library for upstream submission; if only the weeks had
more days...
> Thomas, is this patch OK for gomp-4_0-branch?
I still :-( haven't managed to allocate the time for a proper review, but
given this doesn't regress any existing test cases, it's fine to commit,
and then we can take it from there.
A few minor comments:
> 2014-07-06 Cesar Philippidis <cesar@codesourcery.com>
> Thomas Schwinge <thomas@codesourcery.com>
By the way, on gomp-4_0-branch, ChangeLog snippets go into the respective
ChangeLog.gomp files.
> --- a/gcc/c/c-parser.c
> +++ b/gcc/c/c-parser.c
> @@ -11706,7 +11710,8 @@ c_parser_oacc_kernels (location_t loc, c_parser *parser, char *p_name)
> */
>
> #define OACC_LOOP_CLAUSE_MASK \
> - (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NONE)
> + ( (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_COLLAPSE) \
Not yet. ;-)
> + | (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_REDUCTION))
> --- a/gcc/fortran/types.def
> +++ b/gcc/fortran/types.def
> @@ -86,6 +86,7 @@ DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT)
> DEF_FUNCTION_TYPE_1 (BT_FN_PTR_PTR, BT_PTR, BT_PTR)
> DEF_FUNCTION_TYPE_1 (BT_FN_VOID_INT, BT_VOID, BT_INT)
> DEF_FUNCTION_TYPE_1 (BT_FN_BOOL_INT, BT_BOOL, BT_INT)
> +DEF_FUNCTION_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT)
That one's not actually needed, because...
> --- a/gcc/omp-builtins.def
> +++ b/gcc/omp-builtins.def
> @@ -236,3 +236,6 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_UPDATE, "GOMP_target_update",
> BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR, ATTR_NOTHROW_LIST)
> DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TEAMS, "GOMP_teams",
> BT_FN_VOID_UINT_UINT, ATTR_NOTHROW_LIST)
> +
> +DEF_GOMP_BUILTIN (BUILT_IN_OMP_SET_NUM_THREADS, "omp_set_num_threads",
> + BT_FN_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
... it's actually »void omp_set_num_threads (int)«, so BT_FN_VOID_INT.
As this is only temporary code, please add a FIXME comment here. Hmm,
and I wonder, given this is using DEF_*GOMP*_BUILTIN, does this actually
do the right thing if -openmp is not specified?
Grüße,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140707/b3588978/attachment.sig>
More information about the Gcc-patches
mailing list