Skip to content

Capture modifier test for copy, copyout, and create clauses#130

Open
Ryanpadrone wants to merge 2 commits intoOpenACCUserGroup:masterfrom
Ryanpadrone:capture
Open

Capture modifier test for copy, copyout, and create clauses#130
Ryanpadrone wants to merge 2 commits intoOpenACCUserGroup:masterfrom
Ryanpadrone:capture

Conversation

@Ryanpadrone
Copy link
Copy Markdown

@Ryanpadrone Ryanpadrone commented Apr 14, 2026

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.

@ajarmusch ajarmusch added the v3.4 label Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants