SummaryThe targetexitdata directive specifies that list items are unmapped from a device data
environment. The targetexitdata directive is a stand-alone directive.
Syntax
The syntax of the targetexitdata construct is as follows:
BindingThe binding task set for a targetexitdata region is the generating task, which is the target
task generated by the targetexitdata construct. The targetexitdata region binds to the
corresponding target task region.
DescriptionWhen a targetexitdata construct is encountered, the list items in the map clauses are
unmapped from the device data environment according to the map clause semantics.
The targetexitdata construct is a task generating construct. The generated task is a target task. The
generated task region encloses the targetexitdata region.
All clauses are evaluated when the targetexitdata construct is encountered. The data environment
of the target task is created according to the data-sharing attribute clauses on the targetexitdata
construct, per-data environment ICVs, and any default data-sharing attribute rules that apply to the
targetexitdata construct. A variable that is mapped in the targetexitdata
construct 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.19.7.1 on page 939) 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 default device is determined by the default-device-var ICV.
When an if clause is present and the if clause expression evaluates to false, the 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.10.1 on
page 384.
The target-exit-data-begin event occurs when a thread enters a targetexitdata region.
The target-exit-data-end event occurs when a thread exits a targetexitdata region.
Tool Callbacks
Callbacks associated with events for target tasks are the same as for the task construct defined in
Section 2.10.1 on page 384; (flags&ompt_task_target) always evaluates to true in the dispatched
callback.
A thread dispatches a registered ompt_callback_target callback with ompt_scope_begin as its
endpoint argument and ompt_target_exit_data as its kind argument for each occurrence of a
target-exit-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 callback with ompt_scope_end as its endpoint
argument and ompt_target_exit_data as its kind argument for each occurrence of a
target-exit-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.
Restrictions
A
program
must
not
depend
on
any
ordering
of
the
evaluations
of
the
clauses
of
the
targetexitdata
directive,
or
on
any
side
effects
of
the
evaluations
of
the
clauses.
At
least
one
map
clause
must
appear
on
the
directive.
At
most
one
device
clause
can
appear
on
the
directive.
The
device
clause
expression
must
evaluate
to
a
non-negative
integer
value
less
than
the
value
of
omp_get_num_devices()
or
to
the
value
of
omp_get_initial_device().
At
most
one
if
clause
can
appear
on
the
directive.
A
map-type
must
be
specified
in
all
map
clauses
and
must
be
either
from,
release,
or
delete.
At
most
one
nowait
clause
can
appear
on
the
directive.
Cross References
default-device-var,
see
Section 2.5.1
on
page 172.