%\pagebreak
\section{\kcode{requires} Directive}
\label{sec:requires}
\index{directives!requires@\kcode{requires}}
\index{requires directive@\kcode{requires} directive}

The declarative \kcode{requires} directive can be used to 
specify features that an implementation must provide to compile and 
execute correctly.

\index{requires directive@\kcode{requires} directive!unified_shared_memory clause@\kcode{unified_shared_memory} clause}
\index{clauses!unified_shared_memory@\kcode{unified_shared_memory}}
\index{unified_shared_memory clause@\kcode{unified_shared_memory} clause}
In the following example the \kcode{unified_shared_memory} clause 
of the \kcode{requires} directive ensures that the host and all 
devices accessible through OpenMP provide a \plc{unified address} space
for memory that is shared by all devices.

The example illustrates the use of the \kcode{requires} directive specifying
\plc{unified shared memory} in file scope, before any device 
directives or device routines. No \kcode{map} clause is needed for
the \ucode{p} structure on the device (and its address \ucode{\&p}, for the C++ code,
is the same address on the host and device).
However, scalar variables referenced within the \kcode{target}
construct still have a default data-sharing attribute of \kcode{firstprivate}.
The \ucode{q} scalar is incremented on the device, and its change is
not updated on the host.
% will defaultmap(toform:scalar) make q use shared address space? 
%Or will it be ignored at this point.
% Does before device routines also mean before prototype?

%\pagebreak

\cppexample[5.0]{requires}{1}

\ffreeexample[5.0]{requires}{1}
