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

Add popcount intrinsic #1004

Merged
merged 2 commits into from
May 28, 2020
Merged

Conversation

sbastrakov
Copy link
Member

@sbastrakov sbastrakov commented May 18, 2020

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 of popcount 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.

@sbastrakov
Copy link
Member Author

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

@BenjaminW3
Copy link
Member

BenjaminW3 commented May 19, 2020

yes, github seems to have some issues. Sometimes some builds do not start on macos. You can ignore them and merge either way.

@sbastrakov
Copy link
Member Author

Okay, now waiting for travis so far, but good to know, thanks for info.

BenjaminW3
BenjaminW3 previously approved these changes May 19, 2020
@sbastrakov
Copy link
Member Author

Now the failing CI for HIP gives

CMake Error at cmake/VerifyCompiler.cmake:24 (find_package):
Could not find a package configuration file provided by "hip" with any of
the following names:
hipConfig.cmake
hip-config.cmake

I don't think this is the problem on this PR's side.

@sbastrakov
Copy link
Member Author

Oh, I meant to re-run one job and it restarted all of them

@psychocoderHPC
Copy link
Member

Now the failing CI for HIP gives

CMake Error at cmake/VerifyCompiler.cmake:24 (find_package):
Could not find a package configuration file provided by "hip" with any of
the following names:
hipConfig.cmake
hip-config.cmake

I don't think this is the problem on this PR's side.

I restarted the job

psychocoderHPC
psychocoderHPC previously approved these changes May 20, 2020
@sbastrakov
Copy link
Member Author

sbastrakov commented May 20, 2020

I believe the same HIP travis job failed again with the same message @psychocoderHPC .

@psychocoderHPC
Copy link
Member

@sbastrakov I updated our HIP requirements in #1006, I hope this will solve the issue.

@BenjaminW3
Copy link
Member

@sbastrakov Please rebase to get the build green again.

Cpu implementations use compiler-specific intrinsics with a fallback to the
standard library.
CUDA and HIP implementation uses built-in intrinsics.
@psychocoderHPC psychocoderHPC merged commit ccce2c8 into alpaka-group:develop May 28, 2020
@sbastrakov sbastrakov deleted the topic-popcount branch May 29, 2020 10:23
@sbastrakov sbastrakov mentioned this pull request May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants