Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

64 bit number support in CUDA

I kind of found various opinions on this topic, so this is why I decided to ask here. My question is starting from what computing capability is int64_t supported on CUDA. I am running cuda 5 on a Quadro770M and the following code works without a problem, although I read that 64 bit unsigned are supported starting from compute capability 1.3. So what is the real answer to that question ?

__device__ void printBinary(int64_t a) {
    int bits[64];
    int i;

    for (i = 0; i < 64; i++) {
        bits[63 - i] = (a >> i) & 1; 
    }

    for (int i = 0; i < 64; ++i) {
        cuPrintf("%d", bits[i]);
    }
    cuPrintf("\n");
    cuPrintf("%016llX", a);
}
like image 288
Zahari Avatar asked Jan 13 '23 06:01

Zahari


1 Answers

64 bit integers (signed and unsigned) are supported on all CUDA-capable hardware (though operations on them map to multiple native 32-bit instructions).

Compute capability 1.3 introduced 64-bit floating point numbers (which are natively supported).

like image 136
tera Avatar answered Feb 06 '23 07:02

tera