In section 3.1.2 of the CUDA Fortran Programming Guide, it is stated that “A kernel subroutine many not be contained in another subroutine or function, and may not contain any other subprogram”. In section 3.1.5. it says that “A subroutine or function with the device or global attribute must satisfy the following restrictions:…It may not be contained in another subroutine or function”.
Taken literally, this means that only the host main program can call a kernel subroutine. Is this correct, OR, should “another subroutine or function” be read as “another KERNEL subroutine or function”?
Thanks Mat for the reply. I think I understand what you said. So, if one wants to keep the code for a subroutine with attributes (global) somewhere other than in the main program, one would keep it in a module - is this correct?