-
Notifications
You must be signed in to change notification settings - Fork 18
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
Adds __popc and __max #116
base: dev
Are you sure you want to change the base?
Conversation
|
||
#if !defined(ALPAKA_ACC_GPU_CUDA_ENABLED) && !defined(ALPAKA_ACC_GPU_HIP_ENABLED) | ||
#if defined(__GNUC__) || defined(__GNUG__) | ||
#define __popc __builtin_popcount |
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 this is better as a function-style macro (taking an argument explicitly) for consistency with others?
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.
Yes we should use a function style macro!+1 for function style macro
|
||
#if !defined(ALPAKA_ACC_GPU_CUDA_ENABLED) && !defined(ALPAKA_ACC_GPU_HIP_ENABLED) | ||
#if defined(__GNUC__) || defined(__GNUG__) | ||
#define __popc __builtin_popcount |
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.
Yes we should use a function style macro!+1 for function style macro
Note: alpaka now has popcount. |
Change or extend as you like.
Edit there is also
__max
, which has to be seen as hotfix.The problem was, that max and min cannot be used as macro, it conflicted user methods with same name. Maybe we use just a global function instead when max and min are not defined respectively, this should be better than this hotfix now.