japaric-archived / nvptx-builtins

Apache License 2.0
2 stars 2 forks source link

Signed mismatch for intrinsics? #1

Open beamspease opened 7 years ago

beamspease commented 7 years ago

Hi,

I noticed that the nvptx repo was using wrapping_add, which was curious. In looking into it, I noticed that the type of the intrinsics seems to differ from what the CUDA guide states. Is this intentional?

http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#built-in-variables

japaric commented 7 years ago

The LLVM definition use i32 so I'm sticking to that. If you are using C/C++ (and CUDA is C/C++ + some language extensions) I suppose it doesn't matter what LLVM (the backend) uses because the compiler will implicitly cast between integer types.

beamspease commented 7 years ago

That makes sense. I'd assume that we're nowhere near 2,147,483,647 blocks so it probably doesn't matter right now for signed/unsigned.