[Patch] OpenMP: Update OMP_REQUIRES_TARGET_USED for declare_target + interop

Tobias Burnus tburnus@baylibre.com
Wed Sep 25 12:10:31 GMT 2024


Hi

now committed the following as r15-3856-gfcff9c3dad4f35 with two 
testcase additions (and improved changelog wording).

Tobias Burnus wrote:
> OpenMP mandates that when certain clauses are used with 'omp requires' 
> that in all compilation units this requires clause appears.
>
> Those clauses influence the offloading behavior (+ potentially 
> codegen); hence, the must requires must match for those claues when 
> device code is involved. That's the case for device functions (in 
> particular 'declare target') and all OpenMP directives that take a 
> 'device' clause.
>
> Before OpenMP was rather vague, but in .e.g. TR13, it is fortunally 
> more explicit. Thus, this patch adds it for 'declare target' and it 
> adds it ("device" clause!) for 'interop' (but only for Fortran as 
> C/C++ still does not support 'interop' directive plarsing.)

(Side note: the "device global requirement" got only added to the 
'device_safesync' clause after TR13; but we don't support that clause 
yet; it does appear in the commit log only.)

Thanks,

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: committed.diff
Type: text/x-patch
Size: 5109 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20240925/7093781a/attachment.bin>


More information about the Fortran mailing list