You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"A declare directive is used in the declaration section of a Fortran subroutine,
function, or module."
"In a Fortran module declaration section, only create, copyin, device_resident, and
2084 link clauses are allowed."
For more details on the directive, see "2.13. Declare Directive" in the specification
Implementation approach:
Host functions & subroutines:
Track function/subroutine begin and declarations in scanner tree & indexer
Consider !$acc declare in indexer
Track return statements in scanner tree as child node of function/procedure (begin)
Track function/subroutine end in scanner tree as child node of function/procedure (begin)
Emit unstructured enter data routine call or equivalent shortcut after declaration section of function/subroutine
Emit unstructured exit data routine call or equivalent shortcut before function/subroutine end or return statement
Modules / Program
Track module and declarations in scanner tree & indexer
Consider !$acc declare in indexer
Assumed-size arrays
* [x] Track allocate statements in in scanner tree
* [ ] Emit unstructured enter data routine call or equivalent shortcut after allocate
Explicit-size arrays
??? - not totally sure where to put the allocation
if no save keyword:
body of function/subroutine/program that uses the module
else if save keyword and not already present in global scope (scope 0):
body of function/subroutine/program that uses the module
Emit unstructured enter data routine call or equivalent shortcut where appropriate
Accelerator routines use "acc-declared" variables
Some thoughts:
Device routines can use variables that are mapped to the device via acc declare
statements.
When we generate HIP code, we need to pass the respective device pointers as kernel parameters.
Hence, we would need to add a use statement with the respective module to the caller's (assuming loopnest) parent so that it is available in this scope. In case of gang, worker, vector accelerator routines, this must be done recursively.
The text was updated successfully, but these errors were encountered:
!$acc declare
is not handled yet."A declare directive is used in the declaration section of a Fortran subroutine,
function, or module."
"In a Fortran module declaration section, only create, copyin, device_resident, and
2084 link clauses are allowed."
For more details on the directive, see "2.13. Declare Directive" in the specification
Implementation approach:
Host functions & subroutines:
!$acc declare
in indexerModules / Program
!$acc declare
in indexer* [x] Track allocate statements in in scanner tree
* [ ] Emit unstructured enter data routine call or equivalent shortcut after allocate
Accelerator routines use "acc-declared" variables
Some thoughts:
acc declare
statements.
The text was updated successfully, but these errors were encountered: