[Bug target/100321] [OpenMP][nvptx, SIMT] (Con't) Reduction fails with optimization and 'loop'/'for simd' but not with 'for'

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 3 21:14:21 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100321

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@gcc.gnu.org>:

https://gcc.gnu.org/g:f87990a2a8fc9e20d30462a0a4c9047582af0cd9

commit r12-395-gf87990a2a8fc9e20d30462a0a4c9047582af0cd9
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon May 3 11:36:14 2021 +0200

    [openmp, simt] Disable SIMT for user-defined reduction

    The test-case included in this patch contains this target region:
    ...
      for (int i0 = 0 ; i0 < N0 ; i0++ )
        counter_N0.i += 1;
    ...

    When running with nvptx accelerator, the counter variable is expected to
    be N0 after the region, but instead is N0 / 32.  The problem is that rather
    than getting the result for all warp lanes, we get it for just one lane.

    This is caused by the implementation of SIMT being incomplete.  It handles
    regular reductions, but appearantly not user-defined reductions.

    For now, handle this by disabling SIMT in this case, specifically by
setting
    sctx->max_vf to 1.

    Tested libgomp on x86_64-linux with nvptx accelerator.

    gcc/ChangeLog:

    2021-05-03  Tom de Vries  <tdevries@suse.de>

            PR target/100321
            * omp-low.c (lower_rec_input_clauses): Disable SIMT for
user-defined
            reduction.

    libgomp/ChangeLog:

    2021-05-03  Tom de Vries  <tdevries@suse.de>

            PR target/100321
            * testsuite/libgomp.c/target-44.c: New test.


More information about the Gcc-bugs mailing list