Add validation test for single if clause on data-related constructs#127
Open
Ryanpadrone wants to merge 1 commit intoOpenACCUserGroup:masterfrom
Open
Add validation test for single if clause on data-related constructs#127Ryanpadrone wants to merge 1 commit intoOpenACCUserGroup:masterfrom
Ryanpadrone wants to merge 1 commit 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 Description
These files add validation tests for a clarification introduced in the OpenACC 3.4 specification affecting the use of the if clause on several data-related constructs.
Sections 2.6.5, 2.6.6 and 2.8 of the specification clarify and normalize that the following constructs may contain at most one if clause:
• data
• enter data
• exit data
• host_data
Earlier versions of the specification allowed the usage of if clauses on these constructs, but the restriction on the number of if clauses was not stated consistently. OpenACC 3.4 explicitly defines that only a single if clause may appear on these directives.
Tests added
acc_single_if_clauas_data.c
acc_single_if_clauas_data.cpp
acc_single_if_clauas_data.F90
Test Coverage
The tests verify correct behavior when a single valid if clause is used on the constructs affected by the specification clarification.
T1: Executes a data region using if(dev) and verifies correct data movement and computation.
Construct: data
T2: Uses enter data and exit data directives with if(dev) to manage device memory and validate computation results.
Construct: enter data / exit data
T3: Uses host_data use_device(a) if(dev) to verify that the construct accepts a single if clause and correctly exposes the device pointer.
Construct: host_data
T4: Uses both constructs in the same region, each with a single if clause, verifying that constructs may independently include a valid if clause.
Construct: data + host_data
These tests are positive validation tests, confirming correct behavior for legal single-if clause usage as defined by the OpenACC 3.4 specification
Compiler Testing
NVHPC 26.1 – PASS
GCC 15.2.0 – PASS
CRAY 18.0.0 – PASS
Summary
This pr adds validation tests ensuring correct support for single if clause usage on data-related constructs as clarified in the OpenACC 3.4. The tests confirm that compilers correctly accept and execute directives containing a single if clause across the affected constructs and languages.