Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenACC SCC potentially wrongly privatised arrays for driver #458

Open
MichaelSt98 opened this issue Dec 12, 2024 · 0 comments
Open

OpenACC SCC potentially wrongly privatised arrays for driver #458

MichaelSt98 opened this issue Dec 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MichaelSt98
Copy link
Collaborator

What happened?

the current logic in SCCAnnotateTransformation.annotate_vector_loops() is to make all arrays private that

  • are local arrays
  • and all dimensions being constant

This is perfectly fine for kernels but not always at the driver level.

What are the steps to reproduce the bug?

Imagine having

INTEGER :: LOCAL_ARR(2)

LOCAL_ARR(:) = 10

DO JKGLO=1,NGPTOT,NPROMA
  DO JL=KIDIA,KFDIA
    TMP = LOCAL_ARR(1)
  ENDDO
ENDDO

The resulting code would have

...
!$acc loop vector private(LOCAL_ARR)
DO JL=KIDIA,KFDIA
  ...
ENDDO
...

which is a problem!

Potential solutions

  • dataflow analysis to check whether local array should be privatised or not (whether it is written to before the offload region and only read in the offload region)
  • providing information via config or via the routine that prevents relevant variables from being privatised
  • non-loki fix: hoist the relevant array (so it is no longer a local array)

Version

main

Platform (OS and architecture)

Relevant log output

No response

Accompanying data

No response

Organisation

No response

@MichaelSt98 MichaelSt98 added the bug Something isn't working label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant