I was experimenting with some Fortran codebase that was meant to be compiled with nvfortran.
And I got an error with both gfortran and flang for the following MRE. a.f90 file:
end subroutine foo
!$acc routine (foo) seq
end subroutine bar
The error for flang is error: No function or subroutine declared for 'foo'. This can be fixed with adding external foo to the bar.
I wonder if this extension could be implemented in flang and accepted? For sure, it have to be disabled by default and enabled by a flag.
I guess we will probably have extension in flang similar to what is done for OpenMP in clang. I’m not sure it makes sense to add it now since the support for OpenACC is still under development and even the basic case is not working.
And, there’s discussion in the OpenACC issue tracker https://github.com/OpenACC/openacc-spec/issues/345 (need to be a member of the GitHub OpenACC organization to see this), about whether OpenACC needs to clarify/specify how such and a few other scenarios ought to be handled.