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

Fix LLAMA_INDEPENDENT_DATA not correctly defined for clang #302

Merged
merged 2 commits into from
Jun 14, 2021

Conversation

bernhardmgruber
Copy link
Member

clang in addition to gcc also defines __GNUC__ and this is the first check when defining LLAMA_INDEPENDENT_DATA, so the macro will be defined using GCC's pragmas and not clang's.
Furthermore, LLAMA_INDEPENDENT_DATA will be changed for clang to also guarantee safe parallel memory access (more guarantees then now), but not encourage loop destribution (which is not part of the semantic of LLAMA_INDEPENDENT_DATA).

clang also defines __GNUC__ and LLAMA_INDEPENDENT_DATA will be defined using GCC's pragmas and not clang's.
…DENT_DATA, but not distribution

The semantic of LLAMA_INDEPENDENT_DATA is to signal independent memory accesses, so we can guarantee safe parallel access. Allowing the compiler to distribute loops is not necessary and goes beyond the meaning of LLAMA_INDEPENDENT_DATA.
@bernhardmgruber bernhardmgruber merged commit a43bf17 into alpaka-group:develop Jun 14, 2021
@bernhardmgruber bernhardmgruber deleted the macro branch June 14, 2021 16:05
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

Successfully merging this pull request may close these issues.

1 participant