Validate _Pragma support for directives in C and C++#121
Open
Ryanpadrone wants to merge 7 commits intoOpenACCUserGroup:masterfrom
Open
Validate _Pragma support for directives in C and C++#121Ryanpadrone wants to merge 7 commits intoOpenACCUserGroup:masterfrom
Ryanpadrone wants to merge 7 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.
Feature
OpenACC 3.4 Section 2.1 clarifies that in C and C++, OpenACC directives may be written either as #pragma acc ... or equivalently using the standard C/C++ _Pragma("acc ...") operator form. This is primarily a front-end conformance requirement: compilers must correctly recognize and apply OpenACC directives expressed via _Pragma.
What this PR adds
This PR introduces two new Validation & Verification test files:
•acc_pragma_operator.c
•acc_pragma_operator.cpp
Each file contains two tests that use _Pragma("acc ...") and validate correct runtime behavior by comparing device-computed results against expected host values.
Test coverage
•T1: Uses _Pragma for structured and loop-associated directives:
data(copyin/copy), parallel, and loop, verifying correct computation and implicit copy-back for the output array.
•T2: Uses _Pragma for standalone executable data directives:
enter data(copyin/create), then parallel present(...) + loop, followed by exit data(copyout/delete) to validate explicit data lifetime management and correct copy-back.
Compiler validation
Verified locally with:
•GCC 15.2.0
•NVIDIA NVHPC 25.5
Results
•PASS on GCC 15.2.0 (C and C++)
•PASS on NVHPC 25.5 (C and C++)