20 Commits

Author SHA1 Message Date
erichkeane
d47401e376 [OpenACC] Start enforcing 'device_type' clause values
Researching in prep of doing the implementation for lowering, I found
that the source of the valid identifiers list from flang is in the
frontend.  This patch adds the same list to the frontend, but does it as
a sema diagnostic, so we still parse it as an identifier/identifier-like
thing, but then diagnose it as invalid later.
2025-04-09 14:55:50 -07:00
erichkeane
6263de90df [OpenACC] Implement 'modifier-list' sema/AST
OpenACC 3.3-NEXT has changed the way tags for copy, copyin, copyout, and
create clauses are specified, and end up adding a few extras, and
permits them as a list.  This patch encodes these as bitmask enum so
they can be stored succinctly, but still diagnose reasonably.
2025-04-04 12:32:33 -07:00
erichkeane
bb8a7a7349 [OpenACC] Implement 'pqr-list' has at least one 1 item.
OpenACC Github PR#499 defines the pqr-list as having at least 1 item. We
already handle that for all but 'wait', so this patch just does the work
to add it for 'wait', plus adds tests.
2025-04-02 13:33:18 -07:00
erichkeane
bfc2dbe02e [OpenACC] Implement data construct 'at least 1 of ... clauses' rule
All 4 of the 'data' constructs have a requirement that at least 1 of a
small list of clauses must appear on the construct.  This patch
implements that restriction, and updates all of the tests it takes to
do so.
2024-12-16 11:52:57 -08:00
erichkeane
fbb14dd977 [OpenACC] Implement 'use_device' clause AST/Sema
This is a clause that is only valid on 'host_data' constructs, and
identifies variables which it should use the current device address.
From a Sema perspective, the only thing novel here is mild changes to
how ActOnVar works for this clause, else this is very much like the rest
of the 'var-list' clauses.
2024-12-16 09:35:57 -08:00
erichkeane
1ab81f8e7f [OpenACC] Implement 'delete' AST/Sema for 'exit data' construct
'delete' is another clause that has very little compile-time
implication, but needs a full AST that takes a var list.  This patch
ipmlements it fully, plus adds sufficient test coverage.
2024-12-16 06:44:53 -08:00
erichkeane
3351b3bf8d [OpenACC] implement 'detach' clause sema
This is another new clause specific to 'exit data' that takes a pointer
argument. This patch implements this the same way we do a few other
clauses (like attach) that have the same restrictions.
2024-12-13 13:51:41 -08:00
erichkeane
2244d2e75c [OpenACC] Implement 'if_present' clause sema
The 'if_present' clause controls the replacement of addresses in the
var-list in current device memory.  This clause can only go on
'host_device'.  From a Sema perspective, there isn't anything to do
beyond add this to AST and pass it on.
2024-12-13 13:04:57 -08:00
erichkeane
003eb5e80d [OpenACC] Implement 'finalize' clause sema
This is a very simple clause as far as sema is concerned.  It is only
valid on 'exit data', and doesn't have any rules involving it, so it is
simply applied and passed onto the MLIR.
2024-12-13 10:41:02 -08:00
erichkeane
6d69d18437 [OpenACC] enable 'attach' clause sema for 'data' and 'enter data'
This is very similar to deviceptr, and is the same implementation as for
combined/compute constructs, so this just enables that, and adds tests.
2024-12-13 09:24:20 -08:00
erichkeane
754499c1e9 [OpenACC] Enable 'deviceptr' clause sema on data construct
Another simple implementation, as it uses the same work as the previous
implementation, just enabling it for this construct.
2024-12-13 08:38:55 -08:00
erichkeane
331f3cc94b [OpenACC] enable 'present' clause for 'data' construct
No additional sema is required once again, so this patch adds testing
and enables the clause.
2024-12-13 08:11:28 -08:00
erichkeane
1da0730ba5 [OpenACC] enable 'copyout' clause sema for data constructs
Same as the previous few, this just enables copyout for data constructs
and ensures we have sufficient test coverage.
2024-12-13 07:50:29 -08:00
erichkeane
b2b1eec2b2 [OpenACC] enable 'copyin' clause sema for 'data'/'enter data'
stop reporting 'copyin' as not implemented on a data/enter data
construct, and enforce sema rules.
2024-12-13 07:31:18 -08:00
erichkeane
5048808859 [OpenACC] Implement 'default' Sema for 'data' clause
No additional rules here beyond enabling it, this patch just enables
'default' and adds tests.
2024-12-12 12:54:02 -08:00
erichkeane
afcb7d4a2e [OpenACC] Implement 'wait' sema for data constructs
This is once again simply enabling this for 'data', 'enter data', and
'exit data' (and ensuring we error for 'host_data').  Implementation is
very simply to enable it rather than emit the not-implemented
diagnostic.
2024-12-12 12:16:20 -08:00
erichkeane
f0f8434afa [OpenACC] Implement sema for 'async' on 'data' constructs
This also is a clause that doesn't have any special rules, so this patch
enables it and adds tests.
2024-12-12 10:55:27 -08:00
erichkeane
6cfad635d5 [OpenACC] Implement 'if' clause sema for 'data' constructs
This is another one that has no additional sema work other than enabling
it, so this patch does just that.
2024-12-12 09:59:09 -08:00
erichkeane
8eec301fe3 [OpenACC] Implement 'device_type' for 'data' construct
Semantically this is identical to all other constructs with this tag,
except in this case the 'wait' and 'async' are the only ones allowed
after it. This patch implements that rule using the existing
infrastructure.
2024-12-12 08:37:20 -08:00
erichkeane
010d0115fc [OpenACC] Create AST nodes for 'data' constructs
These constructs are all very similar and closely related, so this patch
creates the AST nodes for them, serialization, printing/etc.
Additionally the restrictions are all added as tests/todos in the tests,
as those will have to be implemented once we get those clauses implemented.
2024-12-12 07:28:30 -08:00