HOME
| OPENMP API Specification: Version 5.1 November 2020

2.13.4  allocate Clause

Summary The allocate clause specifies the memory allocator to be used to obtain storage for private variables of a directive.

Syntax The syntax of the allocate clause is one of the following:  

 
allocate([allocator:] list) 
allocate(allocate-modifier [, allocate-modifier]: list)  

where allocate-modifier is one of the following:  

 
allocator(allocator) 
align(alignment)  

where alignment is a constant positive integer expression with a value that is a power of two; and

SVG-Viewer needed.

where allocator is an expression of the omp_allocator_handle_t type.

SVG-Viewer needed.

SVG-Viewer needed.

where allocator is an integer expression of the omp_allocator_handle_kindkind.

SVG-Viewer needed.

Description The storage for new list items that arise from list items that appear in the directive is provided through a memory allocator. If an allocator is specified in the clause, that allocator is used for allocations. If no allocator is specified in the clause and the directive is not a target directive then the memory allocator that is specified by the def-allocator-var ICV is used for the list items that are specified in the allocate clause. If no allocator is specified in the clause and the directive is a target directive the behavior is unspecified. If the alignallocate-modifier is specified then the allocation of each list item is byte aligned to at least the maximum of the alignment required by the base language for the type of that list item, the alignment trait of the allocator and the alignment value of the alignallocate-modifier.If the alignallocate-modifier is not specified then the allocation of each list item is byte aligned to at least the maximum of the alignment required by the base language for the type of that list item and the alignment trait of the allocator.

For allocations that arise from this clause the null_fb value of the fallback allocator trait behaves as if the abort_fb had been specified.

Restrictions Restrictions to the allocate clause are as follows:

Cross References