Capture modifier test for copy, copyout, and create clauses#130
Open
Ryanpadrone wants to merge 2 commits intoOpenACCUserGroup:masterfrom
Open
Capture modifier test for copy, copyout, and create clauses#130Ryanpadrone wants to merge 2 commits intoOpenACCUserGroup:masterfrom
Ryanpadrone wants to merge 2 commits intoOpenACCUserGroup:masterfrom
Conversation
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.
PR Description
This PR adds new OpenACC Validation & Verification tests for the capture modifier introduced in OpenACC 3.4
The capture modifier ensures that a variable is given a discrete device-accessible copy, even when the implementation might otherwise treat the variable as residing in shared memory. This feature improves portability and consistency of data behavior across different memory models.
Feature Being Tested
OpenACC 3.4 introduces the capture modifier for data clauses, allowing it to appear on structured data and compute constructs. The modifier enforces that a separate device copy is created and used during execution.
This PR tests capture in the context of the following clauses:
•copy
•copyout
•create
Test Descriptions
T1 - copy(capture:...)
• Verifies that a captured copy is created at the beginning of a data region.
• The host array is modified after entering the region.
• The device computation must use the original captured values, not the updated host values.
• Confirms correct snapshot semantics of capture by observing different host and device values.
T2 - copyout(capture:...)
• Verifies that a captured device copy is created and used independently of the host.
• The device array is initialized on the device, then the host array is modified afterward.
• The device computation must use its captured values and not reflect later host updates.
• Confirms correct isolation of device memory and proper copyout of final results to the host.
T3 - create(capture:...)
• Verifies that a captured device-only copy is created and used across compute regions.
• The host version of the variable is modified after capture.
• The device computation must use its own captured copy, not the updated host values.
• Confirms that the device copy remains independent and that the host value is unchanged (no implicit copyout).
Compiler Testing
NVHPC 26.1
• Results: PASS
• All tests compiled successfully
• All tests executed with return code 0
• Compiler output shows expected data clauses (copy, copyout, create)
• Indicates support for OpenACC 3.4 capture modifier.
GCC 15.2.0
• Results: FAIL
• Errors indicate capture is not recognized in data clauses.
• Suggests lack of OpenACC 3.4 capture support.
CRAY 18.0.0
• Results: FAIL
• Similar parsing errors as GCC.
• capture treated as an undeclared identifier.
• Indicates feature not yet supported.
Conclusion
• The added tests correctly exercise the semantics of the OpenACC 3.4 capture modifier.
• NVHPC demonstrates support for the feature with correct runtime behavior.
• GCC and Cray compilers currently do not support the capture modifier in data clauses.
• These tests provide meaningful coverage for a new 3.4 feature and help track compiler adoption.