Add integral-constant-expression validation for collapse, tile, cache, and gang clauses.#119
Open
Ryanpadrone wants to merge 15 commits intoOpenACCUserGroup:masterfrom
Open
Add integral-constant-expression validation for collapse, tile, cache, and gang clauses.#119Ryanpadrone wants to merge 15 commits intoOpenACCUserGroup:masterfrom
Ryanpadrone wants to merge 15 commits intoOpenACCUserGroup:masterfrom
Conversation
…, and gang clauses
got rid of literal int tests and wrote descriptions.
removed literal int tests, fixed formatting, and added descriptions
removed literal int tests and added descriptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature:
– This PR adds validation and verification tests for the OpenACC 3.4 clarification that introduces the term integral-constant-expression and aligns its meaning with the base languages (see §1.6).
– An integral constant expression is a compile-time constant integer expression as defined by the host language (C, C++, Fortran), and is required by the specification in several clauses and directives
What the tests validate:
The tests ensure that valid compile-time integer constants are accepted by compilers when used in positions where the OpenACC specification explicitly requires an integral constant expression, and that the associated constructs execute correctly at runtime.
Coverage includes the following spec locations:
Argument must be a positive, non-zero integral constant expression
Each tile size must be a positive, non-zero integral-constant-expression (or *).
Array element indices, lower bounds, and lengths may include integral-constant-expressions.
The dim argument must be an integral-constant-expression evaluating to 1, 2, or 3.
Test design:
Each language file contains seven tests (T1-T6) that:
•C: integer macros and enum constants
• C++: constexpr values and (scoped) enums
• Fortran: integer PARAMETER expressions
Test mapping
Notes on cache behavior
cache is a performance hint and may be ignored by implementations. The tests primarily validate syntax acceptance of integral-constant-expressions in cache subscript/range forms. In all three language versions (C, C++, and Fortran), the cache directive is placed inside the actual parallel loop body to maintain consistent structure across implementations. The cached array section or element uses integral-constant-expressions exactly where permitted by §2.10.
Expected compiler behavior and results
•NVHPC 25.5: Passes T1-T6
•GCC 15.2.0: Passes T1-T5; fails T6 (parser rejects "dim:" keyword form)
•Cray 18.0.0: Passes T1-T5 (may emit cache warnings); fails T6 (parser rejects "dim:" keyword form)
Failures in T6 occur at directive parse time, before ICE semantic checking, and indicate incomplete support for the dim: keyword syntax—not an invalid test or misuse of ICE.