[Patch] OpenMP 5.1: Add proc-bind 'primary' support

Tobias Burnus tobias@codesourcery.com
Thu Aug 12 13:17:38 GMT 2021


I will commit the attached patch in a while – unless last-minute
comments or other issues show up.

On 12.08.21 13:31, Jakub Jelinek wrote:
> LGTM, some nits below.
> Maybe in tree-core.h do:
> -  OMP_CLAUSE_PROC_BIND_MASTER = 2,
> +  OMP_CLAUSE_PROC_BIND_PRIMARY = 2,
> +  OMP_CLAUSE_PROC_BIND_MASTER = OMP_CLAUSE_PROC_BIND_PRIMARY,
> and use OMP_CLAUSE_PROC_BIND_PRIMARY for the "primary" cases?
> I'd keep tree-pretty-print.c as is though for now (so print master).
> And in omp-expand we actually just count on those enumerators
> matching the omp.h omp_proc_bind_* ones.
Did so (same enum value for primary and master) but ...
>> -          if (gfc_match ("proc_bind ( master )") == MATCH_YES)
>> +          /* Primary is new and master is deprecated in OpenMP 5.1.  */
>> +          if (gfc_match ("proc_bind ( primary )") == MATCH_YES)
>> +            c->proc_bind = OMP_PROC_BIND_MASTER;
>> +          else if (gfc_match ("proc_bind ( master )") == MATCH_YES)
> Maybe here too with gfortran.h change?
... used for the gfortran-internal enum a disjunct enum value.
>> --- a/libgomp/omp_lib.f90.in
>> ...
>> +#if _OPENMP >= 202011
>> +!GCC$ ATTRIBUTES DEPRECATED :: omp_proc_bind_master
>>   #endif
> ... I think the file is *.f90, not *.F90 and so it isn't preprocessed ...

Turned out that the file is compiled with '-cpp -fopenmp -fsyntax-only'.

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp-proc-bind-primary-v3.diff
Type: text/x-patch
Size: 22266 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20210812/42e81534/attachment-0001.bin>


More information about the Fortran mailing list