The GOMP project consists of implementation of OpenMP and OpenACC to
permit annotating the source code to permit running it concurrently with
thread parallelization and on offloading devices (accelerators
such
as GPUs), including the associated run-time library and API routines. Both
OpenMP and OpenACC are supported with GCC's C, C++ and Fortran compilers.
-fopenmp
.
-fopenmp-simd
can be used
to enable only the SIMD vectorization and loop-transformation constructs
without creating multiple threads, offloading code or adding a library
dependency.-fopenacc
.-foffload=
to disable or specify the offload-devices to be
used. Use -foffload-options=
to pass device-specific compiler and
linker flags.Diagnostics
-fopt-info
flag provides details about optimizations
at compile time.The GOMP project has developed an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection and is further improving it. As part of the GNU Project, GOMP simplifies parallel programming for all GNU system variants. This effort operates in an open environment to attract developers and ensure applicability across multiple architectures and applications.
Traditionally, programmers have used architecture-specific methods to effectively program tightly-parallelized computers — high band-width clusters, SMP machines, or multi-core processors. Parallel programming has thus been a time-consuming and arcane task.
OpenMP offers a simple way of exploiting parallelism without interfering with algorithm design. An OpenMP program compiles and operates correctly in both parallel and serial execution environments. Using OpenMP's directive-based parallelism also simplifies converting existing serial code to efficient parallel code.
OpenMP additionally permits to offload computations to accelerators such as GPUs, making use of their highly parallel computation support. If no accelerator is available, as fallback, the computation is done on the host.
To remain relevant, free software development tools must support emerging technologies. By implementing OpenMP, GOMP provides a simple tool for creating software targeted at parallel architectures. OpenMP's platform-neutral syntax meshes well with the portability goals of GCC and other GNU projects.
GOMP includes a support library (libgomp) and extensions to target language parsers. A long-term goal is the generation of efficient and small code for OpenMP applications.
When support for OpenACC was added, the project name GOMP
was reinterpreted as GNU Offloading and Multi-Processing
instead
of denoting GNU OpenMP
.
We encourage everyone to contribute changes and help test GOMP. GOMP has been merged into mainline GCC.
Please add openmp
or openacc
to the keywords field when
filing a bug report.
Implementation status in libgomp manual: Mainline (GCC 15), GCC 14, GCC 13, GCC 12.
Disclaimer: A feature might be only fully supported in a later GCC version than listed, depending on resolved corner cases and optimizations.
Feature | GCC Version | Comments |
---|---|---|
in_reduction clause on task constructs |
GCC 9 | |
Supporting C++'s range-based for loop | GCC 9 | |
Iterators | GCC 9 | |
!= as relational-op in canonical loop form for C/C++ | GCC 9 | |
C/C++'s lvalue expressions in depend clauses |
GCC 9 | |
mutexinoutset dependence-type for depend clause |
GCC 9 | |
depobj construct and depend objects |
GCC 9 | |
depend clause on taskwait |
GCC 9 | |
teams construct outside an enclosing target region |
GCC 9 | |
Clauses if , nontemporal and order(concurrent) in simd construct |
GCC 9/GCC 10 | |
defaultmap extensions |
GCC 9 | |
hint clause on the atomic construct |
GCC 9 | Stub only |
Weak memory ordering clauses on atomic and flush construct |
GCC 9 | |
Combined master constructs | GCC 9 | |
Runtime routines and environment variables to display runtimethread affinity information | GCC 9 | |
omp_pause_resource and omp_pause_resource_all runtime routines |
GCC 9 | |
nonmonotonic as default loop schedule modifier for worksharing-loop constructs |
GCC 9 | |
atomic constructs in simd |
GCC 9 | |
task_reduction clause with taskgroup |
GCC 9 | |
task modifier to reduction clause |
GCC 9 | |
reduction and in_reduction clauses on taskloop and taskloop simd constructs |
GCC 9 | |
taskloop construct cancelable by cancel construct |
GCC 9 | |
Lock hints were renamed to synchronization hints | GCC 9 | |
requires directive |
GCC 9 GCC 12 GCC 13 GCC 14 GCC 15 |
(atomic_default_mem_order )( dynamic_allocators )complete but no non-host devices provides unified_address or
unified_shared_memory complete but no non-host devices provides unified_shared_memory complete; see also Offload-Target Specifics |
conditional modifier to lastprivate clause |
GCC 10 | |
scan directive and in_scan modifier for the reduction clause |
GCC 10 | |
order(concurrent) clause |
GCC 10 | |
loop construct |
GCC 10 | |
declare variant directive |
GCC 10/GCC 11 | simd traits not handled correctly |
use_device_addr clause on target data |
GCC 10 | |
Nested declare target directive |
GCC 10 | |
allocate clause |
GCC 11 | Clause has no effect on target (PR113436) |
target-offload-var ICV and OMP_TARGET_OFFLOAD env variable |
GCC 11 | |
Predefined memory spaces, memory allocators, allocator traits | GCC 11 | Some are only stubs; see Memory Allocation |
Non-rectangular loop nests | GCC 11 GCC 13 |
C/C++ (full) Fortran (partial, PR110735) |
Nested-parallel changes to max-active-levels-var ICV | GCC 11 | |
detach clause to task construct |
GCC 11 | |
omp_fulfill_event runtime routine |
GCC 11 | |
Memory management routines | GCC 11 | |
Implicit declare target directive |
GCC 11 | |
omp_get_supported_active_levels routine |
GCC 11 | |
in_reduction clause on target constructs |
GCC 12 | nowait only stub |
affinity clause to task construct |
GCC 12 | Stub only |
close map-type-modifier |
GCC 12 | |
omp_get_device_num runtime routine |
GCC 12 | |
ancestor modifier on device clause |
GCC 12 GCC 13 |
Reverse offload unsupported Reverse offload supported |
Mapping C/C++ pointer variables and to assign the address of device memory mapped by an array section | GCC 12 | |
Mapping of Fortran pointer and allocatable variables, including pointer and allocatable components of variables | GCC 12 | Mapping of vars with allocatable components unsupported |
Map-order clarifications | ? | To be verified |
Array shaping | No | |
Array sections with non-unit strides in C and C++ | No | |
metadirective directive |
No | |
Collapse of associated loops that are imperfectly nested loops | GCC 14 | |
allocate directive |
GCC 14 GCC 15 |
Only C for stack/automatic and Fortran for stack/automatic and allocatable/pointer variables also static variables; C++ unsupported; see also Memory allocation |
Discontiguous array section with target update construct |
No | |
C/C++'s lvalue expressions in to , from and map clauses |
GCC 14 | |
declare mapper directive |
No | |
OMPT interface | No | |
OMPD interface | No |
Feature | GCC Version | Comments |
---|---|---|
OpenMP directive as C++ attribute specifiers | GCC 12 | |
nothing directive |
GCC 12 | |
error directive |
GCC 12 | |
masked construct |
GCC 12 | |
scope directive |
GCC 12 | |
strict modifier in the grainsize and num_tasks clauses of the taskloop construct |
GCC 12 | |
align clause in allocate directive |
GCC 14 | Only C and Fortran |
align modifier in allocate clause |
GCC 12 | |
thread_limit clause to target construct |
GCC 12 | |
has_device_addr clause to target construct |
GCC 12 | |
Extensions to the atomic directive |
GCC 12 | |
seq_cst clause on a flush construct |
GCC 12 | |
private and firstprivate argument to default clause in C and C++ |
GCC 12 | |
omp_set_num_teams , omp_set_teams_thread_limit , omp_get_max_teams , omp_get_teams_thread_limit runtime routines |
GCC 12 | |
omp_calloc , omp_realloc , omp_aligned_alloc , and omp_aligned_calloc runtime routines |
GCC 12 | |
omp_alloctrait_key_t enum: omp_atv_serialized added, omp_atv_default changed |
GCC 12 | |
omp_display_env runtime routine |
GCC 12 | |
OMP_PLACES syntax extensions |
GCC 12 | |
OMP_NUM_TEAMS and OMP_TEAMS_THREAD_LIMIT environment variables |
GCC 12 | |
Support of strictly structured blocks in Fortran | GCC 12 | |
Support of structured block sequences in C/C++ | GCC 12 | |
unconstrained and reproducible modifiers on order clause |
GCC 12 | |
device-specific ICV settings with environment variables | GCC 13 | |
assume and assumes directives |
GCC 13 | |
inoutset argument to the depend clause |
GCC 13 | |
omp_target_is_accessible runtime routine |
GCC 13 | |
omp_target_memcpy_async and omp_target_memcpy_rect_async runtime routines |
GCC 13 | |
omp_get_mapped_ptr runtime routine |
GCC 13 | |
omp_all_memory reserved locator |
GCC 13 | |
nowait clause in taskwait directive |
GCC 13 | |
Support begin/end declare target syntax in C/C++ |
GCC 13 | |
target_device trait in OpenMP Context | No | |
target_device selector set in context selectors |
No | |
C/C++'s declare variant directive: elision support of preprocessed code |
No | |
declare variant : new clauses adjust_args and append_args |
No | |
dispatch construct |
No | |
Loop transformation constructs | GCC 15 | |
Iterators in target update motion clauses and map clauses |
No | |
Indirect calls to the device version of a procedure or function in target regions | GCC 14 | |
interop directive |
No | |
omp_interop_t object support in runtime routines |
No | |
present argument to defaultmap clause |
GCC 14 | |
ompt_scope_endpoint_t enum: ompt_scope_beginend |
No | |
Pointer predetermined firstprivate getting initialized to address of matching mapped list item per 5.1, Sect. 2.21.7.2 | No | |
For Fortran, diagnose placing declarative before/between USE ,
IMPORT , and IMPLICIT as invalid |
No | |
Optional comma between directive and clause in the #pragma form |
No | |
indirect clause in declare target |
GCC 14 | |
device_type(nohost) /device_type(host) for variables |
No | |
present modifier to the map , to and from clauses |
GCC 14 | |
ompt_sync_region_t enum additions |
No | |
ompt_state_t enum: ompt_state_wait_barrier_implementation and ompt_state_wait_barrier_teams |
No | |
ompt_callback_target_data_op_emi_t , ompt_callback_target_emi_t , ompt_callback_target_map_emi_t and ompt_callback_target_submit_emi_t |
No | |
ompt_callback_error_t type |
No |
Feature | GCC Version | Comments |
---|---|---|
omp_in_explicit_task routine and implicit-task-var ICV |
GCC 13 | |
omp /ompx /omx sentinels and omp_ /ompx_ namespaces |
N/A | warning for ompx /omx sentinels (1) |
Clauses on end directive can be on directive |
GCC 13 | |
destroy clause with destroy-var argument on depobj |
GCC 14 | |
Deprecation of no-argument destroy clause on depobj |
No | |
linear clause syntax changes and step modifier |
GCC 13 | |
Deprecation of minus operator for reductions | No | |
Deprecation of separating map modifiers without comma |
No | |
declare mapper with iterator and present modifiers |
No | |
If a matching mapped list item is not found in the data environment, the pointer retains its original value | GCC 14 | |
New enter clause as alias for to on declare target directive |
GCC 13 | |
Deprecation of to clause on declare target directive |
No | |
Extended list of directives permitted in Fortran pure procedures | GCC 14 | |
New allocators directive for Fortran |
GCC 14 | |
Deprecation of allocate directive for Fortran allocatables/pointers |
No | |
Optional paired end directive with dispatch |
No | |
New memspace and traits modifiers for uses_allocators |
No | |
Deprecation of traits array following the allocator_handle expression in uses_allocators |
No | |
New otherwise clause as alias for default on metadirectives |
No | |
Deprecation of default clause on metadirectives |
No | |
Deprecation of delimited form of declare target |
No | |
Reproducible semantics changed for order(concurrent) |
No | |
allocate and firstprivate clauses on scope |
GCC 13 | |
ompt_callback_work |
No | |
Default map-type for the map clause in target enter/exit data |
GCC 13 | |
New doacross clause as alias for depend with source /sink modifier |
GCC 13 | |
Deprecation of depend with source /sink modifier |
No | |
omp_cur_iteration keyword |
GCC 13 | |
For Fortran, optional comma between directive and clause | No | |
Conforming device numbers and omp_initial_device and omp_invalid_device enum/PARAMETER |
GCC 13 | |
Initial value of default-device-var ICV with OMP_TARGET_OFFLOAD=mandatory |
GCC 14 | |
all as implicit-behavior for defaultmap |
GCC 14 | |
interop_types in any position of the modifier list for the init clause of the interop construct |
No | |
Invoke virtual member functions of C++ objects created on the host device on other devices | No | |
iterator and mapper as map-type modifier in declare mapper
| No |
(1) The
ompx
sentinel as C/C++ pragma and C++ attributes are warned for
with -Wunknown-pragmas
(implied by -Wall
) and
-Wattributes
(enabled by default), respectively; for Fortran
free-source code, there is a warning enabled by default and, for fixed-source
code, the omx
sentinel is warned for with -Wsurprising
(enabled by -Wall
). Unknown clauses are always rejected with an
error.
Technical Report (TR) 13 is the third preview for OpenMP 6.0.
Feature | GCC Version | Comments |
---|---|---|
Features deprecated in versions 5.2, 5.1 and 5.0 were removed | N/A | Backward compatibility |
Full support for C 23 was added | GCC 9 / GCC 14 | Increasing coverage (since GCC 9 -std=c2x ,
since GCC 14 -std=c23 ) |
Full support for C++ 23 was added | GCC 11 / GCC 14 | C++ Implementation Status;
increasing coverage (since GCC 11 -std=c++2b ,
since GCC 14 -std=c++23 ) |
Full support for Fortran 2023 was added | GCC 14 | increasing coverage (since GCC 14 -std=f2023 ) |
_ALL suffix to the device-scope environment variables |
GCC 13 | Host device number wrongly accepted |
num_threads now accepts a list |
No | |
Abstract names added for OMP_NUM_THREADS ,
OMP_THREAD_LIMIT and OMP_TEAMS_THREAD_LIMIT |
No | |
Supporting increments with abstract names in OMP_PLACES |
No | |
Extension of OMP_DEFAULT_DEVICE and new
OMP_AVAILABLE_DEVICES environment vars |
No | |
New uid trait for target devices and for
OMP_AVAILABLE_DEVICES and OMP_DEFAULT_DEVICE |
No | |
New OMP_THREADS_RESERVE environment variable |
No | |
The decl attribute was added to the C++ attribute syntax |
GCC 14 | |
The OpenMP directive syntax was extended to include C23 attribute specifiers | GCC 14 | |
Support for pure directives in Fortran's do concurrent |
No | |
All inarguable clauses take now an optional Boolean argument | No | |
The adjust_args clause was extended to specify the argument by
position and supports variadic arguments |
No | |
For Fortran, locator list can be also function reference with data pointer result | No | |
Concept of assumed-size arrays in C and C++ | No | |
directive-name-modifier accepted in all clauses | No | |
Extension of interop operation of append_args ,
allowing all modifiers of the init clause |
No | |
New argument-free version of depobj with repeatable clauses
and the init clause |
No | |
Undeprecate omitting the argument to the depend clause of
the argument version of the depend construct |
GCC 4.9 | |
For Fortran, atomic with BLOCK construct and, for C/C++, with unlimited curly braces supported | No | |
For Fortran, atomic with pointer comparison | No | |
For Fortran, atomic with enum and enumeration types | No | |
For Fortran, atomic compare with storing the comparison result | No | |
Canonical loop sequences and new looprange clause |
No | |
For Fortran, handling polymorphic types in data-sharing-attribute clauses | GCC 12 | private not supported |
For Fortran, rejecting polymorphic types in data-mapping clauses | No | not diagnosed (and mostly unsupported) |
New taskgraph construct including saved modifier
and replayable clause |
No | |
default clause on the target directive and accepting
variable categories |
No | |
Semantic change regarding the reference count update with
use_device_ptr and use_device_addr
| No | |
Support for inductions | No | |
Reduction over private variables with reduction clause |
No | |
Implicit reduction identifiers of C++ classes | No | |
New init_complete clause to the scan directive |
No | |
ref modifier to the map clause |
No | |
New storage map-type modifier; context-dependent
alloc and release are aliases |
No | |
Change of the map-type property from ultimate to default | No | |
self modifier to map and self
as defaultmap argument |
No | |
Mapping of assumed-size arrays in C, C++ and Fortran | No | |
delete as delete-modifier not as map type |
No | |
For Fortran, the automap modifier to the enter
clause of declare_target |
No | |
groupprivate directive |
No | |
local clause to declare_target directive |
No | |
part_size allocator trait for interleaved
allocator partitions |
No | |
pin_device , preferred_device and target_access
allocator traits |
No | |
access allocator trait changes |
No | |
New partitioner value to partition allocator trait |
No | |
Semicolon-separated list to uses_allocators |
No | |
New need_device_addr modifier to adjust_args clause |
No | |
interop clause to dispatch |
No | |
Scope requirement changes for declare_target |
No | |
message and severity clauses to
parallel directive |
No | |
self_maps clause to requires directive |
GCC 15 | |
no_openmp_constructs assumptions clause |
No | |
Restriction for ordered regarding loop-transforming directives |
No | |
apply clause to loop-transforming constructs |
No | |
Non-constant values in the sizes clause | No | |
fuse loop-transformation construct |
No | |
interchange loop-transformation construct |
No | |
reverse loop-transformation construct |
No | |
split loop-transformation construct |
No | |
stipe loop-transformation construct |
No | |
tile permitting association of grid and inter-tile loops |
No | |
strict modifier keyword to num_threads
| No | |
safesync clause to the parallel construct |
No | |
omp_curr_progress_width identifier |
No | |
omp_get_max_progress_width runtime routine |
No | |
Lifted restrictions on order(concurrent) and, hence,
the loop construct |
No | |
atomic permitted in a construct with
order(concurrent) |
No | |
Lifted restrictions on not-strictly-nested regions with
order(concurrent) |
No | |
workdistribute directive for Fortran |
No | |
Fortran DO CONCURRENT as associated loop
in a loop construct |
No | |
New task_iteration directive inside taskloop |
No | |
threadset clause in task-generating constructs |
No | |
New priority clause to target ,
target_enter_data , target_data ,
target_exit_data and target_update |
No | |
New device_type clause to the target directive |
No | |
target_data as composite construct |
No | |
nowait clause with reverse-offload target directives |
No | |
Extended prefer-type modifier to init clause |
No | |
Boolean argument to nowait and nogroup
may be non constant |
No | |
memscope clause to atomic and flush |
No | |
New transparent clause for multi-generational
task-dependence graphs |
No | |
The cancel construct now completes tasks
with unfulfilled events |
No | |
omp_fulfill_event routine was restricted
regarding fulfillment of event variables |
No | |
Added rule for compound-directive names, permitting many more combinations | No | |
omp_is_free_agent and
omp_ancestor_is_free_agent routines |
No | |
omp_get_device_from_uid and
omp_get_uid_from_device routines |
No | |
omp_get_device_num_teams ,
omp_set_device_num_teams ,
omp_get_device_teams_thread_limit , and
omp_set_device_teams_thread_limit routines |
No | |
omp_target_memset and
omp_target_memset_rect_async routines |
No | |
Fortran version of the interop runtime routines | No | |
Routines for obtaining memory spaces/allocators for shared/device memory | No | |
omp_get_memspace_num_resources routine |
No | |
omp_get_memspace_pagesize routine |
No | |
omp_get_submemspace routine |
No | |
omp_init_mempartitioner ,
omp_destroy_mempartitioner ,
omp_init_mempartition ,
omp_destroy_mempartition ,
omp_mempartition_set_part ,
omp_mempartition_get_user_data routines |
No | |
Deprecation of the target_data_op , target ,
target_map and target_submit callbacks
and as values that set_callback must return |
No | |
ompt_target_data_transfer and
ompt_target_data_transfer_async values in
ompt_target_data_op_t enum |
No | |
The values ompt_target_data_transfer_to_device ,
ompt_target_data_transfer_from_device ,
ompt_target_data_transfer_to_device_async and
ompt_target_data_transfer_from_device_async of
the target_data_op OMPT type were deprecated |
No | |
ompt_get_buffer_limits OMPT routine |
No |
Feature | GCC Version | Comments |
---|---|---|
Deprecation of omitting the optional white space to separate adjacent keywords in the directive-name in Fortran (fixed and free source form) | No | |
Deprecation of the combiner expression in the
declare_reduction argument |
No | |
Deprecation of the Fortran include file omp_lib.h |
No |
Feature | GCC Version | Comments |
---|---|---|
Multi-word directives now use underscore by default | No | |
Relaxed Fortran restrictions to the aligned clause |
No | |
Mapping lambda captures | No | |
New omp_pause_stop_tool constant for
omp_pause_resource |
No | |
In Fortran (fixed and free source form), spaces between directive names are mandatory | No | |
Update of the map-type decay for mapping and
declare_mapper |
No |
OpenMP Technical Report 13 (third preview for the OpenMP API Version 6.0) has been released.
OpenMP Technical Report 12 (second preview for the OpenMP API Version 6.0) has been released.
OpenMP Technical Report 11 (first preview for the OpenMP API Version 6.0) has been released.
OpenMP Version 5.2 has been released.
OpenMP Technical Report 10: Version 5.2 Public Comment Draft has been released.
OpenMP Version 5.1 has been released.
OpenMP Technical Report 9: Version 5.1 Public Comment Draft has been released.
GCC 10 has been released. It adds a number of
newly implemented OpenMP 5.0 features on top of the GCC 9 release such as
conditional
lastprivate
clause, scan
and loop
directives, order(concurrent)
and
use_device_addr
clauses support, if
clause on
simd
construct or partial support for the
declare variant
directive, getting closer to full support
of the OpenMP 5.0 standard.
GCC 9 has been released and version 5.0 of the OpenMP specification is now partially supported in the C and C++ compilers. For details which features of OpenMP 5.0 are and which are not supported in the GCC 9 release see this mail.
The OpenMP v5.0 specification has been released.
GCC 7 has been released and version 4.5 of the OpenMP specification is now partially supported in the Fortran compiler; the largest missing item is structure element mapping.
GCC 6 has been released and version 4.5 of the OpenMP specification is now supported in the C and C++ compilers.
The final OpenMP v4.5 specification has been released.
The gomp-4_1-branch
has been merged into
mainline, so GCC 6 and later will feature OpenMP v4.5 support for
C and C++.
Fortran OpenMP v4.0 support has been backported to
gcc-4_9-branch
and will be available in the upcoming
GCC 4.9.1 release.
The last major part of Fortran OpenMP v4.0 support has been committed into mainline.
The gomp-4_0-branch
has been merged into
mainline, so GCC 4.9 and later will feature OpenMP v4.0 support for
C and C++.
The final OpenMP v4.0 specification has been released.
The gomp-3_1-branch
has been merged into
mainline, so GCC 4.7 and later will feature OpenMP v3.1 support.
The final OpenMP v3.1 specification has been released.
A draft of the OpenMP v3.1 specification has been released for
public review. The gomp-3_1-branch
branch has been
created and work began on implementing v3.1 support.
The gomp-3_0-branch
has been merged into
mainline, so GCC 4.4 and later will feature OpenMP v3.0 support.
The final OpenMP v3.0 specification has been released.
Draft of the OpenMP v3.0 specification has been released for
public review, the gomp-3_0-branch
branch has been
created and work began on implementing v3.0 support.
The branch has been merged into mainline, so starting with GCC 4.2 the compiler supports the OpenMP v2.5 specification.
The branch is ready to be merged into mainline. All three front ends are functional and there should not be many corners of the standard left to implement. There are 5 main modules to merge into mainline: (1) runtime library, (2) code generation, (3) C front end, (4) C++ front end, and, (5) Fortran front end.
The runtime library is functionally complete. The syntax parsers for C, C++ and Fortran are complete, though there are still dusty corners with respect to semantic translation to be resolved. Adventurous users who don't mind the compiler crashing on every other source file are encouraged to begin filing bugs.
Copyright (C) Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
These pages are maintained by the GCC team. Last modified 2024-10-09.