-
Notifications
You must be signed in to change notification settings - Fork 239
Implement sync_threads using an unaligned barrier. #798
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #798 +/- ##
=======================================
Coverage 78.46% 78.46%
=======================================
Files 120 120
Lines 7338 7338
=======================================
Hits 5758 5758
Misses 1580 1580 Continue to review full report at Codecov.
|
""" | ||
@inline sync_threads() = ccall("llvm.nvvm.barrier0", llvmcall, Cvoid, ()) | ||
@inline sync_threads(id::Int=0) = ccall("llvm.nvvm.barrier.sync", llvmcall, Cvoid, (Int32,), id) |
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.
Maybe you can just add sync_threads(id::Int)
and keep the old sync_threads()
? People can then start using sync_threads(0)
to see if it works well in practice.
Also, I don't mind just vendoring this definition and experimenting with it. (If it's only me complaining this thing.)
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.
You can also do an aligned barrier with a name. So it might be confusing that the named one is unaligned, while the unnamed one is still aligned.
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.
@tkf Did you end up vendoring this definition then?
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.
This hasn't come up as a problem and I had no chance to play with it.
60efe5e
to
8704f80
Compare
a1af3c1
to
46f6109
Compare
5d585c4
to
c850163
Compare
See #797