-
Notifications
You must be signed in to change notification settings - Fork 156
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
[SSCP] Add atomic support #941
Conversation
// TODO: It seems that at least on gfx90a, there are additional unsafe atomic | ||
// operations that can yield a performance improvement. Should we expose those? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference I think this GROAMCS issue is related. I think we should definitely expose them, however would it be possible to use the __builtin_amdgcn_ds_atomic_fadd_f32
https://gitlab.com/gromacs/gromacs/-/merge_requests/3493
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually the set of enabled clang builtins depends on the frontend. It's likely that amdgcn builtins won't work by default with SSCP because the clang frontend does not know that it will run on anything else but the host CPU.
We could just create a simple __hip/opensycl_sscp_amdgcn_ds_atomic_fadd_f32()
declaration and implement this inside amdgpu/atomic.cpp
with a simple call to the amdgcn builtin. As long as this function is only invoked when JITing for amdgpu (and a GPU that supports it), it should be fine with SSCP.
Co-authored-by: sbalint98 <balint@streamhpc.com>
This PR now provides complete implementations of atomic operations for SPIR-V, PTX, and amdgcn. |
Passes all current atomic tests on all backends. CC @RaulPPelaez |
WIP. Adds support for atomics to the SSCP compiler.