Skip to content

Private scalars make no sense in OpenACC #2

@fspiga

Description

@fspiga
!$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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions