Constants and device-memory helpers shared by the OpenMP target backend.
Device arrays are held as contiguous Fortran pointers whose target is a
raw omp_target_alloc allocation. The host never dereferences them: they
are only passed as actual arguments to the explicit-shape or assumed-size
dummies of the offloaded kernels, which name those dummies in an
OMP_DEVICE_ADDR clause to say "this array already lives on the
device", so the runtime neither maps nor copies it. Referencing such a
pointer directly inside a target region instead makes the runtime map
it implicitly, copying the whole array into a fresh device buffer and
back on every launch.
OMP_DEVICE_ADDR is a preprocessor macro set per compiler in
src/CMakeLists.txt, because no one spelling is accepted everywhere:
OpenMP 5.1 says has_device_addr, and its compilers (GNU, Flang, Cray,
ifx) allow is_device_ptr only on type(c_ptr); NVHPC rejects
has_device_addr but takes the OpenMP 4.5 form, is_device_ptr on a
dummy array. The preprocessors expand macros in !$omp lines.
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Variables
Type
Visibility
Attributes
Name
Initial
integer,
public,
parameter
::
SZ
=
64
Number of points a pencil group stacks together in the leading
dimension, set to the width the target hardware issues a wavefront at so
that one group fills one wavefront. The last branch covers a build that
selects no vendor.