Skip to content

Add RAJA check for accessing global variables in a RAJA loop #9

Open
@bryujin

Description

@bryujin

This would be a check to see if a RAJA lambda is trying to access a global variable. These variables are not captured by the lambda, and can cause problems when utilizing multiple memory spaces, since the lambda won't move the data over automatically.

Example:

static int my_static_var = 3;

int myfunction(double* data, int n)
{
int my_local_var = 5;
RAJA::for_all (RAJA::RangeSegment(0, n, [=](int i) {
...
data[i] += my_static_var; // catch this global variable access
data[i] += my_local_var; // this is fine. Lambda captured local variable
...
} );
}

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