OpenMP* Memory Spaces and Allocators
Values That Can Be Specified
A positive integer value that is a power of 2 specifying number of bytes
An allocator handle
a positive integer value
- allThis value indicates that the allocated memory must be accessible by all threads in the device where the memory allocation occurs.This is the default setting.
- cgroupThis value indicates that the allocated memory must be accessible by all threads of the same contention group as the thread that requested the allocation. Accessing the allocated memory thread that is not part of the same contention group results in undefined behavior.
- pteamThis value indicates that the allocated memory is accessible by all threads that bind to the same parallel region as the thread that requests the allocations. Access to the memory by a thread that does not bind to the same parallel region as the thread that allocated the memory results in undefined behavior.
- threadThis value indicates that the memory allocated is accessible only by the thread that allocated it. Attempts to allocate the memory by another thread result in undefined behavior.
- abort_fbThis value indicates that the program terminates if the allocation request fails.
- allocator_fbIf this value is specified and the allocation request fails, the allocation will be tried by the allocator specified by thefb_datatrait.
- default_mem_fbThis value indicates that a failed allocation request will be retried in theomp_default_mem_spacememory space. All traits for theomp_default_mem_spaceallocator should be set to the default trait values, except thefallbacktrait should be set tonull_fb. This is the default setting.
- null_fbThis value indicates the allocator returns a zero value when an allocation request fails.
- blockedThis value indicates the allocated memory is partitioned into blocks of memory of approximately equal size with one block per storage resource.
- environmentThis value indicates the allocated memory placement is determined by the runtime execution environment. This is the default setting.
- interleavedThis value indicates the allocated memory is distributed in a round-robin fashion across the storage resources.
- nearestThis value indicates that the allocated memory will be placed in the storage resource nearest to the thread that requested the allocation.
- If theaccesstrait has the value all, the value ofpool_sizeis the limit for all allocations for all threads having access to the allocator.
- If theaccesstrait of the allocator has the valuecgroup, the value ofpool_sizeis the limit for allocations made from the threads within the same contention group.
- For allocators with theaccessaccess trait value ofpteam, the value ofpool_sizeis the limit for allocations made within the same parallel team.
- If theaccesstrait has the valuethread, the value ofpool_sizeis the limit for allocations made from each thread using the allocator.
- An allocation request for more space than the value ofpool_sizeresults in the allocator not fulfilling the allocation request.
- contendedoruncontendedValuecontendedindicates that many threads are anticipated to make simultaneous allocation requests while the valueuncontendedindicates that few threads are anticipated to make simultaneous allocation. The default setting iscontended.
- privateThis value indicates that all allocation requests will come from the same thread. Specifyingprivatewhen this is not the case and two or more threads make allocation requests by the same allocator results in undefined behavior.
- serializedThis value indicates that only one thread will request an allocation at a given time. The behavior is undefined if two threads request an allocation simultaneously by an allocator whosesync_hintvalue is serialized.
- The system default memory is referred to asomp_default_mem_space.
- Large capacity memory is referred to asomp_large_cap_mem_space.
- High bandwidth memory is referred to asomp_high_bw_mem_space.
- Low latency memory is referred to asomp_low_lat_mem_space.
- Memory designed for optimal storage of constant values is referred to asomp_const_mem_space.It can be initialized with compile-time constant expressions or by using a firstprivate clause.Writing to variables inomp_const_mem_spaceresults in undefined behavior.
- omp_target_host_mem_spaceis host memory that is accessible by the device.
- omp_target_shared_mem_spaceis memory that can migrate between the host and the device.
- omp_target_device_mem_spaceis memory that is accessible to the device.
Associated Memory Space
Non-Default Trait Values