Add Fortran tests for named constants in data and firstprivate clauses#118
Open
Ryanpadrone wants to merge 7 commits intoOpenACCUserGroup:masterfrom
Open
Add Fortran tests for named constants in data and firstprivate clauses#118Ryanpadrone wants to merge 7 commits intoOpenACCUserGroup:masterfrom
Ryanpadrone wants to merge 7 commits intoOpenACCUserGroup:masterfrom
Conversation
….F90 changed name of file
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:
OpenACC 3.4 section 1.6 clarifies that a Fortran named constant (PARAMETER) is a valid var and may appear anywhere a var is permitted in OpenACC syntax, including:
• compute clauses such as firstprivate
• data clauses such as copyin, present_or_copyin, and create
What this PR adds
– This PR introduces a new Fortran V&V test file, acc_named_constant.F90, that validates correct compiler and runtime behavior for named constants used in OpenACC clauses
These tests ensure that:
Named constants are accepted syntactically in both compute and data clauses
The constants value is correctly available on the device at runtime
Coverage includes:
--- Scalar and array named constants
--- INTEGER and REAL types
--- Compute (firstprivate) and data clause paths (copyin, create, present_or_copyin)
all named constants are used read-only, consistent with fortran semantics.
Test Coverage Summary
•T1-T2: firstprivate(PARAMETER)
verifies that scalar INTEGER and REAL named constants may appear in firstprivate clauses and are correctly initialized per device worker.
•T3: scalar named constant in copyin
Ensures named constants are treated as valid var items in data clause lists.
•T4: array named constant in firstprivate
Covers array descriptor handling in compute clauses.
•T5: array named constant in copyin
Covers array named constants in data clause lowering paths.
•T6: scalar named constant in create
Ensures named constants are accepted in data clause variants beyond copyin, and that their values are usable on the device.
•T7: scalar named constant in present_or_copyin
Extends data-clause coverage to combined/conditional data clauses, ensuring named constants are accepted and correctly usable on the device even when data presence is conditional.
–correctness is validated by device-sided computations that depend on the named constant and host-side verification results.
Compiler Results:
NVC: 25.5.0
--PASS
GCC: 15.2.0
--PASS(emits warnings about constants in clauses, but executes correctly)
CRAY: 18.0.0
--Fails at compile time (rejects named constants in clauses; behavior is non-conforming with OpenACC 3.4)