Follow up to my own comment/question.
The declare target construct can be applied to a function (C, C++ and Fortran) or a subroutine (Fortran) to enable the creation of a device specific version that can be called from a target region.
Are there restrictions? Namely, does it need to be in the same file (translation unit) for C? And for Fortran, in the scope (allowing for a module in a different file)? Is access to a global or static/SAVE variable, volatile variables possible? Does the procedure have to be pure (pure attribute in Fortran)?. Are there restrictions on calling (standard) library functions / INTRINSIC procedures?
Shouldn't there be a recommendation in the spec that calls which would lead to code which cannot be run on the target will be diagnosed by the compiler [(optional) warning]? I assume that then the whole target region is then turned into a non-target version.