Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions include/cupla/cudaToCupla/runtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,15 @@
#define __fdividef(a,b) ((a)/(b))
#define __expf(a) alpaka::math::exp(acc,a)
#define __logf(a) alpaka::math::log(acc,a)
#define __max(a,b) alpaka::math::max(acc,a,b)
#endif

#if !defined(ALPAKA_ACC_GPU_CUDA_ENABLED) && !defined(ALPAKA_ACC_GPU_HIP_ENABLED)
#if defined(__GNUC__) || defined(__GNUG__)
#define __popc __builtin_popcount
Copy link
Member

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?

Copy link
Member

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

#endif
#ifdef _MSC_VER
#include <intrin.h>
#define __popc __popcnt
#endif
#endif