-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add popcount intrinsic #1004
Add popcount intrinsic #1004
Conversation
c3ae132
to
b43e09e
Compare
@psychocoderHPC @BenjaminW3 do you know if there is some issue with macos CI? It shows to have failed, but no details given. (Unlike the actual issues shown in my other PR). |
yes, github seems to have some issues. Sometimes some builds do not start on macos. You can ignore them and merge either way. |
Okay, now waiting for travis so far, but good to know, thanks for info. |
b43e09e
to
7f0a4af
Compare
Now the failing CI for HIP gives
I don't think this is the problem on this PR's side. |
Oh, I meant to re-run one job and it restarted all of them |
I restarted the job |
I believe the same HIP travis job failed again with the same message @psychocoderHPC . |
@sbastrakov I updated our HIP requirements in #1006, I hope this will solve the issue. |
@sbastrakov Please rebase to get the build green again. |
7f0a4af
to
6b08a22
Compare
Cpu implementations use compiler-specific intrinsics with a fallback to the standard library. CUDA and HIP implementation uses built-in intrinsics.
This PR implements an alpakafied
popcount()
to be used in kernels. It falls back to CUDA/HIP built-ins on GPUs, tries to use compiler-specific intrinsic on CPUs, and has a fallback standard library implementation.The lonely
popcount()
as of now may seem not worthy to create another directory and concept. I made it assuming the list may be extended in the future, and this sets an example for such extensions. The choice ofpopcount
is since it is required for this work by @bernhardmgruber , and I think generally useful. However, we may think of putting it in some other way.I added a unit test. Works on my machine with Visual Studio, I assume the tests would catch if something is wrong for other platforms.
Not sure where to put it in the docs.
Note: I choose name
popcount
as it would be named so in standard C++20.