Found when reviewing the metadirective/context-selector patch, "[PATCH v5 02/10] OpenMP: Re-work and extend context selector resolution", https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671295.html as it touches the related code (without modifying how GCC handles this).
Namely, as I wrote at [1], we did not list 'cpu' as supported 'kind' for the host nor 'nonhost' for the GPU devices and also not 'any' as being supported for both. Well, since the just committed patch (r15-6367-g570d4e4c68535e), https://gcc.gnu.org/onlinedocs/libgomp/OpenMP-Context-Selectors.html now also lists any/cpu/nohost. (See attached patch.) Thanks, Tobias [1] https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671954.html
commit 570d4e4c68535ee4e5b2d82ad02a65fa1ec04112 Author: Tobias Burnus <tbur...@baylibre.com> Date: Thu Dec 19 16:06:21 2024 +0100 libgomp.texi: Update 'arch' context-selector description * libgomp.texi (OpenMP Context Selectors): Document that 'kind' also accepts 'cpu'/'any' on host and 'any'/'nohost' on 'nohost' devices. --- libgomp/libgomp.texi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 6b8000c696f..4e0ed993b2c 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -6687,9 +6687,10 @@ smaller number. On non-host devices, the value of the @c has to be implemented; cf. also PR target/105640. @c For offload devices, add *additionally* gcc/config/*/t-omp-device. -For the host compiler, @code{kind} always matches @code{host}; for the -offloading architectures AMD GCN and Nvidia PTX, @code{kind} always matches -@code{gpu}. For the x86 family of computers, AMD GCN and Nvidia PTX +For the host compiler, @code{kind} always matches @code{host}, @code{cpu} +and @code{any}; for the offloading architectures AMD GCN and Nvidia PTX, +@code{kind} always matches @code{nohost}, @code{gpu} and @code{any}. +For the x86 family of computers, AMD GCN and Nvidia PTX the following traits are supported in addition; while OpenMP is supported on more architectures, GCC currently does not match any @code{arch} or @code{isa} traits for those.