GNU Offloading and Multi-Processing Project (GOMP)

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.

Content

Usage

Diagnostics

Documentation

History and Project Goal

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.

Contributing

We encourage everyone to contribute changes and help test GOMP. GOMP has been merged into mainline GCC.

Reporting Bugs

Please add openmp or openacc to the keywords field when filing a bug report.

OpenMP Implementation Status

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.

OpenMP 2.5

OpenMP 3.0

OpenMP 3.1

OpenMP 4.0

OpenMP 4.5

OpenMP 5.0

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 for stack/automatic and Fortran for stack/automatic and allocatable/pointer variables
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

OpenMP 5.1

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 (and not for static 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 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

OpenMP 5.2

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 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
Invoke virtual member functions of C++ objects created on the host device on other devices 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.

OpenMP Technical Report 12

Technical Report (TR) 12 is the second 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)
_ALL suffix to the device-scope environment variables GCC 13 Host device number wrongly accepted
num_threads now accepts a list No
Supporting increments with abstract names in OMP_PLACES No
Extension of OMP_DEFAULT_DEVICE and new OMP_AVAILABLE_DEVICES environment vars 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 C 23 attribute specifiers GCC 14
All inarguable clauses take now an optional Boolean argument 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
For Fortran, atomic with BLOCK construct and, for C/C++, with unlimited curly braces supported No
For Fortran, atomic compare with storing the comparison result No
New looprange clause No
Ref-count change for use_device_ptr/use_device_addr No
Support for inductions No
Implicit reduction identifiers of C++ classes 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
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
message and severity clauses to parallel directive No
self clause to requires directive No
no_openmp_constructs assumptions clause No
reverse loop-transformation construct No
interchange loop-transformation construct No
fuse loop-transformation construct 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
atomic permitted in a construct with order(concurrent) No
coexecute directive for Fortran No
Fortran DO CONCURRENT as associated loop in a loop construct No
threadset clause in task-generating constructs No
nowait clause with reverse-offload target directives No
Boolean argument to nowait and nogroup may be non constant No
memscope clause to atomic and flush No
omp_is_free_agent and omp_ancestor_is_free_agent routines No
omp_target_memset and omp_target_memset_rect_async routines 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_target_data_transfer and ompt_target_data_transfer_async values in ompt_target_data_op_t enum No
ompt_get_buffer_limits OMPT routine No
Relaxed Fortran restrictions to the aligned clause No
Mapping lambda captures No
New omp_pause_stop_tool constant for omp_pause_resource No

OpenMP Releases and Status

November 9, 2023

OpenMP Technical Report 12 (second preview for the OpenMP API Version 6.0) has been released.

November 9, 2022

OpenMP Technical Report 11 (first preview for the OpenMP API Version 6.0) has been released.

November 9, 2021

OpenMP Version 5.2 has been released.

July 15, 2021

OpenMP Technical Report 10: Version 5.2 Public Comment Draft has been released.

November 13, 2020

OpenMP Version 5.1 has been released.

August 20, 2020

OpenMP Technical Report 9: Version 5.1 Public Comment Draft has been released.

May 7, 2020

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.

May 3, 2019

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.

November 8, 2018

The OpenMP v5.0 specification has been released.

May 2, 2017

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.

April 27, 2016

GCC 6 has been released and version 4.5 of the OpenMP specification is now supported in the C and C++ compilers.

November 14, 2015

The final OpenMP v4.5 specification has been released.

October 13, 2015

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++.

June 30, 2014

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.

June 18, 2014

The last major part of Fortran OpenMP v4.0 support has been committed into mainline.

October 11, 2013

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++.

July 23, 2013

The final OpenMP v4.0 specification has been released.

August 2, 2011

The gomp-3_1-branch has been merged into mainline, so GCC 4.7 and later will feature OpenMP v3.1 support.

July 9, 2011

The final OpenMP v3.1 specification has been released.

February 6, 2011

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.

June 6, 2008

The gomp-3_0-branch has been merged into mainline, so GCC 4.4 and later will feature OpenMP v3.0 support.

May 12, 2008

The final OpenMP v3.0 specification has been released.

October 22, 2007

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.

March 9, 2006

The branch has been merged into mainline, so starting with GCC 4.2 the compiler supports the OpenMP v2.5 specification.

November 18, 2005

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.

October 20, 2005

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.