public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: Bernd Schmidt <bschmidt@redhat.com>,
	gcc-patches@gcc.gnu.org,        Nathan Sidwell <nathan@acm.org>
Subject: Re: [PATCH 0/8] NVPTX offloading to NVPTX: backend patches
Date: Tue, 18 Oct 2016 21:07:00 -0000	[thread overview]
Message-ID: <20161018210651.GO7282@tucnak.redhat.com> (raw)
In-Reply-To: <alpine.LNX.2.20.13.1610181619460.16847@monopod.intra.ispras.ru>

On Tue, Oct 18, 2016 at 07:58:49PM +0300, Alexander Monakov wrote:
> On Tue, 18 Oct 2016, Bernd Schmidt wrote:
> > The performance I saw was lower by a factor of 80 or so compared to their CUDA
> > version, and even lower than OpenMP on the host.
> 
> The currently published OpenMP version of LULESH simply doesn't use openmp-simd
> anywhere. This should make it obvious that it won't be anywhere near any
> reasonable CUDA implementation, and also bound to be below host performance.

Yeah, perhaps just changing some or all #pragma omp distribute parallel for
into #pragma omp distribute parallel for simd could do something (of course,
one should actually analyze what it does, but if it is valid for distribute
without dist_schedule clause, then the loops ought to be without forward or
backward lexical dependencies (teams can't really synchronize, though they
can use some atomics).
That said, the OpenMP port of LULESH doesn't seem to be done very carefully,
e.g. in CalcHourglassControlForElems I see:
      /* Do a check for negative volumes */
      if ( v[i] <= Real_t(0.0) ) {
        vol_error = i;
      }
There is not any kind of explicit mapping of vol_error nor reduction of it,
so while in OpenMP 4.0 it would be just a possible data race (the var would
be map(tofrom: vol_error) by default and shared between teams/threads, so if
more than one thread decides to write it, it is a data race, in OpenMP 4.5
it is implicitly firstprivate(vol_error) and thus the changes to the var
(still racy) would just never be propagated back to the caller.

For the missing simd regions, it might be helpful if we were able to
"autovectorize" into the SIMT, but I guess that might be quite a lot of
work.

	Jakub

  reply	other threads:[~2016-10-18 21:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14 16:40 Alexander Monakov
2016-10-14 16:40 ` [PATCH 2/8] nvptx: implement predicated instructions Alexander Monakov
2016-10-14 16:40 ` [PATCH 4/8] nvptx -mgomp Alexander Monakov
2016-10-14 16:40 ` [PATCH 7/8] nvptx backend: new insns for OpenMP SIMD-via-SIMT Alexander Monakov
2016-10-14 16:40 ` [PATCH 3/8] nvptx -muniform-simt Alexander Monakov
2016-10-14 16:40 ` [PATCH 1/8] nvptx -msoft-stack Alexander Monakov
2016-10-14 16:40 ` [PATCH 8/8] nvptx: handle OpenMP "omp target entrypoint" Alexander Monakov
2016-10-14 16:40 ` [PATCH 5/8] nvptx mkoffload: pass -mgomp for OpenMP offloading Alexander Monakov
2016-10-14 16:40 ` [PATCH 6/8] new target hook: TARGET_SIMT_VF Alexander Monakov
2016-10-17 15:51 ` [PATCH 0/8] NVPTX offloading to NVPTX: backend patches Bernd Schmidt
2016-10-17 17:08   ` Alexander Monakov
2016-10-18 11:03     ` Bernd Schmidt
2016-10-18 16:59       ` Alexander Monakov
2016-10-18 21:07         ` Jakub Jelinek [this message]
2016-10-19 10:39         ` Bernd Schmidt
2016-11-11 13:02           ` Bernd Schmidt
2016-11-11 15:36             ` Alexander Monakov
2016-11-11 15:38               ` Bernd Schmidt
2016-10-19 12:19         ` Jakub Jelinek
2016-10-19 10:35       ` Alexander Monakov
  -- strict thread matches above, loose matches on Subject: below --
2016-06-09 16:54 Alexander Monakov
2016-06-09 17:00 ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161018210651.GO7282@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=amonakov@ispras.ru \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).