5 Commits

Author SHA1 Message Date
erichkeane
8313d2a8db [OpenACC] Fixup previous-clause diagnostics
Brought up in a previous review as a TODO, we could be better about how
we highlight what hte previous clause was, and how to show that the
'device_type' is the one being targetted.  This patch rewords the
diagnostics and updates a massive number of tests.
2025-05-02 09:35:32 -07:00
erichkeane
3a4b9f3891 [OpenACC] Implement 'gang' clause for Combined Constructs
This one is a bit complicated, as it has some interesting interactions,
as 'gang' Sema is required to look at its containing compute construct.
Except in the case of a combined construct, they are the same. This
resulted in a large refactor of the checking code for CheckGangExpr,
plus some additional work on the diagnostics for its interaction with
'num_gangs' and 'vector'/'worker'.
2024-12-05 06:35:36 -08:00
erichkeane
e3446b9a07 [OpenACC] Fix bug with worker/vector/gang clause inside another
The original implementation rejected some valid constructs.  The rule is
supposed to be:

Gang-on-Kernel cannot have a gang in its region

Worker cannot have a worker or gang in its region

Vector cannot have worker, gang, or vector in its region.

The previous implementation improperly implemented that vector wasnt'
allowed in the other two.  This patch fixes it and adds testing for it.
2024-12-04 10:34:50 -08:00
Erich Keane
b0cfbfd74b
[OpenACC] Implement loop restrictions on for loops. (#115370)
OpenACC restricts the contents of a 'for' loop affected by a 'loop'
construct without a 'seq'. The loop variable must be integer, pointer,
or random-access-iterator, it must monotonically increase/decrease, and
the trip count must be computable at runtime before the function.

This patch tries to implement some of these limitations to the best of
our ability, though it causes us to be perhaps overly restrictive at the
moment. I expect we'll revisit some of these rules/add additional
supported forms of loop-variable and 'monotonically increasing' here,
but the currently enforced rules are heavily inspired by the OMP
implementation here.
2024-11-08 05:49:45 -08:00
Erich Keane
5b25c31351
[OpenACC] Implement loop 'gang' clause. (#112006)
The 'gang' clause is used to specify parallel execution of loops, thus
has some complicated rules depending on the 'loop's associated compute
construct. This patch implements all of those.
2024-10-11 09:05:19 -07:00