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

Private scalars make no sense in OpenACC #2

Open
fspiga opened this issue Feb 18, 2022 · 0 comments
Open

Private scalars make no sense in OpenACC #2

fspiga opened this issue Feb 18, 2022 · 0 comments

Comments

@fspiga
Copy link
Member

fspiga commented Feb 18, 2022

!$acc parallel loop private(itmp,gtau,gu) present(eigts1, eigts2, eigts3, g, mill,drhoc) copyin(u1,u2,u3,drc,fact,mu,gu0)

By default scalars are made local to the generated kernel. This makes them "private" (conceptually) and has the added benefit that these variables are more likely to be put into a registers. When you add a scalar to a private clause, you are creating an array of these scalars in global memory, where each loop iteration has its own element (gang or vector). Since the variable is now in global memory, your code slows down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant