Skip to content

Add validation test for single if clause on data-related constructs#127

Open
Ryanpadrone wants to merge 1 commit intoOpenACCUserGroup:masterfrom
Ryanpadrone:singleIf
Open

Add validation test for single if clause on data-related constructs#127
Ryanpadrone wants to merge 1 commit intoOpenACCUserGroup:masterfrom
Ryanpadrone:singleIf

Conversation

@Ryanpadrone
Copy link
Copy Markdown

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.

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