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

Initial Atomic<T> type implementation. #5125

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

csyonghe
Copy link
Collaborator

@csyonghe csyonghe commented Sep 20, 2024

Closes #5084.

Todo: test new Atomic type for all existing targets as well as wgsl target.

@csyonghe csyonghe added the pr: non-breaking PRs without breaking changes label Sep 20, 2024
enum MemoryOrder
{
Relaxed = $(kIRMemoryOrder_Relaxed),
SeqCst = $(kIRMemoryOrder_SeqCst),

Choose a reason for hiding this comment

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

FWIW Vulkan doesn't actually support sequentially consistent atomics. We do support AcquireRelease which is close, but doesn't support some obscure use cases. I think it would be fine to only have Relaxed for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see. SeqCst was added because metal supports it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess we can have AcquireRelease here and map it to SeqCst on metal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WGSL: Intrinsics: atomics
2 participants