Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Apr 1, 2021

See #797

@maleadt maleadt added cuda kernels Stuff about writing CUDA kernels. speculative Not sure about this one yet. labels Apr 1, 2021
@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #798 (ead83fa) into master (87b1f4a) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87b1f4a...ead83fa. Read the comment docs.

"""
@inline sync_threads() = ccall("llvm.nvvm.barrier0", llvmcall, Cvoid, ())
@inline sync_threads(id::Int=0) = ccall("llvm.nvvm.barrier.sync", llvmcall, Cvoid, (Int32,), id)
Copy link
Contributor

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.)

Copy link
Member Author

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.

Copy link
Member Author

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?

Copy link
Contributor

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.

@maleadt maleadt force-pushed the master branch 24 times, most recently from 60efe5e to 8704f80 Compare July 29, 2021 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda kernels Stuff about writing CUDA kernels. speculative Not sure about this one yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants