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 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 |
(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
|
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 | Initial support |
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 manual (mainline) |
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 | Only C, only stack variables |
Discontiguous array section with target update construct |
No | |
C/C++'s lvalue expressions in to , from and map clauses |
No | |
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 only stack variables) |
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 | No | |
iterators in target update motion clauses and map clauses |
No | |
indirect calls to the device version of a procedure or function in target regions | No | |
interop directive |
No | |
omp_interop_t object support in runtime routines |
No | |
present argument to defaultmap clause |
No | |
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 |
No | |
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 | |
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 |
GCC 14 | |
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 |
No | |
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 |
(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) 11 is the first 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 |
The decl attribute was added to the C++ attribute syntax
| GCC 14 | |
_ALL suffix to the device-scope environment variables
| GCC 13 | Host device number wrongly accepted |
For Fortran, locator list can be also function reference with data pointer result | No | |
Ref-count change for use_device_ptr /use_device_addr
| No | |
Implicit reduction identifiers of C++ classes | No | |
Change of the map-type property from ultimate to default | No | |
Concept of assumed-size arrays in C and C++ | No | |
Mapping of assumed-size arrays in C, C++ and Fortran | No | |
groupprivate directive
| No | |
local clause to declare target directive
| No | |
part_size allocator trait
| No | |
pin_device , preferred_device and target_access
allocator traits
| No | |
access allocator trait changes
| No | |
Extension of interop operation of append_args , allowing all
modifiers of the init clause
| No | |
interop clause to dispatch
| No | |
apply code to loop-transforming constructs
| No | |
omp_curr_progress_width identifier
| No | |
safesync clause to the parallel construct
| No | |
omp_get_max_progress_width runtime routine
| No | |
strict modifier keyword to num_threads
| No | |
memscope clause to atomic and flush
| No | |
Routines for obtaining memory spaces/allocators for shared/device memory | No | |
omp_get_memspace_num_resources routine
| No | |
omp_get_submemspace routine
| No | |
ompt_get_buffer_limits OMPT routine
| No | |
Extension of OMP_DEFAULT_DEVICE and new
OMP_AVAILABLE_DEVICES environment vars
| No | |
Supporting increments with abstract names in OMP_PLACES
| No | |
Relaxed Fortran restrictions to the aligned clause
| No | |
Mapping lambda captures | No | |
For Fortran, atomic compare with storing the comparison result | No |
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 2023-09-21.