CUDA and short size

I am trying to find an answer to the size of short in CUDA documentation. C++ documentation says that the size of short can be at least 16 bits and I am trying to figure out if CUDA follows the same rule.

If the answer to the above question is yes, short can be greater than 16 bits, then does that mean short2 vector types are affected simlarly?

To allow for the seamless integration of host and device code, the size of integer types in CUDA matches the host platform. On all host platforms currently supported by CUDA, sizeof(short) is 2, i.e. short is a 16-bit type. As a corollary, sizeof(short2) is 4.

1 Like