GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libgomp

libgomp: Add OpenMP 6.0 device API routines for teams and thread limits

Adds support for OpenMP 6.0 device routines to query and set the number of teams and thread limit.

This commit introduces four new OpenMP 6.0 API routines: omp_get_device_num_teams, omp_set_device_num_teams, omp_get_device_teams_thread_limit, and omp_set_device_teams_thread_limit. These routines allow users to interact with device-side context information. The implementation avoids unnecessary data copying and corrects tests that incorrectly used older API versions within target regions. Documentation and tests have been updated accordingly.

In Details

Introduces OpenMP 6.0 device information routines (omp_{s,g}et_device_{num_teams,teams_thread_limit}) into libgomp. This required updates to target.c for managing device ICVs and libgomp.map for new symbols. Fixes also address incorrect usage of 5.1 routines in target regions by users, redirecting them to the new 6.0 APIs.

For Context
OpenMP
A standardized API for shared-memory parallel programming. It provides directives and runtime library routines to manage parallelism.
device-side context
Refers to information and state managed on a parallel computing device (like a GPU) rather than the host CPU, often related to offloaded computations.
ICV
Internal Control Variable. These are variables in OpenMP that control the behavior of its runtime library.
target region
A block of code in OpenMP marked with #pragma omp target that is intended to be executed on a device (e.g., GPU) rather than the host CPU.
Filed Under: OpenMPlibgompoffloading