CUDA / PTX 32-bit and 64-bit

CUDA compilers have options for creating 32-bit or 64-bit PTX. What is the difference between the two? As for x86, do NVidia GPUs actually have 32-bit and 64-bit ISAs? Or is this only related to the host code?

+6
source share
1 answer

Pointers are by far the most obvious difference . The 64-bit machine model includes 64-bit pointers. 64-bit pointers include many features, such as address spaces larger than 4 GB and unified virtual addressing . Unified virtual addressing, in turn, allows other things, such as GPUDirect Peer-to-Peer . The CUDA IPC API also depends on the 64-bit machine model.

ISA x64 is not completely different from ISA x86, basically this is an extension. Those familiar with the x86 ISA will find the familiar x64 ISA, with natural 64-bit extensions where necessary. Similarly, the 64-bit machine model extends the capabilities of the PTX ISA to 64 bits. Most PTX instructions work the same way.

A 32-bit machine model can process 64-bit data types (for example, double and long long ), so often you do not need to make any changes to the correctly written CUDA C / C ++ source code to compile for a 32-bit machine model or 64 bit machine model. If you program directly in PTX, you may need to consider the differences in pointer size , at least.

+7
source

All Articles