HOME
| OPENMP API Specification: "Version 5.2 -- GIT rev 95b2e3a44"

13.9  target update Construct

Name: target update

Association: none

Category: executable

Properties: parallelism-generating, task-generating, device, device-affecting

Clauses

depend, device, from, if, nowait, to

Clause set

Properties: required

Members: from, to

Binding

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

Semantics

The target update directive makes the corresponding list items in the device data environment consistent with their original list items, according to the specified data-motion-clauses. The target update construct generates a target task. The generated task region encloses the target update region. If a depend clause is present, it is associated with the target task. 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.

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

Assignment operations associated with any motion clauses occur when the target task executes. When an if clause is present and the if clause expression evaluates to false, no assignments occur.

Execution Model Events

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

The target-update-begin event occurs after creation of the target task and completion of all predecessor tasks that are not target tasks for the same device.

The target-update-end event occurs after all other events associated with the target update construct.

The target-data-op-begin event occurs in the target update region before a thread initiates a data operation on the target device.

The target-data-op-end event occurs in the target update region after a thread initiates a data operation on the target device.

Tool Callbacks

Callbacks associated with events for target tasks are the same as for the task construct defined in Section 12.5; (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_update or ompt_target_update_nowait if the nowait clause is present as its kind argument for each occurrence of a target-update-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_update or ompt_target_update_nowait if the nowait clause is present as its kind argument for each occurrence of a target-update-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.

A thread dispatches a registered ompt_callback_target_data_op_emi callback with ompt_scope_begin as its endpoint argument for each occurrence of a target-data-op-begin event in that thread. Similarly, a thread dispatches a registered ompt_callback_target_data_op_emi callback with ompt_scope_end as its endpoint argument for each occurrence of a target-data-op-end event in that thread. These callbacks have type signature ompt_callback_target_data_op_emi_t.

A thread dispatches a registered ompt_callback_target_data_op callback for each occurrence of a target-data-op-end event in that thread. The callback occurs in the context of the target task and has type signature ompt_callback_target_data_op_t.

Cross References