@@ -156,21 +156,18 @@ \section{Memory Allocators}
156156An allocator is initialized for the \scode {target} region in the \scode {uses_allocators} clause,
157157and the traits specified in \splc {cgroup_traits} are included by the \scode {traits} modifier.
158158
159- As shown above, the \scode {uses_allocators} clause creates a new allocator for the
160- \scode {target} region, and uses only traits specified in the clause with a modifier.
161159In CASE 3, the \splc {cgroup_alloc} variable is initialized on the host with traits
162- and a memory space. However, these are ignored by the \scode {uses_allocators} clause,
163- because a new allocator is initialized, and has no traits specified within the clause .
160+ and a memory space. However, these are ignored by the \scode {uses_allocators} clause
161+ and a new allocator for the \scode {target} region is initialized with default traits .
164162
165163\cexample [5.2]{allocators}{5}
166164\ffreeexample [5.2]{allocators}{5}
167165
168- The following example shows how to make an allocator, defined on the host, available in a \scode {target} region.
166+ \index {dynamic_allocators clause@\scode {dynamic_allocators} clause}
167+ \index {clauses!dynamic_allocators@\scode {dynamic_allocators}}
169168
170- When the \scode {requires} directive is specified with a \scode {dynamic_allocators}
171- clause, allocators initialized on the host can be used in a \scode {target} region
172- without specifying a \scode {uses_allocators} clause. This applies to predefined
173- allocators and user-defined allocators.
169+ The following example shows how to make an allocator available in a \scode {target} region
170+ without specifying a \scode {uses_allocators} clause.
174171
175172In CASE 1, the predefined \scode {omp_cgroup_mem_alloc} allocator is used in the \scode {target}
176173region as in CASE 1 of the previous example, but without specifying a \scode {uses_allocators} clause.
@@ -179,9 +176,14 @@ \section{Memory Allocators}
179176restrictions on allocator usage in \scode {target} regions.
180177
181178CASE 2 also uses the \scode {dynamic_allocators} clause to remove allocator
182- restrictions in the \scode {target} region. Here, an allocator initialized
183- on the host is used for target array allocations of an \scode {allocate} clause.
184-
179+ restrictions in \scode {target} regions. Here, an allocator is initialized
180+ by calling the \scode {omp_init_allocator} routine in the \code {target} region.
181+ The allocator is then used for the allocations of array \plc {xbuf} in
182+ an \scode {allocate} clause of the \code {target}~\code {teams} construct
183+ for each team and destroyed after its use.
184+ The use of separate \code {target} regions is needed here since
185+ no statement is allowed between a \code {target} directive and
186+ its nested \code {teams} construct.
185187
186188\cexample [5.2]{allocators}{6}
187189\ffreeexample [5.2]{allocators}{6}
0 commit comments