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: Add memfence before unsetting bit #283

Merged

Conversation

chillenzer
Copy link
Contributor

Second bug fix for making PIConGPU collisions work.

@chillenzer chillenzer added the bug label Feb 5, 2025
@chillenzer chillenzer added this to the 3.0.0 milestone Feb 5, 2025
// before we finish. (The latter scenario might be excluded by other mem_fences in the code.) If a read
// is pending, the old thread might read data from the new thread leading to inconsistent information
// in the first thread.
alpaka::mem_fence(acc, alpaka::memory_scope::Device{});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fence should be moved into destroy() to guard multi page mode allocation too.
We do not have the issue with bitflips in multi page mode but since mallocMC is a caching allocator we are responsible to guarantee that the user can use the allocated memory without side effects.

// bitmask itself, if the chunk size (and thereby the extent of the bitmask) changes before we finish.
// (The latter scenario might be excluded by other mem_fences in the code.) If a read is pending, the old
// thread might read data from the new thread leading to inconsistent information in the first thread.
alpaka::mem_fence(acc, alpaka::memory_scope::Device{});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some as I write below, the fence should guard multi page deallocations too.

@chillenzer chillenzer force-pushed the fix-memfence-before-free branch from c6994b9 to c3c5c5b Compare February 6, 2025 10:15
@psychocoderHPC psychocoderHPC merged commit a1fb8ba into alpaka-group:dev Feb 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants