Skip to content

yarpgen support pragma omp simd #202

Description

@huangcj123456

I used the Yargen tool and found a bug in the tool.

wrong code:
void test(int *acc, int *inc) {
#pragma omp simd
for (int i = 0; i < 16; i++)
*acc += *inc;
}

OK code:
void test(int *acc, int *inc) {
#pragma omp simd reduction(+:acc[0])
for (int i = 0; i < 16; i++)
*acc += *inc;
}
The absence of the "reduction" keyword leads to undefined behavior in this test case.

Who knows how to solve this problem?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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