Message ID | 25c37643-359f-e617-d9d4-ed6d65f1f8f1@codesourcery.com |
---|---|
State | New |
Headers | show |
Series | [openacc] Set safelen to INT_MAX for oacc independent pragma | expand |
On Thu, 20 Sep 2018 11:21:28 -0700 Cesar Philippidis <cesar@codesourcery.com> wrote: > This is another old gomp4 OpenACC patch which impacts targets that use > simd vectorization, such as the host and AMD GCN, rather than nvptx. > Basically, as the subject states, it sets safelen to INT_MAX for > independent acc loops, which I believe is already being done for > OpenMP in certain situations. > > The original discussion for this patch can be found here > <https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01872.html>. > > Is this patch OK for trunk? I bootstrapped and regtested it for x86_64 > Linux with nvptx offloading. I believe this is conservatively safe, although I understand that a safelen of INT_MAX does not correspond strictly to the way a GPU will execute greater-than-warp-size numbers of independent loop iterations. This isn't a problem for NVPTX (which IIUC does not use the information carried by the safelen setting at present) or the host, but may need attention for e.g. AMD GCN or other GPUs that use a similar execution scheme. This may need merging with the non-marked_independent parts of: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00140.html Julian
On Thu, Sep 20, 2018 at 11:21:28AM -0700, Cesar Philippidis wrote: > This is another old gomp4 OpenACC patch which impacts targets that use > simd vectorization, such as the host and AMD GCN, rather than nvptx. > Basically, as the subject states, it sets safelen to INT_MAX for > independent acc loops, which I believe is already being done for OpenMP > in certain situations. > > The original discussion for this patch can be found here > <https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01872.html>. > > Is this patch OK for trunk? I bootstrapped and regtested it for x86_64 > Linux with nvptx offloading. > > Thanks, > Cesar > [OpenACC] Set safelen to INT_MAX for oacc independent pragma > > 2018-XX-YY Tom de Vries <tdevries@suse.de> > Cesar Philippidis <cesar@codesourcery.com> > > gcc/ > * omp-expand.c (expand_omp_for): Set loop->safelen to INT_MAX if > marked_independent. This change is ok once the marked_independent vs. can_be_parallel etc. is resolved. > (cherry picked from gomp-4_0-branch r226079) > --- > gcc/omp-expand.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c > index 427f329d35f..ee147f10826 100644 > --- a/gcc/omp-expand.c > +++ b/gcc/omp-expand.c > @@ -5718,6 +5718,7 @@ expand_omp_for (struct omp_region *region, gimple *inner_stmt) > { > struct loop *loop = region->cont->loop_father; > loop->marked_independent = true; > + loop->safelen = INT_MAX; > } > } > else if (gimple_omp_for_kind (fd.for_stmt) & GF_OMP_FOR_SIMD) > -- > 2.17.1 > Jakub
[OpenACC] Set safelen to INT_MAX for oacc independent pragma 2018-XX-YY Tom de Vries <tdevries@suse.de> Cesar Philippidis <cesar@codesourcery.com> gcc/ * omp-expand.c (expand_omp_for): Set loop->safelen to INT_MAX if marked_independent. (cherry picked from gomp-4_0-branch r226079) --- gcc/omp-expand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index 427f329d35f..ee147f10826 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -5718,6 +5718,7 @@ expand_omp_for (struct omp_region *region, gimple *inner_stmt) { struct loop *loop = region->cont->loop_father; loop->marked_independent = true; + loop->safelen = INT_MAX; } } else if (gimple_omp_for_kind (fd.for_stmt) & GF_OMP_FOR_SIMD) -- 2.17.1