From: Aldy Hernandez <aldyh@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [gomp4.1] depend(sink) and depend(source) parsing for C
Date: Mon, 13 Jul 2015 17:11:00 -0000 [thread overview]
Message-ID: <55A3F147.10301@redhat.com> (raw)
In-Reply-To: <20150713135618.GQ1788@tucnak.redhat.com>
On 07/13/2015 06:56 AM, Jakub Jelinek wrote:
> On Sat, Jul 11, 2015 at 11:35:36AM -0700, Aldy Hernandez wrote:
> On the C++ FE side, please also try a testcase in g++.dg/gomp/ where
> the ordered(n) loop with #pragma omp ordered depend({source,sink}) will be
> in a template, to make sure pt.c does the right thing with it.
I assume you mean something like:
void bar (int, int, int);
template<typename T>
T baz (T arg)
{
int i, j, k;
#pragma omp parallel for ordered(2)
for (i=0; i < 100; ++i)
for (j=0; j < 100; ++j)
{
#pragma omp ordered depend(sink:i-3,j)
bar (i, j, 0);
}
return arg;
}
int main()
{
return baz<int>(5);
}
??
Also, was this supposed to work?:
template<int N>
int foo()
{
int i, j, k;
#pragma omp parallel for ordered(N)
for (i=0; i < 100; ++i)
for (j=0; j < 100; ++j)
{
extern void bark();
bark();
}
}
The above was broken before I arrived.
And if this last example is supposed to work, I should probably address
the same thing for sink offsets.
> If you want to spend time on something still in the FE, it would be nice to
> resolve the C++ iteration var issue (i.e. increase OMP_FOR number of
> arguments, so that it could have yet another (optional) vector, say
> OMP_FOR_ORIG_DECLS. If that vector would be NULL, the gimplifier would
> assume that all the decls in OMP_FOR_INIT are the ones present in the
> source, if it would be present, you'd use them for the variable checking
> instead of the ones from OMP_FOR_INIT (but, replace them with the
> decls from OMP_FOR_INIT after the checking).
>
> There is another issue - if some iterator var has pointer type, supposedly
> we want somewhere in the FEs already multiply it by the size of what they
> point to (and convert to sizetype). For C FE, it can be done already during
> parsing, we should know the type of the iterator var already at that point,
> for C++ FE it needs to be done only in finish_omp_clauses if
> !processing_template_decl, because in templates we might not know the type.
Sure. As follow-ups?
Aldy
next prev parent reply other threads:[~2015-07-13 17:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 19:22 Aldy Hernandez
2015-07-09 18:53 ` Jakub Jelinek
2015-07-10 18:03 ` Aldy Hernandez
2015-07-11 18:35 ` Aldy Hernandez
2015-07-11 18:55 ` Aldy Hernandez
2015-07-13 13:56 ` Jakub Jelinek
2015-07-13 17:11 ` Aldy Hernandez [this message]
2015-07-13 17:32 ` Jakub Jelinek
2015-07-14 14:07 ` Aldy Hernandez
2015-07-14 14:15 ` 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=55A3F147.10301@redhat.com \
--to=aldyh@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
/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).