HOME
| OPENMP API Specification: Version 5.1 November 2020

2.14.3  target enter data Construct

Summary The target enter data directive specifies that variables are mapped to a device data environment. The target enter data directive is a stand-alone directive.

Syntax

SVG-Viewer needed.

The syntax of the target enter data construct is as follows:  

 
#pragma omp target enter data [clause[ [,] clause] ... ] new-line  

where clause is one of the following:  

 
if([ target enter data :] scalar-expression) 
device(integer-expression) 
map([map-type-modifier[,] [map-type-modifier[,] ...]] map-type: locator-list) 
depend([depend-modifier,] dependence-type : locator-list) 
nowait  

SVG-Viewer needed.

SVG-Viewer needed.

The syntax of the target enter data is as follows:  

 
!$omp target enter data [clause[ [,] clause] ... ]  

where clause is one of the following:  

 
if([ target enter data :] scalar-logical-expression) 
device(scalar-integer-expression) 
map([map-type-modifier[,] [map-type-modifier[,] ...]] map-type: locator-list) 
depend([depend-modifier,] dependence-type : locator-list) 
nowait  

SVG-Viewer needed.

Binding The binding task set for a target enter data region is the generating task, which is the target task generated by the target enter data construct. The target enter data region binds to the corresponding target task region.

Description When a target enter data construct is encountered, the list items are mapped to the device data environment according to the map clause semantics.

The target enter data construct is a task generating construct. The generated task is a target task. The generated task region encloses the target enter data region.

All clauses are evaluated when the target enter data construct is encountered. The data environment of the target task is created according to the data-mapping attribute clauses on the target enter data construct, per-data environment ICVs, and any default data-sharing attribute rules that apply to the target enter data construct. If a variable or part of a variable is mapped by the target enter data construct, the variable has a default data-sharing attribute of shared in the data environment of the target task.

Assignment operations associated with mapping a variable (see Section 2.21.7.1) occur when the target task executes.

If the nowait clause is present, execution of the target task may be deferred. If the nowait clause is not present, the target task is an included task.

If a depend clause is present, it is associated with the target task.

If no device clause is present, the behavior is as if the device clause appears with an expression equal to the value of the default-device-var ICV.

When an if clause is present and the if clause expression evaluates to false, the target device is the host.

Execution Model Events Events associated with a target task are the same as for the task construct defined in Section 2.12.1.

The target-enter-data-begin event occurs when a thread enters a target enter data region.

The target-enter-data-end event occurs when a thread exits a target enter data region.

Tool Callbacks Callbacks associated with events for target tasks are the same as for the task construct defined in Section 2.12.1; (flags & ompt_task_target) always evaluates to true in the dispatched callback.

A thread dispatches a registered ompt_callback_target or ompt_callback_target_emi callback with ompt_scope_begin as its endpoint argument and ompt_target_enter_data or ompt_target_enter_data_nowait if the nowait clause is present as its kind argument for each occurrence of a target-enter-data-begin event in that thread in the context of the target task on the host. Similarly, a thread dispatches a registered ompt_callback_target or ompt_callback_target_emi callback with ompt_scope_end as its endpoint argument and ompt_target_enter_data or ompt_target_enter_data_nowait if the nowait clause is present as its kind argument for each occurrence of a target-enter-data-end event in that thread in the context of the target task on the host. These callbacks have type signature ompt_callback_target_t or ompt_callback_target_emi_t, respectively.

Restrictions Restrictions to the target enter data construct are as follows:

Cross References