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

CUDA __popc and __popcll parameter have wrong signedness #65250

Closed
DDoSolitary opened this issue Sep 4, 2023 · 1 comment
Closed

CUDA __popc and __popcll parameter have wrong signedness #65250

DDoSolitary opened this issue Sep 4, 2023 · 1 comment
Assignees
Labels

Comments

@DDoSolitary
Copy link

According to CUDA doc, __popc and __popcll accept unsigned arguments

 __device__int __popc ( unsigned int  x );
 __device__int __popcll ( unsigned long long int x );

but Clang's version is signed

__DEVICE__ int __popc(int __a) { return __nv_popc(__a); }
__DEVICE__ int __popcll(long long __a) { return __nv_popcll(__a); }

While this is mostly harmless, it causes a lot of "narrowing conversion from unsigned to signed is implementation defined" warnings when I was trying to check existing CUDA code with clang-tidy.

@tbaederr tbaederr changed the title CUDA __popc __popcll parameter has wrong signedness CUDA __popc and __popcll parameter have wrong signedness Sep 4, 2023
@Artem-B Artem-B self-assigned this Sep 5, 2023
@Artem-B
Copy link
Member

Artem-B commented Sep 5, 2023

Should be fixed by 2a702ec

@Artem-B Artem-B closed this as completed Sep 5, 2023
avillega pushed a commit to avillega/llvm-project that referenced this issue Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants