This is a re-worked version of #91668. It adds the `cudadevice` module and set the `device` attributes on its functions/subroutines so there is no need for special case in semantic check. `cudadevice` module is implicitly USE'd in `global`/`device` subprogram.