[Patch][v2] OpenMP: Add get_device_from_uid/omp_get_uid_from_device routines

Tobias Burnus tburnus@baylibre.com
Thu Sep 19 17:11:32 GMT 2024


Minor update – addressing the issues that Andre raised (thanks!):

'Add.' → 'New functions.' in the ChangeLog for 'fortran.c' and otherwise 
libgomp.texi changes, only:

A bunch of typo fixes (preexisting and in the new text). I also added an 
made-up example UUID for the GPUs, which should help to reduce confusion.

Any additional comments or suggestions?

Tobias

Tobias Burnus wrote:
> in order to know and potentially re-use a specific offload device 
> (reproducibility,
> affinity wise close to a CPU (socket), …) a mapping between an 
> (universal?) unique
> identifier and the OpenMP device number is useful. Thus, TR13 added 
> support for it.
>
> This is a collateral patch caused by looking at the API routines for 
> other reasons
> and looking at that part of the spec during the OpenMP F2F.
>
> Besides the added API routines, the UID will be used elsewhere:
> * In context selectors: 'target_device' supports 'uid(<string>)'.
> * In the OMP_AVAILABLE_DEVICES and OMP_DEFAULT_DEVICE env vars.
>
> @Sandra: Besides the usual .texi part, for the 'target_device' trait set:
> if you add a new GOMP routine for kind/arch/isa - can you also add an
> UID argument such that we don't have to update the API when needing in 
> the
> not so far future.
>
> @Andrew + @Thomas: Any comment? Especially to the nvptx/gcn side 
> (plugin +
> .texi)?
>
> @Jakub or anyone else — any comments, suggestions, remarks?
>
> [The patch was tested without GPUs, with one Nvidia GPU and one AMD GPU
> and seems to work fine.]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp-uid-v2.diff
Type: text/x-patch
Size: 27355 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20240919/157587e4/attachment-0001.bin>


More information about the Fortran mailing list