Skip to content

Validate _Pragma support for directives in C and C++#121

Open
Ryanpadrone wants to merge 7 commits intoOpenACCUserGroup:masterfrom
Ryanpadrone:pragmaOperator
Open

Validate _Pragma support for directives in C and C++#121
Ryanpadrone wants to merge 7 commits intoOpenACCUserGroup:masterfrom
Ryanpadrone:pragmaOperator

Conversation

@Ryanpadrone
Copy link
Copy Markdown

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++)

@ajarmusch ajarmusch changed the title Validate _Pragma support for OpenACC directives in C and C++ Validate _Pragma support for directives in C and C++ Feb 26, 2026
@ajarmusch ajarmusch added the v3.4 label Feb 26, 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