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

Atomics wishlist #1661

Open
6 of 9 tasks
adayton1 opened this issue Jun 4, 2024 · 1 comment
Open
6 of 9 tasks

Atomics wishlist #1661

adayton1 opened this issue Jun 4, 2024 · 1 comment

Comments

@adayton1
Copy link
Member

adayton1 commented Jun 4, 2024

Builtin atomics

  • Investigate using types with guaranteed bitwidth if available (e.g. uint32_t and uint64_t)
  • Investigate supporting builtin atomics on smaller types (e.g. uint8_t and uint16_t)
  • Investigate builtin atomics where available (e.g. __atomic_fetch_add) instead of implementing in terms of atomicCAS
  • Consider adding the builtin atomics to test configurations (i.e. Windows)

Openmp atomics

All atomics

  • Remove use of volatile
  • Add atomicLoad and atomicStore
@adayton1
Copy link
Member Author

adayton1 commented Jun 4, 2024

I'm working on adding atomicLoad and atomicStore, and I noticed that atomicStore is very similar to atomicExchange, which we already have implemented. Should we add atomicStore as an alias to atomicExchange? Or should we make it different by not returning the old value? I'm leaning toward making it an alias to atomicExchange.

EDIT: I made atomicStore a different function that does not return the old value. Jason pointed out some platform intrinsics that don't return a value are more efficient.

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

No branches or pull requests

2 participants