Skip to content

Commit 2a702ec

Browse files
committed
Use unsigned types for __popc/__popcll to match their declarations in CUDA headers.
llvm#65250
1 parent 5458736 commit 2a702ec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/lib/Headers/__clang_cuda_device_functions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ __DEVICE__ unsigned int __pm0(void) { return __nvvm_read_ptx_sreg_pm0(); }
502502
__DEVICE__ unsigned int __pm1(void) { return __nvvm_read_ptx_sreg_pm1(); }
503503
__DEVICE__ unsigned int __pm2(void) { return __nvvm_read_ptx_sreg_pm2(); }
504504
__DEVICE__ unsigned int __pm3(void) { return __nvvm_read_ptx_sreg_pm3(); }
505-
__DEVICE__ int __popc(int __a) { return __nv_popc(__a); }
506-
__DEVICE__ int __popcll(long long __a) { return __nv_popcll(__a); }
505+
__DEVICE__ int __popc(unsigned int __a) { return __nv_popc(__a); }
506+
__DEVICE__ int __popcll(unsigned long long __a) { return __nv_popcll(__a); }
507507
__DEVICE__ float __powf(float __a, float __b) {
508508
return __nv_fast_powf(__a, __b);
509509
}

clang/lib/Headers/__clang_cuda_libdevice_declares.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ __DEVICE__ double __nv_normcdfinv(double __a);
285285
__DEVICE__ float __nv_normcdfinvf(float __a);
286286
__DEVICE__ float __nv_normf(int __a, const float *__b);
287287
__DEVICE__ double __nv_norm(int __a, const double *__b);
288-
__DEVICE__ int __nv_popc(int __a);
289-
__DEVICE__ int __nv_popcll(long long __a);
288+
__DEVICE__ int __nv_popc(unsigned int __a);
289+
__DEVICE__ int __nv_popcll(unsigned long long __a);
290290
__DEVICE__ double __nv_pow(double __a, double __b);
291291
__DEVICE__ float __nv_powf(float __a, float __b);
292292
__DEVICE__ double __nv_powi(double __a, int __b);

0 commit comments

Comments
 (0)