Re: [PATCH 12/12] always define ENABLE_OFFLOADING
Hi! On Mon, 23 Nov 2015 19:52:08 +0300, Ilya Verbinwrote: > There are 2 new uses of "#ifdef ENABLE_OFFLOADING" in c_parser_oacc_declare > and > cp_parser_oacc_declare. > I don't know how to properly test OpenACC, so here is untested patch. "make check"? ;-) (Offloading currently will happen for OpenACC only if a nvptx offload target has been configured, though.) Thanks for the patch -- please commit this as an obvious fixup for the trunk commit transforming ENABLE_OFFLOADING. > --- a/gcc/c/c-parser.c > +++ b/gcc/c/c-parser.c > @@ -13473,14 +13473,15 @@ c_parser_oacc_declare (c_parser *parser) > if (node != NULL) > { > node->offloadable = 1; > -#ifdef ENABLE_OFFLOADING > - g->have_offload = true; > - if (is_a (node)) > + if (ENABLE_OFFLOADING) > { > - vec_safe_push (offload_vars, decl); > - node->force_output = 1; > + g->have_offload = true; > + if (is_a (node)) > + { > + vec_safe_push (offload_vars, decl); > + node->force_output = 1; > + } > } > -#endif > } > } > } > diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c > index 24ed404..a9c0a45 100644 > --- a/gcc/cp/parser.c > +++ b/gcc/cp/parser.c > @@ -34633,14 +34633,15 @@ cp_parser_oacc_declare (cp_parser *parser, cp_token > *pragma_tok) > if (node != NULL) > { > node->offloadable = 1; > -#ifdef ENABLE_OFFLOADING > - g->have_offload = true; > - if (is_a (node)) > + if (ENABLE_OFFLOADING) > { > - vec_safe_push (offload_vars, decl); > - node->force_output = 1; > + g->have_offload = true; > + if (is_a (node)) > + { > + vec_safe_push (offload_vars, decl); > + node->force_output = 1; > + } > } > -#endif > } > } > } Grüße Thomas signature.asc Description: PGP signature
Re: [PATCH 12/12] always define ENABLE_OFFLOADING
On 11/23/2015 05:52 PM, Ilya Verbin wrote: There are 2 new uses of "#ifdef ENABLE_OFFLOADING" in c_parser_oacc_declare and cp_parser_oacc_declare. I don't know how to properly test OpenACC, so here is untested patch. It's documented on the Offloading wiki page, but this patch is good enough if it passes normal testing. Cc'ing Thomas for any extra testing/fixes that may be needed. Bernd
Re: [PATCH 12/12] always define ENABLE_OFFLOADING
On Mon, Nov 09, 2015 at 19:41:21 +0100, Bernd Schmidt wrote: > On 11/09/2015 05:47 PM, tbsaunde+...@tbsaunde.org wrote: > >-#ifdef ENABLE_OFFLOADING > >/* If the user didn't specify any, default to all configured offload > > targets. */ > >if (offload_targets == NULL) > > handle_foffload_option (OFFLOAD_TARGETS); > >-#endif > > This one I would keep guarded with an if. > > Otherwise ok modulo stage 1 end. There are 2 new uses of "#ifdef ENABLE_OFFLOADING" in c_parser_oacc_declare and cp_parser_oacc_declare. I don't know how to properly test OpenACC, so here is untested patch. diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 7b10764..1dc0bd5 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -13473,14 +13473,15 @@ c_parser_oacc_declare (c_parser *parser) if (node != NULL) { node->offloadable = 1; -#ifdef ENABLE_OFFLOADING - g->have_offload = true; - if (is_a (node)) + if (ENABLE_OFFLOADING) { - vec_safe_push (offload_vars, decl); - node->force_output = 1; + g->have_offload = true; + if (is_a (node)) + { + vec_safe_push (offload_vars, decl); + node->force_output = 1; + } } -#endif } } } diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 24ed404..a9c0a45 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -34633,14 +34633,15 @@ cp_parser_oacc_declare (cp_parser *parser, cp_token *pragma_tok) if (node != NULL) { node->offloadable = 1; -#ifdef ENABLE_OFFLOADING - g->have_offload = true; - if (is_a (node)) + if (ENABLE_OFFLOADING) { - vec_safe_push (offload_vars, decl); - node->force_output = 1; + g->have_offload = true; + if (is_a (node)) + { + vec_safe_push (offload_vars, decl); + node->force_output = 1; + } } -#endif } } } -- Ilya
Re: [PATCH 12/12] always define ENABLE_OFFLOADING
On 11/09/2015 05:47 PM, tbsaunde+...@tbsaunde.org wrote: -#ifdef ENABLE_OFFLOADING /* If the user didn't specify any, default to all configured offload targets. */ if (offload_targets == NULL) handle_foffload_option (OFFLOAD_TARGETS); -#endif This one I would keep guarded with an if. Otherwise ok modulo stage 1 end. Bernd