On 03/21/2018 08:49 AM, Tom de Vries wrote: > On 03/02/2018 08:18 PM, Cesar Philippidis wrote: > >> og7-vl-part4-hooks.diff > >> diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c >> index 5642941c6a3..507c8671704 100644 >> --- a/gcc/config/nvptx/nvptx.c >> +++ b/gcc/config/nvptx/nvptx.c >> @@ -5205,14 +5205,36 @@ nvptx_simt_vf () >> return PTX_WARP_SIZE; >> } >> +#define NVPTX_GOACC_VL_WARP "nvptx vl warp" >> + >> +/* Return true of the offloaded function needs a vector_length of >> + PTX_WARP_SIZE. */ >> + >> +static bool >> +nvptx_goacc_needs_vl_warp () >> +{ >> + tree attr = lookup_attribute (NVPTX_GOACC_VL_WARP, >> + DECL_ATTRIBUTES (current_function_decl)); >> + return attr == NULL_TREE; >> +} >> + > > I just wrote an example using "#pragma acc parallel vector_length (128)" > and looked at the generated code. I found that the actual vector_length > was still 32. I tracked this back to this function returning true. > > I think we need "return attr != NULL_TREE".
Yes. Good catch. I've added another test case for this. Thanks, Cesar