diff --git a/src/util/bitscan.h b/src/util/bitscan.h index 541bf79d076..21bdafd1e49 100644 --- a/src/util/bitscan.h +++ b/src/util/bitscan.h @@ -326,6 +326,8 @@ util_bitcount(unsigned n) { #if defined(HAVE___BUILTIN_POPCOUNT) return __builtin_popcount(n); +#elif __OPENCL_VERSION__ + return popcount(n); #else /* K&R classic bitcount. * @@ -366,6 +368,8 @@ util_bitcount64(uint64_t n) { #ifdef HAVE___BUILTIN_POPCOUNTLL return __builtin_popcountll(n); +#elif __OPENCL_VERSION__ + return popcount(n); #else return util_bitcount((unsigned)n) + util_bitcount((unsigned)(n >> 32)); #endif