Jakub Jelinek wrote:
How is that option different from
echo '#pragma omp requires unified_shared_memory' > omp-usm.h
gcc -include omp-usm.h
?
I mean with -include you can add anything you want, not just one particular
directive, and adding a separate option for each is just weird.

For C/C++, -include seems to be indeed sufficient (albeit not widely known). For Fortran, there at two issues: One placement/semantic issue: it has to be added per "compilation unit", i.e. to the specification part of a module, subprogram or main program. And a practical issue, gfortran shows:

error: command-line option '-include !$omp requires' is valid for C/C++/ObjC/ObjC++ but not for Fortran

Thus, for Fortran it is still intrinsically useful – even if one can argue whether that feature is needed at all / whether it should be added as command-line argument.

Tobias

Reply via email to