Wrong type in setp. ptx instruction.


Nsight compute reports this part of code:

if(N1 & d_A0[tid])

as PTX:

mul.wide.u32 %rd4, %r1, 8;
add.s64 %rd5, %rd3, %rd4;
ld.const.u64 %rd6, [N1];
and.b64 %rd7, %rd1, %rd6;
setp.eq.s64 %p2, %rd7, 0;

N1 is uint64_t and d_A0 is uint64_t, now, shouldn’t setp.eq.s64 be setp.eq.u64? Isn’t applying the wrong .type?


The sign bit is also compared on equality of checks integer types. The comparison against 0 therefore creates correct results for all possible integer values (even unsigned ints that would overflow into negative signed integers).

I see, thanks.